Skip to main content
One websocket carries every live update. Public channels need no key.

Quick example

Node.js

Commands

Every command carries an id you choose; the reply echoes it. Subscribe to a series, not a window, to follow it automatically. With series_tickers: ["sol-15m"], each new window’s window_lifecycle event and first orderbook_snapshot arrive on the same subscription — no resubscribing every 15 minutes. You can pass up to 100 tickers per command.

Channels

A channel is what you subscribe to. Each data message it sends carries its own type, which is the message’s name and is not always the channel’s: prices sends price, user_orders sends user_order, market_positions sends market_position, and orderbook_delta sends an orderbook_snapshot first. Switch on type (or on sid), never on the channel name. With an API key you also get three private channels for your own account — see Your account below.

Prices

Symbols are a stock (AAPL), crypto (X:BTCUSD) or a pre-IPO company’s implied valuation (P:OPENAI, P:ANTH — the series’ underlying with a P: prefix), upper case, up to 64 per command. t_ms is when the price printed at its source; ts_ms is when the server sent it. These are the same prices windows open and settle on.

Your account (private channels)

Connect with your API key in the handshake and three more channels open — your own orders, fills and positions, pushed the moment they change. No polling.
Node.js
A bad key is refused before the connection opens (HTTP 401 with the reason, the same messages as REST). Without a key the connection works as before, with the public channels only. They cover your whole account; add market_tickers to narrow them. The channel names are plural where a message is one item: you subscribe to user_orders and receive user_order messages, one per order. user_order carries the same order object as REST, with client_order_id on orders you placed through the API.

Cancel on disconnect

Turn it on for a connection and, if that connection drops for any reason — your program crashes, your network fails, a heartbeat is missed, or we restart the server — every order your account has resting through the API is cancelled. Your quotes never sit on the book while you can’t see it.
Send "enabled": false to turn it off. It applies to the account, so with two connections that both enable it, either one dropping cancels everything. After reconnecting, read GET /portfolio/orders (or subscribe to user_orders) before quoting again.

Sequence numbers and recovery

Every data message has the envelope { type, sid, seq, ts_ms, msg }. seq starts at 1 and goes up by exactly 1 per message on that subscription.
  • If seq jumps, you missed messages. Send update_subscription with action: "get_snapshot" (or resubscribe) and drop your local books until fresh snapshots arrive.
  • Snapshots carry the whole book; deltas carry one level. A delta means: the contracts at price on outcome’s bid side change by delta. A level that reaches 0 is removed.

Checksums

Every orderbook_snapshot and orderbook_delta carries the checksum of the book after it is applied. Compute it on your side after each message; if it doesn’t match, your copy is wrong — request a snapshot.
  1. Take each side’s levels best first (highest price first) and keep the top 10.
  2. Write each level as price:count, exactly as sent on the wire: 0.55:10.
  3. Join a side’s levels with ,, prefix them with up: and down:, and join the two sides with |: up:0.55:10,0.54:3|down:0.44:7 (an empty side is just up: or down:).
  4. The checksum is the CRC-32 (the zlib / PNG one) of that string’s UTF-8 bytes, as an unsigned 32-bit integer.
The REST orderbook returns the same checksum for the same book, so you can seed a book from REST and continue on the websocket.

Limits

The server pings every 10 seconds; standard websocket clients answer automatically. A connection that stops answering is closed. Flooding commands closes the connection with code 1008, and a message over 64 KB with 1009. See Errors for the numbered error replies.