Skip to main content
The WebSocket API streams real-time order book, order and deposit updates over a single authenticated socket — through the same gateway as the REST API (no separate host or port).

Endpoint

Authenticating the handshake

The socket uses the same HMAC-SHA256 scheme as REST — the four X-API-* headers described in the API Overview. The handshake is an HTTP GET upgrade with an empty body, so sign:
  • METHOD = GET
  • path = /api/v1/trading/ws
  • body = empty string → sha256_hex("")
Pass the four X-API-* headers on the upgrade request. The host/port are not part of the signature, so the same signing code works against any environment. On success the server sends:
If the signature is missing or invalid, the connection is closed immediately.

Subscribing

After auth_success, send subscription frames as JSON text:

Channels & scopes

  • user scope is always you. The key is taken from your authenticated API key — any key you send for a user subscription is ignored, so you can only ever stream your own orders/deposits.
  • orderbook is aggregated, anonymous market depth (public). Symbols are upper-cased server-side.
  • The order and deposit channels are user-scoped only — there is no cross-account “market view.”

Receiving events

Each broadcast is a typed envelope:
The event is <channel>_update (orderbook_update, order_update, deposit_update). When you subscribe to an order book you also receive an immediate snapshot:
An invalid subscription returns an error frame:

Example client (Node.js, ws)

Keepalive

Idle connections are held open for a long window, but very quiet sockets can still be dropped by intermediaries. Send a periodic ping (or a lightweight re-subscribe) if you expect long gaps between messages, and reconnect with a fresh signed handshake on disconnect.