WebSocket Endpoints
| Endpoint | Purpose | Data Types |
|---|---|---|
/v1/ws/markets | Public market data | Order books, prices, trades |
/v1/ws/private | Private account data | Orders, positions, balances |
Market Data WebSocket
Real-time public market data streaming. WebSocket URL:Market Data Subscription Types
Full Order Book
SUBSCRIPTION_TYPE_MARKET_DATA - Complete order book with all price levels.
Subscribe:
Price Summary (Lite)
SUBSCRIPTION_TYPE_MARKET_DATA_LITE - Best bid/ask and last price only.
Subscribe:
Trade Feed
SUBSCRIPTION_TYPE_TRADE - Individual trade executions.
Subscribe:
Market Data Limits
| Limit | Value |
|---|---|
| Max connections | 1 per API key |
| Max subscriptions | 10 instruments |
| Reconnect cooldown | 5 seconds |
Private Data WebSocket
Real-time private account data streaming. WebSocket URL:Private Data Subscription Types
Order Updates
SUBSCRIPTION_TYPE_ORDER - Real-time order status changes (drop copy).
Subscribe:
Working Orders Snapshot
SUBSCRIPTION_TYPE_ORDER_SNAPSHOT - Snapshot of all open orders.
Subscribe:
Position Changes
SUBSCRIPTION_TYPE_POSITION - Real-time position updates.
Subscribe:
Account Balance
SUBSCRIPTION_TYPE_ACCOUNT_BALANCE - Real-time balance changes.
Subscribe:
Private Data Limits
| Limit | Value |
|---|---|
| Max connections | 1 per API key |
| Reconnect cooldown | 5 seconds |
Python Connection Example
Market Data Connection
Private Data Connection
Managing Subscriptions
Subscribe to Additional Instruments (Market Data)
Unsubscribe from Instruments
Unsubscribe from All
Heartbeats
The server sends periodic heartbeat messages to keep the connection alive:Error Messages
Common Error Codes
| Code | Description |
|---|---|
MAX_SUBSCRIPTIONS_EXCEEDED | Trying to subscribe to more than 10 instruments (market data only) |
INVALID_INSTRUMENT | Instrument ID does not exist |
AUTHENTICATION_FAILED | Invalid API key or signature |
RATE_LIMIT_EXCEEDED | Reconnecting too quickly (5 second cooldown) |
DUPLICATE_CONNECTION | Another connection with same API key exists for this endpoint |
Reconnection Strategy
Best Practices
- Use two separate connections - One for market data, one for private data
- Handle reconnections gracefully - Implement exponential backoff
- Respect the 5-second cooldown - Don’t reconnect immediately after disconnect
- Limit market subscriptions to 10 - Prioritize your most important instruments
- Process messages quickly - Don’t block the message handler
- Monitor heartbeats - Reconnect if you stop receiving them
- Store subscription state - Re-subscribe after reconnection
- 1 connection per API key per endpoint - You can have one connection to
/v1/ws/marketsand one to/v1/ws/privatesimultaneously - 10 instrument maximum on market data - Subscribe to your most actively traded instruments
- Multiple connections per API key per endpoint
- More than 10 simultaneous market data subscriptions