Messages
{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>",
"params": {
"base_token_address": "<string>",
"quote_token_address": "<string>"
}
}{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>"
}No examples foundNo examples foundNo examples foundPricing Suite - Crypto
Spot VWAP
Subscribe to real-time volume-weighted average price (VWAP) updates.
WSS
Overview
- Dataset ID:
0405 - Token-to-Token VWAP - Description: Volume-weighted average price (1m..1d) per pool and token pair direction.
- Sample: Hugging Face Sample
Subscription Parameters
ERC-20 contract address for the base asset (hex string, 20 bytes, no
0x prefix).ERC-20 contract address for the quote asset (hex string, 20 bytes, no
0x prefix).Message Fields (data)
Top-level fields: chain_id, dataset_id, is_reorg, data (object). The data object mirrors b0405_token_to_token_vwap_v1:
BYTEAINTEGERINTEGERTIMESTAMPTZ — Inclusive UTC bucket start.TIMESTAMPTZ — Exclusive UTC bucket end (bucket_start + bucket_seconds).INTEGERBYTEABYTEANUMERIC(78,18) — VWAP (token_out per 1 token_in); null if undefined.NUMERIC(78,0) — Sum of raw UInt256 amountIn values.NUMERIC(78,18) — Decimal-adjusted token_in volume; null if decimals unknown.NUMERIC(78,0) — Sum of raw UInt256 amountOut values.NUMERIC(78,18) — Decimal-adjusted token_out volume; null if decimals unknown.BIGINTBYTEABYTEA[] — Optional parent lineage references.TIMESTAMPTZTIMESTAMPTZSubscription Example
# Use wscat to connect and subscribe
wscat -c wss://api.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": {
"pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
"exchange_id": 1,
"type_id": 201,
"bucket_start": "2025-11-11T18:00:00.000Z",
"bucket_end": "2025-11-11T19:00:00.000Z",
"bucket_seconds": 3600,
"token_in": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_out": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"price_vwap": "3024.112233445566778899",
"total_volume_in_raw": "580000000000000000000",
"total_volume_in": "580.000000000000000000",
"total_volume_out_raw": "1750000000000",
"total_volume_out": "1750000.000000000000000000",
"trade_count": 142,
"_tracing_id": "0405000000000000000000000000000000000001",
"_parent_tracing_ids": null,
"_created_at": "2025-11-11T19:00:05.000Z",
"_updated_at": "2025-11-11T19:00:05.000Z"
}
}
Messages
{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>",
"params": {
"base_token_address": "<string>",
"quote_token_address": "<string>"
}
}{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>"
}No examples foundNo examples foundNo examples foundsubscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object
Last modified on May 27, 2026
Was this page helpful?
⌘I