Overview
Depth stream provides order book snapshots and deltas for efficient reconstruction of the full book.
Property | Value |
---|
Channel Name | depth |
Authentication | Required |
Update Frequency | Real-time |
Data Type | Snapshot and delta |
Subscribe
{
"op": "subscribe",
"args": [
{ "channel": "depth", "symbol": "US500-BTC" },
{ "channel": "depth", "symbol": "OIL-BTC" }
]
}
Snapshot Example
{
"topic": "depth.OIL-BTC",
"type": "snapshot",
"createdTime": 1640995200000000000,
"data": {
"symbol": "OIL-BTC",
"bid": [["0.00089410", "89.25"], ["0.00089400", "50.00"]],
"ask": [["0.00089430", "156.75"], ["0.00089440", "203.00"]],
"timestamp": 1640995200000000000
}
}
Delta Example
{
"topic": "depth.OIL-BTC",
"type": "delta",
"createdTime": 1640995200000000000,
"data": {
"symbol": "OIL-BTC",
"bid": [["0.00089415", "10.00"]],
"ask": [["0.00089435", "-5.00"]],
"timestamp": 1640995200000000000
}
}
Apply deltas in order to the last known snapshot. Quantities of 0 or negative indicate removals depending on your reconstruction strategy.
The service will send an initial snapshot on subscribe when available.