# Hyperliquid Orderbook streaming

Live market data for your backend.

[\[ REQUEST A TRIAL \]](https://telegram.me/supanode_tgs)[Explore the feed](https://supanode.xyz/services/hyperliquid/websocket#fit)

**BTC orderbook**Sample data

Price / USDSize / BTCOrders

75,904.001.120008

75,903.002.8700019

75,902.000.950006

75,901.005.1000035

Spread 1.00 USD BTC / USD

75,900.002.100008

75,899.003.4500019

75,898.001.820006

75,897.004.7800035

Sample data: a shortened view of aggregated price levels.

## A deeper view of the market.

Stream price levels, trades and order events directly from Supanode’s Hyperliquid node over WebSocket. Use full snapshots or incremental book changes in your backend.

## A local book you can  
keep in sync.

Use l2Diff to maintain a deep local book from a snapshot and incremental updates. Your backend applies each change to its stored state.

**Hyperliquid node**Supanode · Tokyo

**Your backend**WSS + x-token

**Your application**Local orderbook

1

### Start with Snapshot

Subscribe to l2Diff. Replace all local state with the received Snapshot. levels\[0\] contains bids; levels\[1\] contains asks.

2

### Apply matching Updates

Check prevHeight equals the last height you applied. Insert or overwrite each upd \[px, sz, n\] triple and remove each price in del. Store the new height.

3

### Reset after a gap

A prevHeight mismatch means stale state. Unsubscribe and subscribe again for a fresh Snapshot. After disconnecting, discard your book, reconnect with authentication and resend subscriptions.

**l2Diff continuity.**  
A market may not change on every block. Check prevHeight, not height - 1 or time. Any new Snapshot replaces the entire book for that subscription.

A del price can have moved beyond your chosen depth. It does not necessarily mean the order was cancelled or filled. On a quiet market, no book frames can be normal; use ping/pong to check connection liveness.

[Read the l2Diff continuity rules](https://supanode.xyz/docs/hyperliquid/websocket/l2diff)

## Streams and product limits.

**1,000** levels / side**WSS** transport**Tokyo** node**x-token** authentication

## Choose the view  
your application needs.

One authenticated connection can carry several subscriptions. Select a market and the information your backend needs to maintain.

| Stream | What you receive | Use it for |
| --- | --- | --- |
| l2Book | The full aggregated book in each frame. Up to 1,000 levels per side. | Replacing a local price-level book |
| l2Diff | A full Snapshot, then Updates containing changed and removed levels. | Maintaining deep books with less repeated data |
| bbo | Best bid and best offer. Separate bid and ask fields. | Top-of-book pricing |
| trades | Executed trades with price, size and trade ID. | Trade tapes and market activity |
| l4Book | Individual resting orders with owner addresses. | Order-level analysis |
| bookDiffs | Raw book changes from the node. | Custom book processing |
| orderUpdates | Order status changes for a subscribed address. | Following an address |
| allMids | Mid prices across markets, without a coin parameter. | A broad market view |

Perpetuals use symbols such as BTC. Spot pairs use @<index> from spotMeta. l4Book is order-level data; the L2 depth parameter does not apply.

[Inspect every stream and frame format](https://supanode.xyz/docs/hyperliquid/websocket/whats-available)

Current service policy sets no caps on connections, subscriptions, markets or message rate. Test capacity and update delivery with your own workload.

[Read current limits](https://supanode.xyz/docs/hyperliquid/websocket/limits) · [Billing details](https://supanode.xyz/docs/hyperliquid/pricing)

## Price & access.

Hyperliquid

### Orderbook streaming

Separate subscription

Native WebSocket feed for price levels, trades and order events.

-   Up to 1,000 L2 levels per side
-   No per-message fee; product limits apply
-   Monthly, prepaid · USDC / SOL / ETH / USDT
-   Direct Telegram support

$289

/ month

Free trial up to 24h on request, no card; our team confirms availability, endpoint and key setup.

[\[ REQUEST A TRIAL \]](https://telegram.me/supanode_tgs)[Documentation](https://supanode.xyz/docs/hyperliquid/websocket/overview)

## Connect from your backend.

Use a WebSocket client that can send HTTP headers. Add x-token to the handshake, then send a subscription message after connecting.

1.  Start in the portalRequest Orderbook streaming or a trial.
2.  Get your connection detailsThe team sets up your endpoint and key.
3.  Connect and test your workloadAuthenticate from your backend and subscribe.

Connection settings

```
Endpoint: wss://toy.hl.supanode.xyz:48080/ws
Header:   x-token: YOUR_KEY
```

Illustrative subscription · BTC / l2DiffCopy JSON

```
{
  "method": "subscribe",
  "subscription": {
    "type": "l2Diff",
    "coin": "BTC",
    "nLevels": 1000
  }
}
```

### Depth is explicit

Omit nLevels for the default 20. Do not pass nLevels: 20 explicitly; the current validator rejects it. Values above 1,000 return no data.

### Unsubscribe precisely

Repeat the entire subscription object, including nLevels, with method: unsubscribe. Check acknowledgements on coin and type.

**Browser integration needs a backend.**  
The browser WebSocket API cannot set x-token. Query-string keys and Authorization: Bearer are not accepted. Keep your key on the server and forward the data your UI needs.

### How does this differ from the public API?

| Item | Value |
| --- | --- |
| L2 depth | The public Hyperliquid API exposes up to 20 L2 levels. Supanode extends nLevels to 1,000. |
| Book updates | Supanode adds l2Diff. |
| Auth header | Supanode requires an x-token header. |
| Message shape | bbo uses separate bid and ask fields; l2Book includes nLevels. |

[Protocol differences in Docs](https://supanode.xyz/docs/hyperliquid/websocket/overview#where-this-differs-from-the-public-api)

[Open working backend examples](https://supanode.xyz/docs/hyperliquid/websocket/examples)

## Before you subscribe.

### Does this include historical market data?

The WebSocket feed delivers current events from subscription time. For historical fills and SQL analysis, use the separate [Hyperliquid Historical Indexer](https://supanode.xyz/services/hyperliquid/indexer).

### Is this an exchange or trading API?

Use this product for market and order data. Your application handles order submission and strategy execution.

### How do I restore the book after a disconnect?

After a disconnect, authenticate again and resend subscriptions. Replace your l2Diff state with the new Snapshot before applying Updates.

### Is this a fixed latency service?

Update delivery depends on book changes, your connection and client processing. Test your own market, region and workload during the trial.

### How do I keep the connection alive?

Send standard WebSocket ping frames, or the application message {"method":"ping"}; the server returns {"channel":"pong"}. The server does not initiate pings. Quiet book streams can be normal.

---
Source: https://supanode.xyz/services/hyperliquid/websocket
