Skip to main content

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:
  1. Send subscribe messages for the feeds you need.
  2. Wait for confirmation messages where the server provides them.
  3. 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.
Payload variants use tagged union-style schemas in AsyncAPI (several 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 your rocket-cluster gateway documents.