Skip to content
UDX
Esc
↑↓navigate↵open⌘Jpreview

Subscribe to Order Book Updates

UDX validates and reserves the complete batch before assigning one subscription ID per ticker. The single subscribed response contains an always-array subscriptions field and is enqueued before any sequenced data for the returned subscriptions. Each subscription becomes ready only when its own initial snapshot arrives. Retrying an exact batch on the same connection returns its existing subscription IDs without a second delivery; a partial overlap is rejected atomically.

RECEIVE/ws
Authorization
UDX-Access-KeyAPI key · headerrequired
API key signature over `timestamp + "GET" + "/ws"`. The channel binding lists the required upgrade headers.
or
UDX-Access-KeyAPI key · headerrequired
API key signature over `timestamp + "GET" + "/ws"`. The channel binding lists the required upgrade headers.
Message
idinteger<int64>required
Client-assigned command correlation ID, unique among commands in flight on this connection.
min 1 · max 9007199254740991
cmdstringrequired
Selects the subscribe command.
paramsobjectrequired
Markets and common L2 view requested for independent subscriptions. Any ticker in the caller-visible public market catalog is subscribable regardless of market status. Lifecycle transitions do not end the subscription; removal from that catalog does.
Show properties
channelsstring[]required
The initial protocol supports only the order book channel.
min items 1 · max items 1
tickersstring[]required
A canonical non-empty list of distinct market tickers. The protocol ceiling is 250; an operational profile may impose a lower limit.
min items 1 · max items 250
levelstring
Aggregated market-by-price depth. Later protocol versions may add L1 or entitled L3 without changing this version's closed schema.
default: "L2"
depthinteger
Maximum visible levels per side; omission requests 25.
min 1 · max 25 · default: 25
Channel bindings
ws
methodGET
headers
UDX-Access-Keystringrequired
Opaque API key ID.
min length 1 · max length 255
UDX-Access-Timestampstringrequired
Unix time in milliseconds.
max length 13 · matches ^[0-9]{13}$
UDX-Access-Signaturestringrequired
Base64 RSA-PSS/SHA-256 signature.
min length 1 · max length 1024
Sec-WebSocket-Protocolstringrequired
Negotiated dated WebSocket API version.
Example
wscat -c 'wss://api.uat.udx.underdogsports.com/ws'
> {"id":1,"cmd":"subscribe","params":{"channels":["orderbook"],"tickers":["UDX-EXAMPLE-MARKET-A","UDX-EXAMPLE-MARKET-B"],"level":"L2","depth":10}}
Message
{
  "id": 1,
  "cmd": "subscribe",
  "params": {
    "channels": [
      "orderbook"
    ],
    "tickers": [
      "UDX-EXAMPLE-MARKET-A",
      "UDX-EXAMPLE-MARKET-B"
    ],
    "level": "L2",
    "depth": 10
  }
}