These are fixed tickers, not rolling subscriptions. Read native market metadata for exact open, close and settlement times. A replacement contract is not subscribed automatically when one closes.
Check access first
Use an active Market Data credential withstream.read, an eligible paid plan and an explicit Kalshi data grant. A Data REST key is a different credential class. Keep the secret on your server.
Before connecting, make a signed GET /stream/capabilities. The kalshi row must have implemented, upstream_registered and entitled set to true. Then connect to wss://partner-api.bravadotrade.com/stream/kalshi/partner. Availability is still per market: inspect stream status and wait for a snapshot before using a book.
Server example
Installws, set BRAVADO_API_KEY and BRAVADO_API_SECRET, and run this as a Node.js .mjs file. The example subscribes to one of the four beta tickers and closes after 30 seconds to bound usage.
Node.js
book:, not an outcome token ID. You can request the four tickers on one connection. Authentication helpers cover signing; the shared WebSocket guide covers subscription commands, reconnection and credits. This example is server-side; never put its HMAC secret in browser code.
Use the book safely
- Prices and sizes are decimal strings, including fractional quantities. Preserve them with exact decimal arithmetic.
- Both
snapshotanddeltacarry completebidsandasks. Replace your previous sides; do not add these quantities as increments. Empty or one-sided books can be valid. seqis a Bravado sequence per asset. A snapshot starts a new book state. A missing or unexpected sequence means you must stop using that state and reconnect for a new snapshot.quote.sourceWallUtcis the source’s receive time;quote.venueTsis the venue timestamp when present. Sending-clock fields remain separate.tsis the API timestamp, not the age of the quote. Protocol pings keep the connection alive without making a quiet quote newer.- On
degraded, discard trust in the book. A laterlivestatus or open socket alone does not restore it: wait for a fresh snapshot. Reconnect with a fresh signature and backoff after a disconnection.