Skip to main content
Connect to the public endpoint for your venue. No API key is required on these routes.

Subscribe

Use the venue’s outcome token ID, not its event or market ID. On Predict.fun this is the outcome’s onChainId.
Alternatively, pass ?streams=book:<OUTCOME_TOKEN_ID> on the connection URL. Subscribe to multiple tokens with a streams array. Unsubscribe with {"op":"unsub","streams":["book:<OUTCOME_TOKEN_ID>"]}. The public route accepts up to 120 streams per connection.

Read the messages

Book frames include channel: "book", venue, asset, type, seq, ts and, for snapshots and deltas, bids and asks.
  • Each price level is [price, size], with both values encoded as decimal strings.
  • Both snapshots and deltas contain complete sides, not level patches. Replace the previous sides on each frame.
  • Bids are descending; asks are ascending. A transient crossed book is possible during venue updates.
  • Sequence numbers are per venue and asset. A snapshot resets local book state; do not infer ordering across venues.
  • ts is Bravado’s timestamp in milliseconds. upstreamTs is the venue timestamp when available, otherwise null.
  • Status frames distinguish live and degraded. Check reason; a connection or status frame alone does not mean a fresh book has arrived.
Reconnect and resubscribe after a disconnection. Do not display a buffered book as fresh while the stream is degraded.

Coverage

These routes serve live order books. Predict.fun subscriptions require an indexed binary market and its outcome token IDs. The enriched trade feed is a separate Polymarket feed; book changes are not executions. For historical L2 or bulk extracts, see historical data and custom delivery.