Topics Reference
WebSocket Topics Reference
This document provides complete documentation for all WebSocket topics, including message structures and field descriptions.
Topic Overview
Public Topics
Trades
Real-time trade stream for a trading pair.
Topic: {pair}@trades
Example: BTC/CHF@trades
Authentication: Not required
Subscribe
Confirmation
Trade Event
Depth (Order Book)
Order book depth updates for a trading pair.
Topic: {pair}@depth@{speed}
Speed Values: 100ms, 1000ms
Example: BTC/CHF@depth@1000ms
Authentication: Not required
Note: The speed parameter is required. It determines how frequently updates are sent (e.g.,
100msfor 10 updates/second,1000msfor 1 update/second).
Subscribe
Full Snapshot Event
Sent on initial subscription and periodically.
Note: When the orderbook is completely empty, only
uis present:{"u": 12345}
Incremental Update Event
Partial updates between snapshots.
Prices
Real-time price feed. Supports multiple price categories.
Topic: *@prices@{category}
Categories: platform, mid, auction, market
Example: *@prices@auction
Authentication: Not required
Debouncing: Yes (500ms)
Subscribe
Price Event
Note: The topic in the response includes the actual pair symbol, not the wildcard.
Market Schedules
Trading schedule updates for a pair.
Topic: {pair}@market-schedules
Example: BTC/CHF@market-schedules
Authentication: Not required
Subscribe
Schedule Event
Authenticated Topics
Sub-Account Orders
Order updates for a specific sub-account. Used for both subscribing to updates and placing/canceling orders.
Topic: {subAccountId}@subaccount-orders
Authentication: Required
Subscribe
Order Event
Sent when an order status changes.
Order Status Values: NEW, PARTIALLY_FILLED, FILLED, CANCELED, REJECTED, EXPIRED
Order Cancel Rejection Event
Sent when a cancel request fails.
Create Order
Response:
Cancel Order
Order cancellation is asynchronous. The server responds in stages:
- Acknowledgment (
tdx:order_cancel_received) - Request received - Submission (
tdx:order_cancel_submitted) - Cancel submitted to exchange - Result (async) - Either
orderevent (status changed) ororder_cancel_rejectif failed
Response Flow:
Note: The
order_cancel_rejectevent arrives asynchronously and may not be immediate. Applications should handle timeouts and check order status separately if confirmation is critical.
Sub-Account OTC Orders
OTC order updates for a specific sub-account.
Topic: {subAccountId}@subaccount-otc-orders
Authentication: Required
Subscribe
OTC Order Update Event
OTC Order Status Values: TENTATIVE, PENDING, OPEN, FILLED, CANCELED, REJECTED, PENDING_CANCEL
Balances
Balance updates for a sub-account. Updates are debounced by instrument.
Topic: {subAccountId}@balances
Authentication: Required
Debouncing: Yes (500ms, by instrument)
Subscribe
Balance Event
Balance Aggregate
Aggregate portfolio value in a quote currency. Updates are debounced.
Topic: {subAccountId}@balance-agg@{quoteCurrency}
Example: 7376524e-6b6b-4137-9719-7e07a7709804@balance-agg@CHF
Authentication: Required
Debouncing: Yes (500ms, by quote currency)
Subscribe
Balance Aggregate Event
Exposures
Exposure and overdraft updates for a sub-account.
Topic: {subAccountId}@exposures
Authentication: Required
Subscribe
Exposure Event
OTC Topics
OTC Trades
Public OTC trade stream for a pair.
Topic: {pair}@otc-trades
Example: BTC/USD@otc-trades
Authentication: Not required
Subscribe
OTC Trade Event
OTC Depth Snapshots
OTC liquidity depth snapshots.
Topic: {pair}@otc-depth-snapshots
Example: BTC/USD@otc-depth-snapshots
Authentication: Not required
Subscribe
OTC Depth Snapshot Event
OTC Pair Listings
OTC pair listing availability updates.
Topic: {pair}@otc-listings
Example: BTC/USD@otc-listings
Authentication: Not required
Subscribe
OTC Listing Update Event
RFQ (Request for Quote)
RFQ is the primary workflow for OTC trading. For complete documentation, see the RFQ documentation in the trading domain.
Topics:
{subAccountId}@quotes- Start quoting, receive streaming quotes{subAccountId}@accept- Accept a quote{subAccountId}@stop- Cancel an RFQ session
Session Management
Cancel on Disconnect
Enable automatic cancellation of all orders when the connection drops.
Topic: Not required Authentication: Required
Response
Notes:
- Only one cancel-on-disconnect session per client account is allowed
- If a second connection attempts to enable this, it will fail
- Orders are canceled when the WebSocket connection closes
Unsubscribe
Unsubscribe from any topic.
Response
Error Handling
All errors are returned with the tdx:error event: