Skip to main content
Clients open one connection, send subscribe and unsubscribe commands, and receive a stream of { channel, data } frames.

Endpoints

/ws serves Spot subscriptions. /ws/perp is Testnet-Only and serves Perpetual Subscriptions. No authentication is required. Set a descriptive User-Agent in non-browser clients.

Delivery Guarantees

Delivery is best effort. Messages can be missed during disconnections, server restarts, upstream gaps, or when a client’s buffer is full.
Reconnecting does not restore subscriptions and does not replay missed messages. Any client holding derived state, such as a local order book or a set of live orders, must resubscribe and reconcile against REST, or it will carry the gap forward.

Reconnecting

Reconnect on close, on heartbeat timeout, and on transport error, using exponential backoff with jitter. After the connection is back:
  1. Resend every subscription.
  2. Discard any locally maintained order book.
  3. For l2Book, wait for a new stream snapshot and replace the book with each frame. Use REST Market Data independently; it has no shared sequence with the stream.
  4. Reconcile other account state through Orders, User Fills, and Balances.
Types that deliver an initial snapshot make this cheaper. See Subscriptions.

Field Encodings

Book sz preserves raw chain base units. Trade/order sizes and wallet balances are human units; check strategy payment-asset units separately. Candle OHLCV fields are JSON numbers. Spot activeAssetCtx mixes numeric base fields and decimal-string extensions. Trailing zeros in canonical decimal strings are collapsed.

Limits

Connections are limited per client IP address, and inbound messages have a maximum size of 4,096 bytes. Prefer one connection carrying many subscriptions over many connections. Command rate limits and the per-connection subscription cap are in Subscriptions. Keepalive timing is in Heartbeats.