Messages
No examples found{
"action": "<string>",
"chain_id": 123,
"dataset_id": "<string>"
}No examples foundNo examples foundNo examples foundReserves
Reserves
Subscribe to real-time normalized pool reserve snapshots.
WSS
/
Overview
- Dataset ID:
0301 - Liquidity Pool Reserves - Description: Pool reserve snapshots (
b0301_liquidity_pools_reserves_v1); tick/bin detail rows inb0301_liquidity_pools_reserves_details_v1.pool_uid→blockdb_evm.b0211_liquidity_pools_v1. - Sample: Hugging Face Sample
Subscription Parameters
Filter updates to specific BlockDB pool identifiers.
Include tick-range or bin-level liquidity breakdowns for concentrated liquidity pools.
Tick range coverage: When
include_details is enabled, detail rows cover a ±1% range around the current price tick by default. If you need a wider tick range or full tick coverage, contact us.Message Fields
BlockDB pool identifier.
Exchange/DEX identifier.
Pool type identifier.
Block height where the reserve change occurred.
Block time (ISO-8601).
Transaction index.
Log index.
Raw token reserves for even-liquidity pools (one entry per token).
Current tick for concentrated-liquidity pools.
Q64.96 sqrt price integer string.
Current bin id for bin-style AMMs.
Optional tick/bin/range detail rows (enabled by subscription params).
Single-tick locator (v3-style).
Range lower bound.
Range upper bound.
Single-bin locator.
Engine-native liquidity (integer string).
Token0 raw amount at locator (integer string).
Token1 raw amount at locator (integer string).
Row-level lineage hash for correlation.
Parent lineage ids (hex).
Record creation time (ISO-8601).
Record last update time (ISO-8601).
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": "0301", "chain_id": 1, "params": {"include_details": true}}'
#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 + 512];
unsigned char *p = &buf[LWS_PRE];
size_t n = sprintf((char *)p, "{\"action\": \"subscribe\", \"dataset_id\": \"0301\", \"chain_id\": 1, \"params\": {\"include_details\": true}}");
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\": \"0301\", \"chain_id\": 1, \"params\": {\"include_details\": true}}";
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": "0301",
"chain_id": 1,
"params": {
"include_details": True
}
}
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: '0301',
chain_id: 1,
params: {
include_details: true
}
}));
});
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": "0301", "chain_id": 1, "params": {"include_details": true}}`
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": "0301",
"is_reorg": false,
"data": {
"pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
"exchange_id": 1,
"type_id": 201,
"block_number": 18934567,
"block_time": "2025-11-11T18:42:15.123Z",
"tx_index": 4,
"log_index": 2,
"reserves": [
"169649594140000000000000",
"60446403492000000000"
],
"current_tick": 210130,
"current_sqrt_price": "14614467034852101032872730522039888223787",
"current_bin": null,
"details": [
{
"tick": 210130,
"lower_tick": 210120,
"upper_tick": 210140,
"bin_id": null,
"liquidity": "123456789000000000000000000000000",
"amount0": "1000000000000000000",
"amount1": "2500000000"
}
],
"_tracing_id": "0301000000000000000000000000000000000000",
"_parent_tracing_ids": [
"0203000000000000000000000000000000000000"
],
"_created_at": "2025-11-11T18:42:15.123Z",
"_updated_at": "2025-11-11T18:42:15.123Z"
}
}
Messages
No examples found{
"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 April 6, 2026
Was this page helpful?
⌘I