Description
The Spot Depth stream delivers real-time executable depth snapshots for ERC-20 token pairs. Depth captures Level 1 liquidity at specific basis-point offsets from the mid price as liquidity changes on-chain.
Subscription Parameters
ERC-20 contract address for the base asset.
ERC-20 contract address for the quote asset.
Basis-point offset from mid price for depth calculation.
Message Fields
Mid price in quote units per base unit.
Executable size of the base asset to reach the offset.
Executable size of the quote asset to reach the offset.
Block height of the snapshot.
Row-level lineage hash for correlation.
Subscription Example
# Use wscat to connect and subscribe
wscat -c wss://stream.blockdb.io/v1/evm/ \
-H "Authorization: Bearer $BLOCKDB_API_KEY" \
-x '{"action": "subscribe", "dataset_id": "0401", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "depth_offset_bps": 100}}'
Response Example
{
"chain_id": 1,
"dataset_id": "0401",
"is_reorg": false,
"data": {
"metric": "depth",
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"depth_offset_bps": 100,
"current_price": "3025.219821481234567890",
"size_in": "150.000000000000000000",
"size_out": "454000.000000000000000000",
"target_price": "3055.472019762345678901",
"block_number": 18935678,
"block_time": "2025-11-11T18:42:15.123Z",
"_tracing_id": "0401000000000000000000000000000000000000",
"_created_at": "2025-11-11T18:42:15.123Z"
}
}