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 VWAP stream delivers real-time updates to volume-weighted average prices for ERC-20 token pairs. Messages reflect the moving average price weighted by executed volume as new trades are finalized.

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.

Message Fields

vwap
string
Volume-weighted average price for the current window.
trade_count
number
Number of trades contributing to the VWAP.
volume_base
string
Aggregate executed volume in base units.
start_timestamp
string
Inclusive start of the window.
_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": "0405", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}}'

Response Example

{
  "chain_id": 1,
  "dataset_id": "0405",
  "is_reorg": false,
  "data": {
    "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "vwap": "3024.112233445566778899",
    "trade_count": 142,
    "volume_base": "580.000000000000000000",
    "start_timestamp": "2025-11-11T18:00:00Z",
    "end_timestamp": "2025-11-11T19:00:00Z",
    "_tracing_id": "0405000000000000000000000000000000000000",
    "_created_at": "2025-11-11T19:00:05.000Z"
  }
}