Skip to main content

Depth (Order Book) Stream

Streams order book updates. Each message is a full snapshot of the top-of-book — replace your local copy on every event.

Subject (all markets)v1.f.public.futures.depth-update.>
Subject (one market)v1.f.public.futures.depth-update.BTC/USDT
AuthPublic — no signature.

Subscribe

import asyncio
import nats

async def main():
nc = await nats.connect("wss://pc-nats-prod.coinswitch.co")
sub = await nc.subscribe("v1.f.public.futures.depth-update.BTC/USDT")
async for msg in sub.messages:
print(msg.data.decode())

asyncio.run(main())

Update payload — single market

{
"t": 1756475722086,
"m": "SUPER/USDT",
"b": [
["0.5777", "9"],
["0.5776", "1946"]
],
"a": [
["0.5781", "775"],
["0.5782", "3613"]
],
"e": "COINSWITCHX",
"E": 1756475722084
}

Update payload — wildcard

When you subscribe with the wildcard (...depth-update.>), each message is an array of one or more depth updates batched together. Process each entry independently against your local books.

Fields

FieldTypeDescription
tintegerSystem timestamp (Unix ms).
EintegerExchange-side timestamp (Unix ms).
mstringMarket — BASE/QUOTE.
barrayBids. Each entry [price, quantity], both strings. Sorted descending.
aarrayAsks. Each entry [price, quantity]. Sorted ascending.
estringExchange identifier.