Endpoint
Authentication
Authenticate with an API key. Create one from your dashboard.4401.
Protocol
All frames are JSON. Client frames are text; server frames are bytes (orjson-serialized UTF-8).Client → server
subscribe/unsubscribeaccept one or manyriver_ids. Duplicate subscribes on the same connection are no-ops.
Server → client
snapshotis sent once on successful subscribe when the orderbook is already cached. Subsequent changes are delivered asupdateframes with an identical payload shape.pendingis sent when the orderbook isn’t in cache yet. A snapshot arrives shortly, followed by updates.reconnectis sent during graceful pod shutdown. Reconnect with a small jitter.
Keepalive
Liveness is handled at the WebSocket protocol layer (RFC 6455 PING/PONG control frames). Standard clients (Pythonwebsockets, browser WebSocket) reply to server PINGs automatically — no application-level heartbeat is needed.
Orderbook payload
is_valid=false indicates a transient crossed-book state at the exchange. The snapshot that follows will have fresh values.
Rate limits and pacing
Updates for any single(connection, river_id) are capped at 20 Hz. Faster upstream changes are coalesced, keeping only the latest pending state per market. Your client will never see stale data — only lower-frequency updates.
Minimal client
Close codes
| Code | Meaning |
|---|---|
1000 | Normal closure |
1011 | Server-side overflow (client couldn’t keep up with the send rate) |
4401 | Missing or invalid authentication |
4503 | Server draining for deploy — reconnect with jitter |

