stream.read from an organisation with an eligible paid plan. Sign the upgrade with HMAC; your organisation must also have access to the venue. Create an account or manage access in Console.
Subscribe
Use the venue’s outcome token ID, not its event or market ID. On Predict.fun this is the outcome’sonChainId.
Install ws (npm install ws), set BRAVADO_API_KEY, BRAVADO_API_SECRET and BRAVADO_ASSET_ID, then run this as a Node.js .mjs file. Keep the secret server-side.
Node.js
streams array. Unsubscribe with {"op":"unsub","streams":["book:<OUTCOME_TOKEN_ID>"]}. The authenticated route limits an organisation to 200 distinct assets across its keys and connections. An already-subscribed asset does not add another distinct asset to that quota.
Data delivery consumes WebSocket credits. The sample closes after 30 seconds to bound usage. Generate a fresh signature and resubscribe on every reconnect; use backoff rather than retrying authentication failures continuously. Node’s ws responds to protocol pings automatically.
The legacy /stream/{venue}/market and /orderbook-feed/ws routes have a separate Terminal access contract. Use the authenticated routes above for Console integrations and usage attribution.
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.