Messages
{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>",
"params": {
"base_token_address": "<string>",
"quote_currency_code": "<string>"
}
}{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>"
}No examples foundNo examples found{
"chain_id": 123,
"dataset_id": "<string>",
"is_reorg": true,
"data": {
"first_block_number": 123,
"first_block_time": "<string>",
"first_tx_index": 123,
"first_log_index": 123,
"last_block_number": 123,
"last_block_time": "<string>",
"last_tx_index": 123,
"last_log_index": 123,
"bucket_start": "<string>",
"bucket_seconds": 123,
"token_address": "<string>",
"price_usd": "<string>",
"total_notional_usd": "<string>",
"hops": 123,
"sources_count": 123,
"_tracing_id": "<string>",
"_created_at": "<string>",
"_updated_at": "<string>"
}
}Pricing Suite - Fiat
Spot VWAP (Fiat)
Subscribe to real-time fiat-denominated volume-weighted average price (VWAP) updates.
WSS
/
Overview
- Dataset ID:
0605 - Token-to-Fiat VWAP (USD) - Description: Token-to-USD VWAP (1m..1d) per token, derived from token-to-token VWAP via stablecoin anchoring.
- Sample: Hugging Face Sample
Subscription Parameters
ERC-20 contract address for the base asset (hex string, 20 bytes, no
0x prefix).ISO-4217 fiat currency code (e.g.,
USD, EUR).Message Fields (data)
Top-level fields: chain_id, dataset_id, is_reorg, data (object). The data object mirrors b0605_token_to_fiat_vwap:
BIGINTTIMESTAMPTZINTEGERINTEGERBIGINTTIMESTAMPTZINTEGERINTEGERTIMESTAMPTZINTEGERBYTEANUMERIC(78,18)NUMERIC(78,18)INTEGERINTEGERBYTEABYTEA[] (nullable by default; can be large)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": "0605", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_currency_code": "USD"}}'
#include <libwebsockets.h>
#include <string.h>
#include <stdio.h>
static int callback_blockdb(struct lws *wsi, enum lws_callback_reasons reason,
void *user, void *in, size_t len) {
switch (reason) {
case LWS_CALLBACK_CLIENT_ESTABLISHED:
lws_callback_on_writable(wsi);
break;
case LWS_CALLBACK_CLIENT_RECEIVE:
printf("Received: %s\n", (char *)in);
break;
case LWS_CALLBACK_CLIENT_WRITEABLE: {
unsigned char buf[LWS_PRE + 1024];
unsigned char *p = &buf[LWS_PRE];
size_t n = sprintf((char *)p, "{\"action\": \"subscribe\", \"dataset_id\": \"0605\", \"chain_id\": 1, \"params\": {\"base_token_address\": \"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\", \"quote_currency_code\": \"USD\"}}");
lws_write(wsi, p, n, LWS_WRITE_TEXT);
break;
}
}
return 0;
}
using System;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
class Program {
static async Task Main() {
using var ws = new ClientWebSocket();
ws.Options.SetRequestHeader("Authorization", $"Bearer {Environment.GetEnvironmentVariable("BLOCKDB_API_KEY")}");
await ws.ConnectAsync(new Uri("wss://api.blockdb.io/v1/evm/"), CancellationToken.None);
var subMsg = "{\"action\": \"subscribe\", \"dataset_id\": \"0605\", \"chain_id\": 1, \"params\": {\"base_token_address\": \"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\", \"quote_currency_code\": \"USD\"}}";
await ws.SendAsync(new ArraySegment<byte>(Encoding.UTF8.GetBytes(subMsg)), WebSocketMessageType.Text, true, CancellationToken.None);
var buffer = new byte[1024 * 4];
while (ws.State == WebSocketState.Open) {
var result = await ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);
Console.WriteLine(Encoding.UTF8.GetString(buffer, 0, result.Count));
}
}
}
import websocket
import json
import os
def on_message(ws, message):
print(f"Received: {message}")
def on_open(ws):
msg = {
"action": "subscribe",
"dataset_id": "0605",
"chain_id": 1,
"params": {
"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"quote_currency_code": "USD"
}
}
ws.send(json.dumps(msg))
ws = websocket.WebSocketApp(
"wss://api.blockdb.io/v1/evm/",
header={"Authorization": f"Bearer {os.getenv('BLOCKDB_API_KEY')}"},
on_message=on_message,
on_open=on_open
)
ws.run_forever()
const WebSocket = require('ws');
const ws = new WebSocket('wss://api.blockdb.io/v1/evm/', {
headers: { 'Authorization': `Bearer ${process.env.BLOCKDB_API_KEY}` }
});
ws.on('open', () => {
ws.send(JSON.stringify({
action: 'subscribe',
dataset_id: '0605',
chain_id: 1,
params: {
base_token_address: "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
quote_currency_code: "USD"
}
}));
});
ws.on('message', (data) => {
console.log('Received:', JSON.parse(data));
});
package main
import (
"fmt"
"log"
"net/http"
"os"
"github.com/gorilla/websocket"
)
func main() {
header := http.Header{"Authorization": []string{"Bearer " + os.Getenv("BLOCKDB_API_KEY")}}
c, _, err := websocket.DefaultDialer.Dial("wss://api.blockdb.io/v1/evm/", header)
if err != nil {
log.Fatal("dial:", err)
}
defer c.Close()
sub := `{"action": "subscribe", "dataset_id": "0605", "chain_id": 1, "params": {"base_token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "quote_currency_code": "USD"}}`
err = c.WriteMessage(websocket.TextMessage, []byte(sub))
if err != nil {
log.Fatal("write:", err)
}
for {
_, message, err := c.ReadMessage()
if err != nil {
log.Fatal("read:", err)
}
fmt.Printf("Received: %s\n", message)
}
}
Response Example
{
"chain_id": 1,
"dataset_id": "0605",
"is_reorg": false,
"data": {
"first_block_number": 18930000,
"first_block_time": "2025-11-11T18:00:11.000Z",
"first_tx_index": 12,
"first_log_index": 5,
"last_block_number": 18939999,
"last_block_time": "2025-11-11T18:59:48.000Z",
"last_tx_index": 44,
"last_log_index": 2,
"bucket_start": "2025-11-11T18:00:00.000Z",
"bucket_seconds": 3600,
"token_address": "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"price_usd": "3024.112233445566778899",
"total_notional_usd": "1750000.000000000000000000",
"hops": 2,
"sources_count": 4,
"_tracing_id": "0605000000000000000000000000000000000001",
"_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_currency_code": "<string>"
}
}{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>"
}No examples foundNo examples found{
"chain_id": 123,
"dataset_id": "<string>",
"is_reorg": true,
"data": {
"first_block_number": 123,
"first_block_time": "<string>",
"first_tx_index": 123,
"first_log_index": 123,
"last_block_number": 123,
"last_block_time": "<string>",
"last_tx_index": 123,
"last_log_index": 123,
"bucket_start": "<string>",
"bucket_seconds": 123,
"token_address": "<string>",
"price_usd": "<string>",
"total_notional_usd": "<string>",
"hops": 123,
"sources_count": 123,
"_tracing_id": "<string>",
"_created_at": "<string>",
"_updated_at": "<string>"
}
}subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object
Last modified on April 6, 2026
Was this page helpful?
⌘I