Orderbook
Subscribe to aggregated orderbook updates for canonical markets. Receive an initial snapshot, then incremental deltas with sequencing and checksums. Client maintains a local book by applying deltas. Request a resnapshot if your local state drifts.
Sequencing: seq increments between consecutive messages for a given market. If you receive a seq that is not your expected next value, request a new snapshot via resnapshot.
Orderbook socket: the same channel is served on wss://ob.agg.market/ws with identical snapshot and delta objects. There, the optional latency subscribe field selects the default 100 ms conflated tier or "realtime". seq is counted separately on each tier; checksum is the same for the same book state. resnapshot stays on the tier the subscribe chose. See Orderbook streams.
Send
Subscribe to orderbook updates for one or more markets
Server responds with a subscribed confirmation, then sends an initial snapshot. Subsequent updates arrive as deltas. Max 100 subscriptions per client (orderbook + trade combined).
Subscribe · Subscribe to orderbook
{ "action": "subscribe", "channel": "orderbook", "outcomeIds": [ "clv2abc123def456", "clv2xyz789ghi012" ], "id": "string"}Unsubscribe from orderbook updates
Unsubscribe · Unsubscribe from orderbook
{ "action": "unsubscribe", "channel": "orderbook", "outcomeIds": [ "clv2abc123def456", "clv2xyz789ghi012" ], "id": "string"}Request a full snapshot (use on checksum mismatch or seq gap)
Resnapshot · Request full snapshot
{ "action": "resnapshot", "channel": "orderbook", "outcomeIds": [ "clv2abc123def456", "clv2xyz789ghi012" ], "id": "string"}Subscribe on the orderbook socket and choose a latency tier
Orderbook socket (wss://ob.agg.market/ws) only. Same subscribe as above plus the optional latency field. Omit it or send "conflated" for the 100 ms default; send "realtime" to opt in. The subscribed ack, snapshot, and deltas that follow are unchanged.
OrderbookSubscribe · Subscribe to orderbook with a latency tier
{ "action": "subscribe", "channel": "orderbook", "outcomeIds": [ "vmo_1" ], "latency": "realtime"}Receive
Full orderbook state (sent on subscribe or seq gap)
Contains the complete aggregated book with venue attribution. Bids sorted descending by price, asks ascending. Wire format: [price, totalSize, {venue: sizeAtPrice}] for aggregated levels, [price, size] for per-venue.
OrderbookSnapshot · Orderbook snapshot
{ "type": "orderbook_snapshot", "outcomeId": "clv2abc123def456", "channel": "orderbook", "seq": 1710000001, "checksum": 2918476531, "bids": [ { "price": 0.55, "totalSize": 1500, "venues": {} } ], "asks": [ { "price": 0.55, "totalSize": 1500, "venues": {} } ], "venueOrderbooks": {}, "venues": {}, "midpoint": 0.55, "spread": 0.01, "timestamp": 1710000000000, "tick": 0, "markSource": "local"}Incremental orderbook update (only changed levels)
Apply bidChanges/askChanges to your local book. size > 0 = upsert, size === 0 = remove. Re-sort after applying. Verify checksum against your local book to detect drift.
OrderbookDelta · Orderbook delta
{ "type": "orderbook_delta", "outcomeId": "clv2abc123def456", "channel": "orderbook", "seq": 1710000001, "checksum": 2918476531, "bidChanges": [ { "price": 0.55, "totalSize": 1500, "venues": {} } ], "askChanges": [ { "price": 0.55, "totalSize": 1500, "venues": {} } ], "venueDeltaBooks": {}, "venues": {}, "midpoint": 0.55, "spread": 0.01, "tick": 0, "markSource": "local", "timestamp": 1710000000000}Subscription/unsubscription confirmations
Subscribed · Subscription confirmed
{ "type": "subscribed", "outcomeIds": [ "clv2abc123def456", "clv2xyz789ghi012" ], "marketIds": [ "string" ], "channel": "orderbook", "id": "string"}Unsubscribed · Unsubscription confirmed
{ "type": "unsubscribed", "outcomeIds": [ "clv2abc123def456", "clv2xyz789ghi012" ], "marketIds": [ "string" ], "channel": "orderbook", "id": "string"}Terminal market resolution event for a subscribed outcome
Emitted once when the underlying market resolves (or closes). Delivered on each subscribed outcome's orderbook stream, with the receiving outcome's id in outcomeId. result is the winning outcome label (or null for voided/scalar markets), and outcomes carries the full sibling array so clients can render "X won, Y lost" without a second subscription. After this event the gateway tears down the orderbook channel — no further deltas or trades will arrive for the resolved outcome.
MarketResolved · Market resolved
{ "type": "market_resolved", "outcomeId": "clv2abc123def456", "status": "resolved", "result": "Yes", "outcomes": [ { "label": "Yes", "winner": true, "externalIdentifier": "0xabc123", "payoutPerShare": 0, "refundAtCost": true, "winnerSource": "venue" } ], "timestamp": 1710000000000}