Subscribe and unsubscribe to data channels dynamically over a single WebSocket connection.
Top of book with minimal latency. Only sends when bid/ask changes.
Subscribe
{"method": "subscribe", "subscription": {"type": "bbo", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "bbo", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "bbo", "coin": "BTC"}}Response
{
"channel": "bbo",
"data": {
"coin": "BTC",
"time": 1702530000000,
"bid": {"px": "100000.0", "sz": "0.5", "n": 1},
"ask": {"px": "100001.0", "sz": "0.3", "n": 1}
}
}{
"channel": "bbo",
"data": {
"coin": "BTC",
"time": 1702530000000,
"bid": {"px": "100000.0", "sz": "0.5", "n": 1},
"ask": {"px": "100001.0", "sz": "0.3", "n": 1}
}
}{
"channel": "bbo",
"data": {
"coin": "BTC",
"time": 1702530000000,
"bid": {"px": "100000.0", "sz": "0.5", "n": 1},
"ask": {"px": "100001.0", "sz": "0.3", "n": 1}
}
}Aggregated price levels. Optional parameters: nSigFigs (2-5), nLevels (max 100, default 20), mantissa (2 or 5).
Subscribe
{"method": "subscribe", "subscription": {"type": "l2Book", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "l2Book", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "l2Book", "coin": "BTC"}}Full orderbook with every individual order visible (user addresses, order IDs, triggers).
Subscribe
{"method": "subscribe", "subscription": {"type": "l4Book", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "l4Book", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "l4Book", "coin": "BTC"}}Real-time trade/fill stream with execution details.
Subscribe
{"method": "subscribe", "subscription": {"type": "trades", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "trades", "coin": "BTC"}}{"method": "subscribe", "subscription": {"type": "trades", "coin": "BTC"}}Stream raw order status data for a specific user address in real-time.
Subscribe
{"method": "subscribe", "subscription": {"type": "orderUpdates", "user": "0x1234...5678"}}{"method": "subscribe", "subscription": {"type": "orderUpdates", "user": "0x1234...5678"}}{"method": "subscribe", "subscription": {"type": "orderUpdates", "user": "0x1234...5678"}}Response
{
"channel": "orderUpdates",
"data": [{
"user": "0x...",
"time": 1702530000000,
"height": 12345,
"orderStatus": {
"status": "open",
"order": {"coin": "BTC", "side": "B", "limitPx": "100000.0", "sz": "0.5"}
}
}]
}{
"channel": "orderUpdates",
"data": [{
"user": "0x...",
"time": 1702530000000,
"height": 12345,
"orderStatus": {
"status": "open",
"order": {"coin": "BTC", "side": "B", "limitPx": "100000.0", "sz": "0.5"}
}
}]
}{
"channel": "orderUpdates",
"data": [{
"user": "0x...",
"time": 1702530000000,
"height": 12345,
"orderStatus": {
"status": "open",
"order": {"coin": "BTC", "side": "B", "limitPx": "100000.0", "sz": "0.5"}
}
}]
}Unsubscribe
{"method": "unsubscribe", "subscription": {"type": "l2Book", "coin": "BTC"}}{"method": "unsubscribe", "subscription": {"type": "l2Book", "coin": "BTC"}}{"method": "unsubscribe", "subscription": {"type": "l2Book", "coin": "BTC"}}