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 OHLC (Fiat) stream delivers real-time open-high-low-close (OHLC) candles for ERC-20 tokens quoted in fiat currencies. BlockDB normalizes prices into the requested fiat (e.g., USD, EUR) using its consolidated on-chain trade data.

Subscription Parameters

chain_id
number
required
Target EVM network.
base_token_address
string
required
ERC-20 contract address for the base asset.
quote_currency_code
string
required
ISO-4217 fiat currency code (e.g., USD, EUR).
aggregation_interval
string
default:"1m"
Candle width (e.g., 1m, 5m, 1h).

Message Fields

open
string
Opening price for the current bucket (fiat per base).
high
string
Highest price within the bucket so far.
low
string
Lowest price within the bucket so far.
close
string
Current closing (latest) price for the bucket.
volume_quote
string
Aggregated executed volume in fiat units.
bucket
string
Bucket anchor timestamp.
_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": "0601", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_currency_code": "USD", "aggregation_interval": "1m"}}'

Response Example

{
  "chain_id": 1,
  "dataset_id": "0601",
  "is_reorg": false,
  "data": {
    "base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "quote_currency_code": "USD",
    "open": "3010.112233445566778899",
    "high": "3033.998877665544332211",
    "low": "3008.001122334455667788",
    "close": "3025.219821481234567890",
    "volume_base": "420.000000000000000000",
    "volume_quote": "1269000.000000000000000000",
    "bucket": "2025-11-11T00:00:00Z",
    "_tracing_id": "0601000000000000000000000000000000000000",
    "_created_at": "2025-11-11T01:00:05.000Z"
  }
}