Expand description
Kalshi Rust SDK
Unofficial Rust SDK for interacting with the Kalshi trading API. Provides authentication, market data retrieval, portfolio management, and trading functionality.
§Quick Start
use kalshi_rs::{Account, KalshiClient};
use kalshi_rs::markets::models::MarketsQuery;
// 1. Load your API credentials
let account = Account::from_file("kalshi_private.pem", "your-api-key-id")?;
// 2. Create a client
let client = KalshiClient::new(account);
// 3. Use the client to call API endpoints
let markets = client.get_all_markets(&MarketsQuery {
limit: Some(10),
status: Some("open".to_string()),
..Default::default()
}).await?;
println!("Found {} markets", markets.markets.len());§Main Components
KalshiClient- Main client with all API endpoint methodsAccount- Authentication credentials
§API Endpoint Modules
markets- Market data, orderbooks, candlesticks, tradesportfolio- Orders, positions, fills, balanceexchange- Exchange status and scheduleevents- Event informationseries- Series data
§Finding Endpoint Methods
All API endpoint methods are implemented on KalshiClient.
Navigate to the KalshiClient documentation to see all available methods organized by category.
Re-exports§
pub use auth::Account;pub use client::KalshiClient;pub use ws_client::KalshiWebsocketClient;