๐Ÿ”Œ API & Developers

Hyperliquid WebSocket BBO: Tuple Order and Null Side Semantics (Unconfirmed)

โš ๏ธ Disclosure: Some links on this page are affiliate links. If you sign up through them, I may earn a commission โ€” at no extra cost to you.
For the Hyperliquid bbo WebSocket subscription, the documented data type is WsBbo. The record contains a coin, a timestamp, and a two-position array of nullable WsLevel values. The cited subscriptions documentation does not label which tuple position is bid or ask, and it does not define what a null position means.

As of 2026-12-04, the side mapping and null semantics should be treated as unconfirmed unless you have a first-party source that states them explicitly.

Documented subscription and record shape

The bbo subscription message is:

{
  "method": "subscribe",
  "subscription": {
    "type": "bbo",
    "coin": "BTC"
  }
}

The documented WsBbo type is:

interface WsBbo {
  coin: string;
  time: number;
  bbo: [WsLevel | null, WsLevel | null];
}

interface WsLevel {
  px: string; // price
  sz: string; // size
  n: number; // number of orders
}

The docs also state that WsBbo updates are sent only if the BBO changes on a block.

An illustrative message shape using placeholder values only โ€” not a captured live response and not a description of any real quote โ€” would look like:

{
  "channel": "bbo",
  "data": {
    "coin": "BTC",
    "time": 1762200000000,
    "bbo": [
      {
        "px": "118000.5",
        "sz": "0.25",
        "n": 3
      },
      null
    ]
  }
}

What the cited documentation does and does not specify

๐Ÿ’ก Hyperliquid

Like what you're reading? Try it yourself โ€” this link supports ChartedTrader at no cost to you.

Create a Hyperliquid account โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime

ItemDocumented?Notes
coin fieldYesCoin symbol for the BBO update.
time fieldYesTimestamp in the WsBbo record.
bbo is a two-position nullable tupleYesEach position is WsLevel or null.
WsLevel.pxYesPrice.
WsLevel.szYesSize.
WsLevel.nYesNumber of orders.
Which tuple position is bidNoThe cited documentation does not label the positions.
Which tuple position is askNoThe cited documentation does not label the positions.
Meaning of nullNoThe cited documentation does not define whether null means no resting level, unavailable data, unknown data, or another state.
The cited Hyperliquid WebSocket subscriptions documentation provides the type definition but does not add side labels or null semantics for WsBbo.bbo.

Treating the mapping as unresolved

Because the cited documentation does not state which slot is the bid or the ask, and does not define null, do not hard-code an interpretation into production logic on the basis of this page alone. If you need a confirmed mapping, raise it through Hyperliquid's official support channels and record the answer with a date, since documentation and behaviour can change.

Practical handling for API consumers

Avoid hard-coding assumptions such as:

// Do not assume this mapping is correct.
const bid = bbo[0];
const ask = bbo[1];

A safer reference approach is to treat the two positions as unlabeled nullable levels until the mapping is confirmed:

type WsLevel = {
  px: string;
  sz: string;
  n: number;
};

type WsBbo = {
  coin: string;
  time: number;
  bbo: [WsLevel | null, WsLevel | null];
};

function describeBbo(record: WsBbo) {
  const [left, right] = record.bbo;

  return {
    coin: record.coin,
    time: record.time,
    left: left ? { px: left.px, sz: left.sz, n: left.n } : null,
    right: right ? { px: right.px, sz: right.sz, n: right.n } : null,
    sideMappingConfirmed: false
  };
}

This keeps the parser compatible with the documented WsBbo shape without asserting an unsupported bid/ask interpretation.

Sources

Related supa.is references:

If you are building against Hyperliquid, you can create a Hyperliquid account through our referral link. This is a commercial link: if you sign up, we may receive a commission. For current fee and discount terms, see the official Hyperliquid fees documentation.

Continue with Hyperliquid

Browse the Hyperliquid guide hub for the complete user journey.

๐Ÿงฎ Free Hyperliquid calculators

Fee Calculator โ†’
Hyperliquid vs centralized exchange fee comparison
PnL & Liquidation โ†’
Perp PnL + liquidation price
Position Size โ†’
Risk-aware position sizing for HL perps
Hyperliquid

Ready to get started? Use the link below โ€” it helps support ChartedTrader at no cost to you.

Create a Hyperliquid account โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime
๐Ÿ“ˆ

About the author

I'm a systematic trader running live strategies on IB (USDJPY momentum) and Hyperliquid (crypto perps). Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ”ง
Troubleshooting & Fixes

Hyperliquid Python SDK: Suspected Silent WebSocket Server Error Messages and Debug Checks

A public SDK issue reports suspected silent WebSocket server-error messages. This reference explains how to treat it as unconfirmed and add defensive logging and reconnect checks.

November 28, 2026 โฑ 2 min read
๐Ÿ”Œ
API & Developers

Hyperliquid WebSocket Trades and Candles: Snapshot, Dedupe Key, and Finality

Use the official WsTrade recommendation (block_time, coin, tid) for global uniqueness, and treat candle pushes as mutable interval state.

November 15, 2026 โฑ 4 min read
๐Ÿ”Œ
API & Developers

Hyperliquid WebSocket Subscriptions: Message Formats, Types, and Examples

How to subscribe to Hyperliquid WebSocket feeds, with subscription message formats, supported types, snapshots, unsubscribe messages, and user-address pitfalls.

November 9, 2026 โฑ 5 min read