Description
The Spot OHLC stream delivers real-time open-high-low-close (OHLC) candle updates for ERC-20 token pairs. Candles are updated as new trades and quote changes occur on-chain.
Subscription Parameters
ERC-20 contract address for the base asset.
ERC-20 contract address for the quote asset.
Candle width (e.g., 1m, 5m, 1h).
Message Fields
Opening price for the current bucket.
Highest price within the bucket so far.
Lowest price within the bucket so far.
Current closing (latest) price for the bucket.
Aggregated executed volume in base units.
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": "0403", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "aggregation_interval": "1m"}}'
Response Example
{
"chain_id": 1,
"dataset_id": "0403",
"is_reorg": false,
"data": {
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"open": "3010.112233445566778899",
"high": "3033.998877665544332211",
"low": "3008.001122334455667788",
"close": "3025.219821481234567890",
"volume_base": "420.000000000000000000",
"bucket": "2025-11-11T00:00:00Z",
"_tracing_id": "0403000000000000000000000000000000000000",
"_created_at": "2025-11-11T01:00:05.000Z"
}
}