Subscribe
Use the venue’s outcome token ID, not its event or market ID. On Predict.fun this is the outcome’sonChainId.
?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 includechannel: "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.
tsis Bravado’s timestamp in milliseconds.upstreamTsis the venue timestamp when available, otherwisenull.- Status frames distinguish
liveanddegraded. Checkreason; a connection or status frame alone does not mean a fresh book has arrived.