The orderbook channel (Documentation Index
Fetch the complete documentation index at: https://docs.predexon.com/llms.txt
Use this file to discover all available pages before exploring further.
"orderbook") streams real-time off-chain orderbook data from Polymarket’s CLOB. Subscribe by token_ids, condition_ids, or market_slugs, or use wildcard (["*"]) for the full firehose of all 100k+ tokens.
- Targeted subscriptions deliver individual events as they happen. Latency is essentially identical to Polymarket’s native feeds.
- Wildcard subscriptions deliver 250ms batched events with price-level conflation.
Subscribe
Filter Types
Exactly one filter type per subscribe message.| Filter | Description | Example |
|---|---|---|
token_ids | CLOB token IDs | ["82855...", "55194..."] |
condition_ids | Market condition IDs | ["0x4c57..."] |
market_slugs | Market URL slugs | ["bitcoin-100k-2026"] |
["*"] with any filter type for the full firehose.
When subscribing by market_slugs or condition_ids, both sides of the market (Yes + No) are resolved and subscribed automatically. You’ll receive a book_snapshot for each outcome. When subscribing by token_ids, you receive only the specific outcome(s) you subscribed to.
users filter is not supported on the orderbook channel. Use the trades channel for wallet-level filtering.Connection Lifecycle
Targeted Subscriptions
Wildcard / Firehose
Event Types
book_snapshot
Sent on subscribe. Includes full orderbook state and market metadata for enrichment.question and event_title are included only in book_snapshot events. Live events (price_change, last_trade, tick_size_change) omit these for bandwidth efficiency. Use the snapshot for display metadata.price_change
Live delta for a single price level. Size"0" means the level was removed; otherwise upsert (add or update).
Field Reference
| Field | Type | Description |
|---|---|---|
event_type | string | "price_change" |
token_id | string | CLOB token ID |
condition_id | string | Market condition ID (hex) |
slug | string | Market URL slug |
outcome | string | "Yes" or "No" |
timestamp | number | Polymarket server timestamp (Unix ms) |
side | string | "BUY" (bid) or "SELL" (ask) |
price | string | Price level (0 to 1) |
size | string | Size at this level ("0" = removed) |
best_bid | string | Current best bid price for this token |
best_ask | string | Current best ask price for this token |
last_trade
Trade execution event.tick_size_change
Emitted when the market’s tick size changes.snapshots_done
Marker sent after all initial snapshots have been delivered.count is the number of book_snapshot events that preceded it.
event_batch
Firehose only. Batched every ~250ms with price-level conflation. Each element in theevents array has the same shape as the data field in individual events (price_change, last_trade, tick_size_change, etc.).
gap: true, events were missed during a reconnect. Client should rebuild state from the next snapshot.
resync
Sent after an internal reconnect. Signals the client to discard local state and rebuild.resync, fresh book_snapshot events and a snapshots_done follow automatically.
Unsubscribe
To stop receiving orderbook events, send an unsubscribe with the subscription ID from the originalack:
