Connection
Open a secure WebSocket to the environment host on path/ws. The AsyncAPI document lists exact hosts for beta, testnet, and devnet.
Subscriptions
Subscriptions are not automatically restored after a disconnect. On every new connection:- Send subscribe messages for the feeds you need.
- Wait for confirmation messages where the server provides them.
- Avoid duplicate subscribe calls for the same feed unless you intend to receive duplicates.
Message flow
- Client → server: JSON text frames (
ClientMessage): subscribe, unsubscribe, ping. - Server → client: JSON text frames (
ServerMessage): market and account updates, confirmations, pong, errors.
ServerMessage::… shapes). Use the WebSocket stream page to inspect each variant and try the playground against your environment.
Heartbeats
If your deployment sends ping frames or application-level pings, respond promptly to avoid idle disconnects. Match whatever policy yourrocket-cluster gateway documents.