Skip to main content
The /ws endpoint carries live order, position, balance, and market updates. The socket can also place and cancel orders, using the same payloads and the same verification path as HTTP.

Connecting

The handshake is challenge-response, so a captured auth frame cannot be replayed onto a different connection.
1

The server challenges

On connect the server sends { "type": "challenge", "nonce": "…" }.
2

The client authenticates

Send an auth frame whose signature is the HMAC over timestamp + GET + /ws + nonce, where the challenge nonce takes the place of the request body and binds the signature to this connection.
3

The server acknowledges

The server replies auth:ack with success. Subscription follows.
Where the key is IP-restricted, the allowlist applies here too. Revoking a key closes any open socket with code 4001, and reconnecting with a revoked key fails authentication.

Topics

Subscription is explicit, so nothing is streamed until it is requested. Send { "type": "subscribe", "topic": "…" } and expect a subscribe:ack. Private topics are filtered to the wallet behind the credential; no other wallet’s stream is reachable.

Sequence gaps

Every data frame carries a seq that is monotonic per connection, per topic:
A gap in seq means data was missed. Resubscribe and reconcile against the REST endpoints before quoting again. Do not interpolate, and do not continue trading on state known to be incomplete.
Track seq per topic rather than globally, and reset the expected value on reconnect.

Liveness

system:heartbeat arrives about every 5 seconds with serverTime and the current trading status. A missed heartbeat means reconnect. system:status fires on a transition between active and paused. Pair it with the halt behaviour: submissions fail while paused, cancels keep working.

Trading over the socket

place and cancel frames accept the same payloads as their HTTP counterparts (up to 20 orders and 50 cancels respectively) and reply with per-item results.
The optional id is echoed back on place:result and cancel:result, which allows replies to be correlated with in-flight requests. Orders must still be signed exactly as described in Orders; the socket saves a round trip, not a signature.
Rate limits are keyed to the credential rather than to the connection, so a socket does not carry a budget of its own. See Errors and Limits.