Topics Reference

Complete WebSocket topic documentation with message formats

WebSocket Topics Reference

This document provides complete documentation for all WebSocket topics, including message structures and field descriptions.

Topic Overview

TopicPatternAuthDescription
Trades{pair}@tradesNoPublic trade stream
Depth{pair}@depth@{speed}NoOrder book updates (speed: 100ms, 1000ms)
Prices*@prices@{category}NoPrice feed
Market Schedules{pair}@market-schedulesNoTrading hours
Sub-Account Orders{id}@subaccount-ordersYesOrder updates
Sub-Account OTC Orders{id}@subaccount-otc-ordersYesOTC order updates
Balances{id}@balancesYesBalance updates
Balance Aggregate{id}@balance-agg@{quote}YesAggregate balance
Exposures{id}@exposuresYesExposure updates
OTC Trades{pair}@otc-tradesNoOTC trade stream
OTC Depth Snapshots{pair}@otc-depth-snapshotsNoOTC depth
OTC Pair Listings{pair}@otc-listingsNoOTC availability

Public Topics

Trades

Real-time trade stream for a trading pair.

Topic: {pair}@trades Example: BTC/CHF@trades Authentication: Not required

Subscribe

{
  "e": "tdx:subscribe",
  "t": "BTC/CHF@trades"
}

Confirmation

{
  "e": "tdx:subscription_received",
  "t": "BTC/CHF@trades"
}

Trade Event

{
  "e": "trade",
  "t": "BTC/CHF@trades",
  "d": {
    "d": 1705667200000,
    "p": "45000.50",
    "q": "1.5",
    "i": "trade-uuid",
    "a": "BUY"
  }
}
FieldTypeDescription
dintegerTimestamp (Unix milliseconds)
pstringPrice
qstringQuantity
istringTrade ID
astringAggressor side: BUY or SELL

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., 100ms for 10 updates/second, 1000ms for 1 update/second).

Subscribe

{
  "e": "tdx:subscribe",
  "t": "BTC/CHF@depth@1000ms"
}

Full Snapshot Event

Sent on initial subscription and periodically.

{
  "e": "orderbook",
  "t": "BTC/CHF@depth@1000ms",
  "d": {
    "u": 12345,
    "b": [
      ["44999.00", "1.0"],
      ["44998.00", "2.5"]
    ],
    "a": [
      ["45001.00", "0.5"],
      ["45002.00", "1.2"]
    ]
  }
}
FieldTypeDescription
uintegerUpdate ID (always present)
barrayBids (buy orders) as [[price, quantity], ...], sorted by price descending. Omitted if no bids.
aarrayAsks (sell orders) as [[price, quantity], ...], sorted by price ascending. Omitted if no asks.

Note: When the orderbook is completely empty, only u is present: {"u": 12345}

Incremental Update Event

Partial updates between snapshots.

{
  "e": "update",
  "t": "BTC/CHF@depth@1000ms",
  "d": {
    "u": 12340,
    "U": 12345,
    "b": [["44999.00", "1.5"]],
    "a": [["45001.00", "0.0"]]
  }
}
FieldTypeDescription
uintegerFirst update ID in this batch
UintegerLast update ID in this batch
barrayChanged bids as [[price, quantity], ...] (quantity "0.0" = removed)
aarrayChanged asks as [[price, quantity], ...] (quantity "0.0" = removed)

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

{
  "e": "tdx:subscribe",
  "t": "*@prices@auction"
}

Price Event

{
  "e": "price",
  "t": "BTC/CHF@prices@auction",
  "d": {
    "v": "45000.50",
    "c": "-500.00",
    "C": "-1.10"
  }
}
FieldTypeDescription
vstringCurrent price value
cstring (optional)24h change (absolute)
Cstring (optional)24h change (percentage)

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

{
  "e": "tdx:subscribe",
  "t": "BTC/CHF@market-schedules"
}

Schedule Event

{
  "e": "market_schedule",
  "t": "BTC/CHF@market-schedules",
  "d": {
    "c": {
      "state": "OPEN",
      "start": "2025-01-19T09:00:00Z",
      "end": "2025-01-19T17:00:00Z"
    },
    "n": {
      "state": "CLOSED",
      "start": "2025-01-19T17:00:00Z",
      "end": "2025-01-20T09:00:00Z"
    },
    "t": "2025-01-19T17:00:00Z"
  }
}
FieldTypeDescription
cobjectCurrent period
c.statestringCurrent state: OPEN, CLOSED, AUCTION, etc.
c.starttimestampPeriod start time
c.endtimestampPeriod end time
nobject (optional)Next period
ttimestamp (optional)Time of next period change

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

{
  "e": "tdx:subscribe",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@subaccount-orders",
  "a": "jwt_token"
}

Order Event

Sent when an order status changes.

{
  "e": "order",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@subaccount-orders",
  "d": {
    "requestId": "req-123",
    "orderId": "order-456",
    "clientOrderId": "client-123",
    "status": "NEW",
    "type": "LIMIT",
    "side": "BUY",
    "quantity": "1.5",
    "cumulativeQuantity": "0.0",
    "price": "45000.50",
    "symbol": "BTC/CHF"
  }
}
FieldTypeDescription
requestIdstringRequest ID (for correlation)
orderIdstringOrder ID
clientOrderIdstringClient-provided order ID
statusstringOrder status (see below)
typestringLIMIT or MARKET
sidestringBUY or SELL
quantitystringOrder quantity
cumulativeQuantitystringFilled quantity
pricestringLimit price
symbolstringPair symbol

Order Status Values: NEW, PARTIALLY_FILLED, FILLED, CANCELED, REJECTED, EXPIRED

Order Cancel Rejection Event

Sent when a cancel request fails.

{
  "e": "order_cancel_reject",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@subaccount-orders",
  "d": {
    "orderId": "order-456",
    "clientOrderId": "client-123",
    "reason": "Order not found",
    "text": "Unable to cancel"
  }
}

Create Order

{
  "e": "tdx:order_create",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@subaccount-orders",
  "a": "jwt_token",
  "d": {
    "dry": false,
    "order": {
      "subAccountId": "7376524e-6b6b-4137-9719-7e07a7709804",
      "symbol": "BTC/CHF",
      "side": "BUY",
      "type": "LIMIT",
      "quantity": "1.5",
      "price": "45000.50",
      "timeInForce": "GTC",
      "clientOrderId": "client-123"
    }
  }
}
FieldTypeRequiredDescription
drybooleanNoIf true, validates without creating
order.subAccountIdstringYesSub-account ID
order.symbolstringYesPair symbol
order.sidestringYesBUY or SELL
order.typestringYesLIMIT or MARKET
order.quantitystringYesOrder quantity
order.pricestringFor LIMITLimit price
order.timeInForcestringNoGTC, IOC, FOK
order.clientOrderIdstringNoClient-provided ID
order.minQuantitystringNoMinimum fill quantity

Response:

{"e": "tdx:order_create_received", "t": "...@subaccount-orders"}
{
  "e": "tdx:order_create_submitted",
  "t": "...@subaccount-orders",
  "d": {"clientOrderId": "client-123", "orderId": "order-789"}
}

Cancel Order

Order cancellation is asynchronous. The server responds in stages:

  1. Acknowledgment (tdx:order_cancel_received) - Request received
  2. Submission (tdx:order_cancel_submitted) - Cancel submitted to exchange
  3. Result (async) - Either order event (status changed) or order_cancel_reject if failed
{
  "e": "tdx:order_cancel",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@subaccount-orders",
  "a": "jwt_token",
  "d": {
    "orderId": "order-789",
    "subAccountId": "7376524e-6b6b-4137-9719-7e07a7709804"
  }
}

Response Flow:

// Step 1: Acknowledgment (immediate)
{"e": "tdx:order_cancel_received", "t": "...@subaccount-orders"}

// Step 2: Submission
{
  "e": "tdx:order_cancel_submitted",
  "t": "...@subaccount-orders",
  "d": {"requestId": "req-789", "orderId": "order-789"}
}

// Step 3: Result (async - may arrive later)
// Success: order event with updated status
// Failure: order_cancel_reject event

Note: The order_cancel_reject event 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

{
  "e": "tdx:subscribe",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@subaccount-otc-orders",
  "a": "jwt_token"
}

OTC Order Update Event

{
  "e": "otc_order_update",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@subaccount-otc-orders",
  "d": {
    "id": "otc-order-123",
    "subAccountId": "7376524e-6b6b-4137-9719-7e07a7709804",
    "clientOrderId": "client-456",
    "pairId": "pair-789",
    "status": "PENDING",
    "type": "MARKET",
    "side": "BUY",
    "clientAmount": "50000.00",
    "quantity": "1.0",
    "cumulativeQuantity": "0.0",
    "price": "50000.00",
    "timeInForce": "GTC",
    "comment": "optional comment",
    "createdAt": "2025-01-19T10:00:00Z",
    "updatedAt": "2025-01-19T10:00:00Z",
    "triggeredAt": null
  }
}
FieldTypeDescription
idstringOTC order ID
subAccountIdstringSub-account ID
clientOrderIdstringClient-provided ID
pairIdstringPair ID
statusstringStatus (see OTC order status values)
typestringOrder type
sidestringBUY or SELL
clientAmountstringAmount charged to client
quantitystringOrder quantity
cumulativeQuantitystringFilled quantity
pricestringExecution price
timeInForcestringGTC, etc.
commentstringOptional comment
createdAttimestampCreation time
updatedAttimestampLast update time
triggeredAttimestampTrigger time (for scheduled orders)

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

{
  "e": "tdx:subscribe",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@balances",
  "a": "jwt_token"
}

Balance Event

{
  "e": "balance",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@balances",
  "d": {
    "i": "btc-instrument-uuid",
    "a": "2.50000000",
    "o": "0.50000000",
    "w": "0.10000000",
    "c": "0.00000000"
  }
}
FieldTypeDescription
istringInstrument ID
astringAvailable balance
ostringOrders reserved
wstringWithdrawals reserved
cstringSettlement line used

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

{
  "e": "tdx:subscribe",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@balance-agg@CHF",
  "a": "jwt_token"
}

Balance Aggregate Event

{
  "e": "balance-agg",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@balance-agg@CHF",
  "d": {
    "q": "CHF",
    "v": "500000.00"
  }
}
FieldTypeDescription
qstringQuote currency
vstringTotal value in quote currency

Exposures

Exposure and overdraft updates for a sub-account.

Topic: {subAccountId}@exposures Authentication: Required

Subscribe

{
  "e": "tdx:subscribe",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@exposures",
  "a": "jwt_token"
}

Exposure Event

{
  "e": "exposure",
  "t": "7376524e-6b6b-4137-9719-7e07a7709804@exposures",
  "d": {
    "i": "quotation-instrument-uuid",
    "o": "100000.00",
    "u": "50000.00"
  }
}
FieldTypeDescription
istringQuotation instrument ID
ostringOverdraft amount
ustringUtilized amount

OTC Topics

OTC Trades

Public OTC trade stream for a pair.

Topic: {pair}@otc-trades Example: BTC/USD@otc-trades Authentication: Not required

Subscribe

{
  "e": "tdx:subscribe",
  "t": "BTC/USD@otc-trades"
}

OTC Trade Event

{
  "e": "otc-trade",
  "t": "BTC/USD@otc-trades",
  "d": {
    "i": "otc-trade-uuid",
    "p": "50000.00",
    "q": "1.0",
    "s": "Buy",
    "d": 1705667200000
  }
}
FieldTypeDescription
istringTrade ID
pstringPrice
qstringQuantity
sstringSide: Buy or Sell
dintegerTimestamp (Unix milliseconds)

OTC Depth Snapshots

OTC liquidity depth snapshots.

Topic: {pair}@otc-depth-snapshots Example: BTC/USD@otc-depth-snapshots Authentication: Not required

Subscribe

{
  "e": "tdx:subscribe",
  "t": "BTC/USD@otc-depth-snapshots"
}

OTC Depth Snapshot Event

{
  "e": "otc-depth-snapshot",
  "t": "BTC/USD@otc-depth-snapshots",
  "d": {
    "symbol": "BTC/USD",
    "bids": [
      {"price": "49999.00", "quantity": "0.5"},
      {"price": "49998.00", "quantity": "1.0"}
    ],
    "asks": [
      {"price": "50001.00", "quantity": "0.5"},
      {"price": "50002.00", "quantity": "1.0"}
    ],
    "timestamp": "2025-01-19T10:00:00Z"
  }
}
FieldTypeDescription
symbolstringPair symbol
bidsarrayBid levels
asksarrayAsk levels
bids[].pricestringBid price
bids[].quantitystringBid quantity
asks[].pricestringAsk price
asks[].quantitystringAsk quantity
timestamptimestampSnapshot time

OTC Pair Listings

OTC pair listing availability updates.

Topic: {pair}@otc-listings Example: BTC/USD@otc-listings Authentication: Not required

Subscribe

{
  "e": "tdx:subscribe",
  "t": "BTC/USD@otc-listings"
}

OTC Listing Update Event

{
  "e": "otc_listing_update",
  "t": "BTC/USD@otc-listings",
  "d": {
    "pairId": "pair-123",
    "symbol": "BTC/USD",
    "live": true,
    "updatedAt": "2025-01-19T10:00:00Z"
  }
}
FieldTypeDescription
pairIdstringPair ID
symbolstringPair symbol
livebooleanWhether OTC trading is available
updatedAttimestampLast update time

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

{
  "e": "tdx:cancel_on_disconnect",
  "a": "jwt_token"
}

Response

{
  "e": "tdx:cancel_on_disconnect_succeeded"
}

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.

{
  "e": "tdx:unsubscribe",
  "t": "BTC/CHF@trades"
}

Response

{
  "e": "tdx:unsubscription_succeeded",
  "t": "BTC/CHF@trades"
}

Error Handling

All errors are returned with the tdx:error event:

{
  "e": "tdx:error",
  "t": "invalid@topic",
  "d": {
    "message": "Invalid topic format"
  }
}

Common Error Scenarios

ErrorDescription
Invalid topic formatTopic doesn't match {target}@{category} pattern
Authentication requiredToken missing for authenticated topic
Permission deniedUser lacks access to sub-account
Rate limit exceededToo many messages (anonymous: 1 per 500ms)
Invalid event typeUnknown event in e field
Order validation failedOrder parameters invalid
Subscription conflictCancel-on-disconnect already active for account



  © 2025 Taurus SA. All rights reserved.