Introduction
Overview of the Cascade WebSocket API.
Purpose
WebSocket API for interacting with Cascade perpetuals clearinghouse.
Protocol
This API uses JSON-RPC 2.0 protocol over WebSocket connections.
All requests must include:
jsonrpc: The JSON-RPC version ("2.0")method: The RPC method to call ("auth", "subscribe", "unsubscribe", "create", or "cancel")params: Parameters for the methodid(optional): Request identifier for matching responses
Subscription Management
- Maximum of 50 concurrent subscriptions per WebSocket connection
- Subscribing to the same channel more than once will return an error
- Unsubscribing from a channel you're not subscribed to will return an error
- Subscriptions are automatically cleaned up when the WebSocket connection closes
Notes
- All timestamps are in milliseconds since the Unix epoch (1970-01-01T00:00:00Z).
- All decimal values (quantities and prices) use '.' as the decimal separator, regardless of locale.
- Authentication is required for position, order, and balance subscriptions, as well as create and cancel operations.
- Balance subscriptions support delegation - users can subscribe to accounts they are delegated to access.
- Responses include timing metadata: usIn, usOut, and usDiff (in milliseconds).
- Streaming data updates (trade, candle, book, order, position, balance) are wrapped with a
typefield for message identification and adatafield containing the actual payload.