Stream Order Book Data
Each one-ticker subscription has its own gap-detecting sequence. A terminal subscription error ends only that subscription; a connection-fatal condition is reported with a WebSocket close frame. Absolute updates are idempotent and consumers deduplicate by (sid, seq); a forward gap requires the snapshot recovery procedure above.
SEND
/wsAuthorization
UDX-Access-KeyAPI key · headerrequiredAPI key signature over `timestamp + "GET" + "/ws"`. The channel binding lists the required upgrade headers.
or
UDX-Access-KeyAPI key · headerrequiredAPI key signature over `timestamp + "GET" + "/ws"`. The channel binding lists the required upgrade headers.
Message: Order Book Snapshot
typestringrequiredIdentifies a complete order book snapshot.
sidinteger<int64>requiredOpaque server-assigned subscription ID whose lifetime is this WebSocket connection.
min 1 · max 9007199254740991
seqinteger<int64>requiredGap-detection sequence local to one-ticker subscription. It starts at 1 and increments once for every snapshot or update.
min 1 · max 9007199254740991
msgobjectrequiredComplete visible L2 order book state for one market.
Show propertiesHide properties
tickerstringrequiredA market's public ticker.
min length 1 · max length 128
bidsany[][]requiredBid levels in best-first order as `[price, quantity]` pairs.
max items 25
asksany[][]requiredAsk levels in best-first order as `[price, quantity]` pairs.
max items 25
Message: Order Book Update
typestringrequiredIdentifies an incremental order book update.
sidinteger<int64>requiredOpaque server-assigned subscription ID whose lifetime is this WebSocket connection.
min 1 · max 9007199254740991
seqinteger<int64>requiredGap-detection sequence local to one-ticker subscription. It starts at 1 and increments once for every snapshot or update.
min 1 · max 9007199254740991
msgobjectrequiredOne market's complete visible transition between book states.
Show propertiesHide properties
tickerstringrequiredA market's public ticker.
min length 1 · max length 128
changesobject[]requiredAbsolute price-level replacements applied atomically. Array order has no meaning; a zero quantity removes the level.
min items 1 · max items 100
Show propertiesHide properties
Array of
objectsidestringrequired`buy` is bid liquidity and `sell` is ask liquidity, both for YES.
Allowed:
buysellpricestringrequiredYES-side price in dollars as an exact fixed-point decimal string with at most six decimal places.
max length 24 · matches ^[0-9]+(\.[0-9]{1,6})?$
quantitystringrequiredContract quantity as an exact fixed-point decimal string with at most two decimal places. Zero removes an updated price level.
max length 24 · matches ^[0-9]+(\.[0-9]{1,2})?$
Message: Subscription Error
typestringrequiredIdentifies a terminal subscription failure.
sidinteger<int64>requiredOpaque server-assigned subscription ID whose lifetime is this WebSocket connection.
min 1 · max 9007199254740991
msgobjectrequiredClosed set of terminal failures for an order book subscription.
Show propertiesHide properties
One of:
object
codestringrequiredStable machine-readable error code.
detailstringrequiredHuman-readable occurrence detail that clients must not parse.
min length 1 · max length 500
instancestring<uri-reference>requiredRequest ID for troubleshooting with UDX support.
max length 100 · matches ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
object
codestringrequiredStable machine-readable error code.
detailstringrequiredHuman-readable occurrence detail that clients must not parse.
min length 1 · max length 500
instancestring<uri-reference>requiredRequest ID for troubleshooting with UDX support.
max length 100 · matches ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
object
codestringrequiredStable machine-readable error code.
detailstringrequiredHuman-readable occurrence detail that clients must not parse.
min length 1 · max length 500
instancestring<uri-reference>requiredRequest ID for troubleshooting with UDX support.
max length 100 · matches ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Channel bindings
wsmethodGETheadersUDX-Access-KeystringrequiredOpaque API key ID.
min length 1 · max length 255
UDX-Access-TimestampstringrequiredUnix time in milliseconds.
max length 13 · matches ^[0-9]{13}$
UDX-Access-SignaturestringrequiredBase64 RSA-PSS/SHA-256 signature.
min length 1 · max length 1024
Sec-WebSocket-ProtocolstringrequiredNegotiated dated WebSocket API version.
Example
# Prints each message as it arrives
wscat -c 'wss://api.uat.udx.underdogsports.com/ws'const socket = new WebSocket("wss://api.uat.udx.underdogsports.com/ws");
socket.addEventListener("message", (event) => {
console.log(JSON.parse(event.data));
});Message
{
"type": "orderbook_snapshot",
"sid": 7,
"seq": 1,
"msg": {
"ticker": "UDX-EXAMPLE-MARKET-A",
"bids": [
[
"0.45",
"100"
]
],
"asks": [
[
"0.47",
"80"
]
]
}
}{
"type": "orderbook_update",
"sid": 7,
"seq": 2,
"msg": {
"ticker": "UDX-EXAMPLE-MARKET-A",
"changes": [
{
"side": "buy",
"price": "0.45",
"quantity": "125"
},
{
"side": "sell",
"price": "0.47",
"quantity": "0"
}
]
}
}{
"type": "subscription_error",
"sid": 7,
"msg": {
"code": "market_data_unavailable",
"detail": "Current market data is unavailable for this subscription",
"instance": "urn:request-id:4ecbe594-50fa-4b7a-950f-5ed74bb8372d"
}
}