{
"asset_id": "example",
"book": {
"asks": [
null
],
"asset_id": "example",
"bids": [
null
],
"hash": "example",
"last_update_id": 0,
"market_id": "example",
"timestamp": "2026-01-01T00:00:00Z"
},
"exchange_ts": 0,
"kind": "Snapshot",
"local_ts_ms": 0,
"market_id": "example",
"seq": 0
}{
"asset_id": "example",
"changes": [
{
"price": null,
"side": null,
"size": 0.5
}
],
"exchange_ts": 0,
"kind": "Delta",
"local_ts_ms": 0,
"market_id": "example",
"seq": 0
}{
"asset_id": "example",
"kind": "Clear",
"local_ts_ms": 0,
"market_id": "example",
"reason": null,
"seq": 0
}{
"kind": "Connected"
}{
"gap_ms": 0,
"kind": "Reconnected"
}{
"dropped": 0,
"first_seq": 0,
"kind": "Lagged",
"last_seq": 0
}{
"kind": "BookInvalidated",
"market_id": "example",
"reason": null
}{
"kind": "Error",
"message": "example"
}{
"market_id": "example",
"outcome": "example"
}{
"market_id": "example",
"outcome": "example"
}Subscribe per market — OpenPX delivers a Snapshot on first subscribe and Delta updates thereafter. Clear and BookInvalidated indicate the cached book should be discarded and rebuilt from the next Snapshot.
Documentation Index
Fetch the complete documentation index at: https://docs.openpx.trade/llms.txt
Use this file to discover all available pages before exploring further.
{
"asset_id": "example",
"book": {
"asks": [
null
],
"asset_id": "example",
"bids": [
null
],
"hash": "example",
"last_update_id": 0,
"market_id": "example",
"timestamp": "2026-01-01T00:00:00Z"
},
"exchange_ts": 0,
"kind": "Snapshot",
"local_ts_ms": 0,
"market_id": "example",
"seq": 0
}{
"asset_id": "example",
"changes": [
{
"price": null,
"side": null,
"size": 0.5
}
],
"exchange_ts": 0,
"kind": "Delta",
"local_ts_ms": 0,
"market_id": "example",
"seq": 0
}{
"asset_id": "example",
"kind": "Clear",
"local_ts_ms": 0,
"market_id": "example",
"reason": null,
"seq": 0
}{
"kind": "Connected"
}{
"gap_ms": 0,
"kind": "Reconnected"
}{
"dropped": 0,
"first_seq": 0,
"kind": "Lagged",
"last_seq": 0
}{
"kind": "BookInvalidated",
"market_id": "example",
"reason": null
}{
"kind": "Error",
"message": "example"
}{
"market_id": "example",
"outcome": "example"
}{
"market_id": "example",
"outcome": "example"
}Full orderbook snapshot. Caller should replace any cached book keyed by (market_id, asset_id). market_id is the parent market on every exchange; asset_id is the per-outcome identifier (Polymarket token, Kalshi ticker). Emitted on initial subscribe and after any BookInvalidated / Clear recovery path.
Incremental change to an existing book. Apply in-place, or discard if the caller has seen a matching Clear / BookInvalidated without a follow-up Snapshot yet.
Book invalidation on the same stream as Snapshot / Delta, so a consumer can say "seq N was Clear, drop anything with seq ≤ N, wait for the next Snapshot" without merging with the session stream. Mirrors SessionEvent::BookInvalidated, which stays as the connection-level signal for global observability.
Initial socket establishment.
Socket re-established after an observed outage. gap_ms is the wall-clock interval between the last received message and this event. Callers who maintain per-market books should discard them and wait for the next WsUpdate::Snapshot for each subscribed market.
Outbound dispatch channel overflowed — a slow consumer missed deltas. Unlike tokio::sync::broadcast which silently skips ahead, openpx raises this explicitly and invalidates every affected book, because a missed delta corrupts book state in a way the caller cannot detect from the stream alone.
A specific market's book is no longer trustworthy. Caller should discard its cache for that market_id and wait for the next WsUpdate::Snapshot.
A non-fatal error observed on the connection. The session continues; the caller is informed in case they want to log or alert.
Add to the active orderbook subscription set
Remove from the active orderbook subscription set