Overview
The Roxom WebSocket API provides real-time access to market data and account updates with minimal latency. Use it to build trading applications, monitor portfolios, and implement algorithmic trading strategies.What you can access
Market Data Streams
Market Data Streams
Authentication required for market data streams:
- Level 1 Quotes: Best bid and ask prices and quantities
- Trade Executions: Real-time trade data with volume statistics
- Order Book Depth: Complete order book with multiple price levels
- Ticker Data: Real-time price and market statistics including funding rates and open interest
Private Account Data
Private Account Data
Authentication required for private account streams:
- Order Updates: Real-time order status changes and fills
- Balance Changes: Account balance updates from trades and transfers
- Position Updates: Position changes and PnL updates
Connection URLs
Supported trading pairs
Current supported symbols for market data streams:Message format
All WebSocket messages use JSON format with a consistent structure:Client to server messages
Server to client messages
Supported channels
Account Event Broadcasting: Account-related events (
orders, positions, balance) are automatically sent to all authenticated connections for your account, regardless of individual subscriptions. This ensures you never miss critical account changes.Connection lifecycle
1
Establish Authenticated Connection
All WebSocket connections require authentication using API key headers during the connection handshake.
2
Handle Connection Events
Implement proper event handlers for connection management.
3
Subscribe to Channels
Send subscription messages for the data streams you need.
4
Handle Messages
Process incoming real-time data and maintain connection status.
5
Maintain Connection
Implement ping/pong and reconnection logic for reliability.
Key features
Low Latency
Sub-millisecond message delivery for time-sensitive trading applications
Multiple Streams
Subscribe to multiple symbols and channels simultaneously
Reliable Delivery
Built-in heartbeat and reconnection mechanisms
Efficient Updates
Delta updates minimize bandwidth usage for order book streams
Best practices
Connection Management
Connection Management
- Single Connection: Use one connection per application when possible
- Reconnection Logic: Implement exponential backoff for reconnections
- Heartbeat Monitoring: Send ping frames every 30 seconds
- Resource Cleanup: Properly close connections when shutting down
Subscription Management
Subscription Management
- Selective Subscriptions: Only subscribe to data you actually need
- Unsubscribe Unused: Remove subscriptions you no longer need
- Batch Operations: Subscribe to multiple channels in single message
- Symbol Validation: Verify symbol names before subscribing
Error Handling
Error Handling
- Graceful Degradation: Handle connection drops gracefully
- Error Parsing: Always validate JSON before parsing
- Retry Logic: Implement smart retry mechanisms
- Logging: Log connection events for debugging
Getting started
Connection Setup
Learn how to establish and maintain WebSocket connections
Market Data Streams
Subscribe to real-time market data feeds
Account Updates
Receive real-time account and order updates
Authentication
Set up API authentication for private streams