Skip to main content
WSS

Documentation Index

Fetch the complete documentation index at: https://docs.blockdb.io/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Subscription Parameters

chain_id
number
required
Target EVM chain. See the Chain enumeration for supported values.
base_token_address
string
required
ERC-20 contract address for the base asset (hex string, 20 bytes, no 0x prefix).
quote_token_address
string
required
ERC-20 contract address for the quote asset (hex string, 20 bytes, no 0x prefix).
aggregation_interval
string
default:"1m"
Candle width, expressed as an ISO-8601 duration shorthand (1m, 5m, 1h, 1d). Default is 1m.

Message Fields (data)

Top-level fields: chain_id, dataset_id, is_reorg, data (object). The data object mirrors b0404_token_to_token_prices_ohlc_v1:
data.pool_uid
string
BYTEA — Pool id (hex).
data.exchange_id
number
INTEGER
data.type_id
number
INTEGER
data.bucket_start
string
TIMESTAMPTZ — Inclusive UTC bucket start.
data.bucket_end
string
TIMESTAMPTZ — Exclusive UTC bucket end (bucket_start + bucket_seconds).
data.bucket_seconds
number
INTEGER
data.token_in
string
BYTEA
data.token_out
string
BYTEA
data.open
string
NUMERIC(78,18)
data.high
string
NUMERIC(78,18)
data.low
string
NUMERIC(78,18)
data.close
string
NUMERIC(78,18)
data.volume_in_raw
string
NUMERIC(78,0) — Sum of raw UInt256 amountIn values.
data.volume_in
string | null
NUMERIC(78,18) — Decimal-adjusted token_in volume; null if decimals unknown.
data.volume_out_raw
string
NUMERIC(78,0) — Sum of raw UInt256 amountOut values.
data.volume_out
string | null
NUMERIC(78,18) — Decimal-adjusted token_out volume; null if decimals unknown.
data.trades_count
number
BIGINT
data._tracing_id
string
BYTEA
data._parent_tracing_ids
string[] | null
BYTEA[] — Optional parent lineage references.
data._created_at
string
TIMESTAMPTZ
data._updated_at
string
TIMESTAMPTZ

Subscription 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": "0404", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_token_address": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "aggregation_interval": "1m"}}'

Response Example

{
  "chain_id": 1,
  "dataset_id": "0404",
  "is_reorg": false,
  "data": {
    "pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
    "exchange_id": 1,
    "type_id": 201,
    "bucket_start": "2025-11-11T00:00:00.000Z",
    "bucket_end": "2025-11-11T00:01:00.000Z",
    "bucket_seconds": 60,
    "token_in": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "token_out": "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "open": "3010.112233445566778899",
    "high": "3033.998877665544332211",
    "low": "3008.001122334455667788",
    "close": "3025.219821481234567890",
    "volume_in_raw": "420000000000000000000",
    "volume_in": "420.000000000000000000",
    "volume_out_raw": "1269000000000",
    "volume_out": "1269000.000000000000000000",
    "trades_count": 128,
    "_tracing_id": "0404000000000000000000000000000000000001",
    "_parent_tracing_ids": null,
    "_created_at": "2025-11-11T00:01:05.000Z",
    "_updated_at": "2025-11-11T00:01:05.000Z"
  }
}
Messages
subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object
Last modified on May 27, 2026