Skip to main content
Major HFT/MM latency win — replaces N parallel calls to fetch_orderbook with a single batched request.

Parameters

market_ids
string[]
required
Identifiers for the books to fetch. Kalshi: market tickers (max 100). Polymarket: CLOB token IDs.

Returns

orderbooks
Orderbook[]
One Orderbook per input. Order matches the input order on Polymarket; Kalshi may return in arbitrary order — match by market_id.
Kalshi binary markets expose a YES half-orderbook plus a NO half. OpenPX unifies these: YES levels become bids; NO bids at price X become asks at price 1 - X. The result is a single book centered on the YES outcome.
let books = ex
    .fetch_orderbooks_batch(vec![
        "KXBTC-25MAR14-T20000".into(),
        "KXBTC-25MAR14-T25000".into(),
    ])
    .await?;
for b in &books {
    println!("{}: bid {:?} / ask {:?}", b.market_id, b.best_bid(), b.best_ask());
}
[
  {
    "market_id": "KXBTC-25MAR14-T20000",
    "asset_id": "KXBTC-25MAR14-T20000",
    "bids": [{ "price": 0.42, "size": 100.0 }, { "price": 0.41, "size": 50.0 }],
    "asks": [{ "price": 0.46, "size": 80.0 }, { "price": 0.47, "size": 200.0 }],
    "timestamp": "2026-04-28T10:15:30Z"
  }
]