Ir al contenido principal

BBO Book Dataset

Actualizado el
10 de junio de 2026

Resumen

El StreamBboBook stream delivers the best bid and best ask (top of book) for one or more coins. An update is emitted only when the best bid or ask changes for a coin, making it the lightweight feed for clients that just need live prices and spread without order book depth.

gRPC : OrderBookStreaming
gRPC : StreamBboBook
Modelo de actualización: Emit-on-change: one message per coin whose best bid or ask changed

Cómo funciona

StreamBboBook watches the top of the book for every subscribed coin and emits a message whenever the best bid or best ask changes, including size changes at the same best price. Compared to consuming full StreamL2Book snapshots:

  • Each message carries only the best bid and best ask, not full depth
  • Messages are emitted only on change, not every block
  • A single stream can cover multiple coins (or all coins with an empty coins list)
  • No client-side state management is required, since each message is the current top of book

Each message covers exactly one coin. If a side of the book is empty, the corresponding bid o ask field is absent.

Estructura de datos

Each BboBookUpdate message contains the current best bid and ask for a single coin:

{
"coin": "BTC",
"time": 1781109022243,
"block_number": 586404610,
"bid": { "px": "62990", "sz": "0.001", "n": 1 },
"ask": { "px": "63054", "sz": "0.00008", "n": 1 }
}

Parámetros de la solicitud

CampoTipoObligatorioDescripción
coinsrepeated stringNoList of symbols to subscribe to (e.g., "BTC", "ETH"). Empty means all coins

Denominación de las monedas

El coins El parámetro sigue la convención de nomenclatura Hyperliquid, que distingue sin ambigüedades entre los contratos perpetuos y los al contado:

  • Perpetuos: Human-readable names, such as «BTC», «ETH», «HYPE», «SOL»
  • Fichas al contado: @{índice} format, such as "@1", «@107», «@142», «@166»
  • Mercados de resultados (HIP-4): #N formato. Cada resultado tiene dos #N coins, one per side (Yes and No). Multi-price question markets consist of multiple grouped outcomes (price buckets plus a fallback), each with its own Yes/No coin pair. Use the outcomeMeta endpoint asignar los índices de las monedas a los nombres y lados del mercado.
  • Excepción: «PURR/USDC» es la única moneda de la serie «Spot» cuyo nombre se puede leer

No hay solapamiento entre los formatos. «BTC» siempre se refiere al contrato perpetuo de BTC; el BTC al contado es «@142». Para descubrir @índice asignaciones para tokens puntuales, consultar el meta o spotMeta puntos de información.

Campos de respuesta

BboBookUpdate

CampoTipoDescripción
monedacadenaSímbolo (p. ej., «BTC», «ETH»)
tiempouint64Marca de tiempo del bloque en milisegundos
número_de_bloqueuint64Block number
bidL2LevelBest bid level. Absent if there is no resting bid
askL2LevelBest ask level. Absent if there is no resting ask

L2Level

CampoTipoDescripción
pxcadenaPrice as a decimal string
szcadenaTotal size across all orders at this price level, as a decimal string
nuint32Number of individual orders at this price level

Definición de «Proto»

StreamBboBook se define en orderbook.proto:

service OrderBookStreaming {
rpc StreamBboBook (BboBookRequest) returns (stream BboBookUpdate);
}

message BboBookRequest {
repeated string coins = 1;
}

message BboBookUpdate {
string coin = 1;
uint64 time = 2;
uint64 block_number = 3;
L2Level bid = 4;
L2Level ask = 5;
}

message L2Level {
string px = 1;
string sz = 2;
uint32 n = 3;
}

Ejemplos de actualizaciones

BBO Update (single coin)
{
"coin": "BTC",
"time": 1781109022243,
"block_number": 586404610,
"bid": { "px": "62990", "sz": "0.001", "n": 1 },
"ask": { "px": "63054", "sz": "0.00008", "n": 1 }
}
Consecutive Updates (emit-on-change)

Consecutive ETH updates demonstrating the emit-on-change model. A size change at the same best price triggers an update:

{ "coin": "ETH", "time": 1781109213042, "block_number": 586405802,
"bid": { "px": "1701.1", "sz": "0.015", "n": 1 },
"ask": { "px": "1701.2", "sz": "0.0176", "n": 2 } }
{ "coin": "ETH", "time": 1781109220213, "block_number": 586405844,
"bid": { "px": "1701.1", "sz": "0.015", "n": 1 },
"ask": { "px": "1701.2", "sz": "0.0105", "n": 1 } }
{ "coin": "ETH", "time": 1781109221825, "block_number": 586405854,
"bid": { "px": "1701.1", "sz": "0.0079", "n": 1 },
"ask": { "px": "1701.2", "sz": "0.0105", "n": 1 } }

Uso de la API

gRPC
// Single coin
const request = {
coins: ['BTC']
};

// Multiple coins in one stream
const multiRequest = {
coins: ['BTC', 'ETH', 'HYPE']
};

// All coins
const allCoinsRequest = {
coins: []
};

gRPC

StreamBboBook solo está disponible a través de la API gRPC (OrderBookStreaming servicio). No está disponible a través de JSON-RPC ni de WebSocket.

Comparison with StreamL2Book

CaracterísticaStreamBboBookStreamL2Book
Data per messageBest bid and best ask onlyFull depth snapshot (up to n_levels per side)
Message cadenceOnly when the BBO changesEvery block
Coins per streamMultiple (or all coins)One coin per stream
Client-side state managementNingunoNinguno
Ancho de bandaLowest (top-of-book only)Medio (limitado por n_levels)
Ideal paraLive prices, spread monitoring, tickersMarket depth, analytics dashboards

Notas importantes


  • Emit-on-change: Updates are sent only when the best bid or ask changes for a coin, including size changes at the same best price
  • One coin per message: Each BboBookUpdate covers a single coin; subscribe to multiple coins (or all coins) on one stream and demultiplex by the moneda field
  • Absent sides: If a side of the book is empty, the bid o ask field is absent. Check for presence before reading it
  • zstd compression recommended: Enable zstd compression on your gRPC channel to reduce bandwidth, especially when streaming all coins

  • StreamL2Book - Aggregated price-level depth, full snapshot every block
  • StreamL2BookDiff - Incremental L2 price-level changes with sequence numbers
  • Operaciones - Datos de operaciones ejecutadas con información sobre «maker» y «taker»