Skip to main content
Subscribe inputs and receive frames for the unified orderbook WebSocket channel, crosswalked against the upstream AsyncAPI specs cached under schema/upstream/. Every source entry is one of three types — direct (taken from upstream), synthetic (constructed by OpenPX), or omitted (not exposed upstream).

Coverage

ExchangeDirectSyntheticOmitted
kalshi451
polymarket370

Subscribe payload

Fieldkalshi sourcepolymarket sourceNotes
market_id#/components/messages/subscribeCommand#/components/messages/subscriptionRequestkalshi: Kalshi params.market_ticker (single) or params.market_tickers (batch). OpenPX issues one ticker per subscribe() call; multi-market is emulated by repeated subscribes. polymarket: Polymarket assets_ids[*] (token id). Companion-pair flow internally subscribes both YES and NO tokens of a binary outcome.
outcomeomittedsynthetickalshi: Kalshi binary markets are keyed by ticker only; outcome is implicit (yes_dollars_fp vs no_dollars_fp in book frames). polymarket: Inferred from register_outcomes(yes_token, no_token) at construction time; not part of the upstream subscribe payload.

Receive messages

Variantkalshi sourcepolymarket sourceNotes
Snapshot#/components/messages/orderbookSnapshot#/components/messages/bookkalshi: First frame on subscribe; full bid/ask map keyed by yes_dollars_fp/no_dollars_fp. polymarket: First frame on subscribe; arrays of \{price,size\} levels per side.
Delta#/components/messages/orderbookDelta#/components/messages/priceChangekalshi: Per-level deltas; OpenPX reconstructs the book from snapshot + deltas. polymarket: Batched per-asset price changes; one delta frame can carry multiple assets.
Clearsyntheticsynthetickalshi: Emitted by OpenPX on reconnect or sequence gap; no upstream Kalshi message. polymarket: Emitted by OpenPX on reconnect or sequence gap; no upstream Polymarket message.

Session events

Variantkalshi sourcepolymarket sourceNotes
Connectedsyntheticsynthetickalshi: Local-only signal once the websocket handshake completes. polymarket: Local-only signal once the websocket handshake completes.
Reconnectedsyntheticsynthetickalshi: Emitted after the auto-reconnect loop re-establishes the socket. Followed by BookInvalidated for every market that was subscribed. polymarket: Emitted after the auto-reconnect loop re-establishes the socket. Followed by BookInvalidated for every asset that was subscribed.
Laggedsyntheticsynthetickalshi: Emitted when the consumer cannot keep up and the dispatcher drops messages. Carries dropped count + first/last sequence. polymarket: Emitted when the consumer cannot keep up and the dispatcher drops messages. Carries dropped count + first/last sequence.
BookInvalidatedsyntheticsynthetickalshi: Sequence gap, reconnect, or upstream error invalidates the local book; consumer should re-snapshot. polymarket: Sequence gap, reconnect, or upstream error invalidates the local book; consumer should re-snapshot.
Error#/components/messages/errorResponsesynthetickalshi: Kalshi-side error frame (subscribe rejected, auth failure, etc.) surfaces as SessionEvent::Error. polymarket: Polymarket has no typed error frame — connection errors and JSON-parse failures surface as SessionEvent::Error constructed locally.

Source specs

Tables are auto-generated from schema/mappings/. CI fails if any direct ref no longer resolves in the cached upstream AsyncAPI spec; the daily upstream-refresh PR surfaces drift here.