This API is available only to Smart Order Routing customers on the allow list.
Connection
Endpoints
Production:wss://ws.paxos.com/Sandbox:
wss://ws.sandbox.paxos.com/
Authentication
Authentication is performed during the WebSocket handshake. You must provide valid OAuth2 credentials in the Authorization Bearer header.You must include theexchange:read_aggregated_marketdata_streamscope. Without this scope, the WebSocket route responds with403 Forbidden.
➊ Get OAuth2 Credentials
Request an access token using your client credentials:Sandbox
Production
Response
➋ Establish WebSocket Connection
Use the access token as the Bearer token when establishing the WebSocket connection:Connection Lifecycle
- Client establishes WebSocket connection with authentication
- Server maintains connection with automatic ping/pong heartbeat
- Client subscribes/unsubscribes to data channels (e.g., BTCUSD market data)
- Server streams data to subscribed channels
- Connection closes on client disconnect or server shutdown
Quick Start Example
Here’s a minimal example to get you started:Operations & Message Formats
Subscribe Operation
Subscribe to one or more data channels for real-time updates. Request:Unsubscribe Operation
Stop receiving updates from specific channels. Request:List Subscriptions Operation
Get all active subscriptions for your connection. Request:Data Channels
The Smart Order Routing WebSocket API supports four types of streaming data channels:Market Data Channel
Provides real-time order book updates with initial snapshots and incremental changes.- Channel type:
market_data - Initial message: Full order book snapshot
- Subsequent messages: Incremental updates
- View detailed documentation →
Top of Book Channel
Provides real-time updates of the best bid and best ask prices only.- Channel type:
market_data.top_of_book - Message frequency: On best price changes
- Lightweight alternative to full order book
- View detailed documentation →
Execution Data Channel
Provides real-time trade execution notifications.- Channel type:
execution_data - Message frequency: On each trade execution
- View detailed documentation →
Heartbeat Channel
Provides logical-level liveness signal for connection monitoring.- Channel type:
heartbeat - Message frequency: Periodic heartbeat messages
- No parameters required
- View detailed documentation →
Error Handling
The API uses standardized error codes:Questions? Contact Support.