WebSocket API Options
Paxos offers two WebSocket API solutions for different use cases:Public WebSocket API
Open access to real-time market and execution data feeds via public WebSocket connections. Ideal for DMA (Direct Market Access) to itBit and general market data consumption. No authentication required.Order Routing WebSocket API
Authenticated, bidirectional WebSocket API exclusively for Order Routing platform customers. Provides request-response operations and streaming data with OAuth2 authentication. Learn more.Order Routing customers should use the authenticated Order Routing WebSocket API for enhanced functionality and authorized access.
Public WebSocket API
The public WebSocket API offers three main data feeds:- Execution Data Feed - Real-time execution data for market trades
- Market Data Feed - Order book updates with initial snapshots and real-time updates
- Stablecoin Market Price Feed - Market index price updates for external stablecoins
See the Websocket trading and stablecoin payments guides for a hands-on introduction.The WebSocket connections provide a number of advantages when compared to the v2 API, including real-time event notifications, minimized data transfers over the network and reduced latency when compared to a polling strategy.
API Reference
For detailed technical specifications, message schemas, and interactive examples, see the API Reference section in the sidebar. The AsyncAPI specification provides complete documentation for all available channels, message types, and data formats.Connection Details
Once a secure (wss://
) connection is established, each feed begins streaming data, subject to the rate limits.
Both Production and Sandbox data feeds have a built-in, instantaneous failover.
Clients should have a reconnection mechanism in case of server disconnection.
Server Endpoints
Production:wss://ws.paxos.com
Sandbox:
wss://ws.sandbox.paxos.com
Available Channels
/executiondata
- All markets execution data/executiondata/{market}
- Single market execution data/marketdata
- All markets order book data/marketdata/{market}
- Single market order book data/marketdata/stablecoin/{market}
- Stablecoin market price data
See the API Reference section for detailed channel specifications and message formats.
Execution Data Feed
The execution data feed provides real-time trade information for market executions. Key behavioral characteristics:- Initial Message: The first message corresponds to the last execution at connection time
- Subsequent Messages: Each new message represents a new execution as it occurs
- Idle Markets: If no executions occur for extended periods, no messages are sent until new activity
- Reconnection: Upon reconnection, you receive the last execution (handle duplicates using
match_number
)
Market Data Feed
The market data feed provides real-time order book updates with two message types:SNAPSHOT Messages
- Initial Response: Shows the complete order book state with bids and asks
- Bids: Prices in descending order with amounts
- Asks: Prices in ascending order with amounts
UPDATE Messages
- Real-time Updates: Show executed trades and order book changes
- Processing Rules:
- When
amount=0
: Remove the price level from the order book - When
amount>0
: Add or update the price level with the new amount - Use
side
field to determine whether to update bids (BUY
) or asks (SELL
)
- When
Available Markets
Market availability varies by environment (Sandbox vs Production) and account restrictions. Use the Get Order Book and List Recent Executions REST endpoints to discover available markets, though these are not suitable for streaming data.Stablecoin Market Price Feed
The stablecoin market price feed provides real-time market index price updates for external stablecoins. Key characteristics:- Current Support: USDCUSD market
- Update Frequency: Typically ~1 message per second, varying with market volatility
- Message Content: Market name, current price (4 decimals), and timestamp
- Real-time Updates: Price updates are pushed as they occur