Skip to main content
WSS
wss://stream.blockdb.io/v1/evm/
Messages
subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object

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

chain_id
number
required
Target EVM network.
base_token_address
string
required
ERC-20 contract address for the base asset.
quote_token_address
string
required
ERC-20 contract address for the quote asset.
depth_offset_bps
number
default:"100"
Basis-point offset from mid price for depth calculation.

Message Fields

current_price
string
Mid price in quote units per base unit.
size_in
string
Executable size of the base asset to reach the offset.
size_out
string
Executable size of the quote asset to reach the offset.
block_number
number
Block height of the snapshot.
_tracing_id
string
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"
  }
}