Connecting
Open a WebSocket connection to one of the available endpoints:/ws/v1/user endpoint requires per-message authentication. See User orders for details.
On a successful connection, the server sends a connected message:
Message format
All messages are JSON. The server may batch multiple JSON objects into a single WebSocket frame separated by newlines (\n). Clients must split on newlines before parsing each line:
Client messages
Messages sent from the client to the server follow this structure:type field is always required.
Server messages
Messages sent from the server to the client:Subscribing and unsubscribing
Subscribe to a channel by sending asubscribe message with the required fields:
unsubscribe message with the room name:
unsubscribed message:
Room naming
Room names are constructed from the channel and subscription parameters:Keepalive
The server sends WebSocket-level ping frames every ~54 seconds. Most WebSocket libraries handle pong replies automatically. You can also send an application-level ping to verify the connection is alive:Reconnection
Connections can drop due to network issues, server restarts, or idle timeouts. Implement reconnection with exponential backoff:Limits
WebSocket upgrades are rate-limited per IP.