Skip to main content
The Smart Order Routing WebSocket API provides authenticated, real-time streaming market data and execution data to authorized Smart Order Routing platform customers. This API uses a bidirectional WebSocket connection for both request-response operations and streaming data delivery.
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 the exchange:read_aggregated_marketdata_stream scope. Without this scope, the WebSocket route responds with 403 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

  1. Client establishes WebSocket connection with authentication
  2. Server maintains connection with automatic ping/pong heartbeat
  3. Client subscribes/unsubscribes to data channels (e.g., BTCUSD market data)
  4. Server streams data to subscribed channels
  5. 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:
Response:
The response echoes back the request parameters for each channel, allowing you to correlate which subscription succeeded or failed when subscribing to multiple channels in a single request.

Unsubscribe Operation

Stop receiving updates from specific channels. Request:
Response:
The response echoes back the request parameters for each channel, allowing you to correlate which unsubscription succeeded or failed when unsubscribing from multiple channels in a single request.

List Subscriptions Operation

Get all active subscriptions for your connection. Request:
Response:

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. Example streaming message:

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 →
Example streaming message:

Execution Data Channel

Provides real-time trade execution notifications. Example streaming message:

Heartbeat Channel

Provides logical-level liveness signal for connection monitoring. Example streaming message:

Error Handling

The API uses standardized error codes:
Questions? Contact Support.