Hyperliquid L4, Live

Every order, take profit, stop loss and liquidation price, straight from our own Hyperliquid node, and how late each update reaches you.

Every resting order in the book, at its price: bids below the mid, asks above. Each update is one block's changes, and its latency runs from the block's time on Hyperliquid's chain.

Connecting…

Latency each second's median: when an update reached you, less its time on Hyperliquid's chain
0 ms500 ms1000 ms30 s ago25 s ago20 s ago15 s ago10 s ago5 s agonow

Your clock checking… · latency by your clock ⓘ

Use it yourself

The same stream this page draws, over a WebSocket. HYPE and BTC are free, with no key. For other coins, ask us for a key at @marketlens_app on X or on Discord, and send it as Authorization: Bearer <key>, or as ?key= from a browser.

wss://api.marketlens.app/data/hyperliquid/l4/order_book/<coin>
The order book: every resting order.
wss://api.marketlens.app/data/hyperliquid/l4/tpsl/<coin>
Take profits and stop losses waiting to trigger, each at its trigger price.
wss://api.marketlens.app/data/hyperliquid/l4/liquidations/<coin>
Open positions, each at its liquidation price, updated within about a second of a trade and refreshed every 15 s.

Each binary message is one Parquet file, a snapshot or a delta of one channel. On connecting you get a snapshot of each channel, then its deltas, each a block's changes. Its key-value metadata is its head:

snapshot
true: the whole channel; false: a delta.
channel
order_book, take_profits, stop_losses or liquidations.
coin
Hyperliquid's name for it, such as HYPE.
epoch, seq
A snapshot starts an epoch; seq counts its deltas, per channel. A gap means a delta was missed: connect again.
ts
The block's time on Hyperliquid's chain, ms since 1970; for liquidations, when its prices were taken.

Its rows are orders: id, ts (when it was placed), price, size (negative for an ask), user (the address, 20 bytes) and position_size. An order is known by its id; on liquidations, which have none, a position by its user. In a delta, a row with only its key removes what it's the key of, and those come first; the others add one, or replace what had its key. A take profit or stop loss of size 0 is a position's: it closes the whole position, and its position_size is that position's size as of the block, signed like size (0 if there's none it would close). It's empty on every other order. A liquidations row is a position: price its liquidation price, size the position (negative for a short), ts when it last changed. Pings come as text, {"ping":…}: answer each with {"pong":…} and the same number, or the connection is closed.

All of it as a reference: the API spec (AsyncAPI).

// npm install hyparquet
import { parquetMetadata, parquetReadObjects } from "hyparquet";

const ws = new WebSocket("wss://api.marketlens.app/data/hyperliquid/l4/order_book/HYPE");
ws.binaryType = "arraybuffer";

/** Each channel's orders by key, and its last seq. */
const books = new Map();
const seqs = new Map();

async function read(file) {
    const head = Object.fromEntries(
        parquetMetadata(file).key_value_metadata.map(({ key, value }) => [key, value]),
    );
    const snapshot = head.snapshot === "true";
    const seq = Number(head.seq);
    if (snapshot) books.set(head.channel, new Map());
    // A delta missed: connect again, for a snapshot.
    else if (seq !== seqs.get(head.channel) + 1) return ws.close();
    seqs.set(head.channel, seq);
    const book = books.get(head.channel);
    // Removals first: a row with only its key removes what it's the key of.
    for (const row of await parquetReadObjects({ file })) {
        // An order's id; a position's (liquidations: no id) user.
        const key = row.id ?? String(row.user);
        if (row.price == null) book.delete(key);
        // id a BigInt or null, ts a Date, price and size numbers (size negative: an ask or
        // a short), user 20 bytes, a Uint8Array; position_size a number on a take profit
        // or stop loss that closes a whole position (its size is 0), else null
        else book.set(key, row);
    }
}

// One file at a time, in order.
let reading = Promise.resolve();
ws.onmessage = ({ data }) => {
    // Pings come as text: answer each, or the connection is closed.
    if (typeof data === "string") return ws.send(data.replace("ping", "pong"));
    reading = reading.then(() => read(data));
};

FAQ

Which coins can I get, and what does it cost?

HYPE and BTC are free, with no key. Other coins are on request: ask us at @marketlens_app on X or on our Discord.

How fast is it?

A block usually reaches our node about 0.2 s after Hyperliquid stamps it, and its changes leave our node a few milliseconds after the node applies it. Our CDN adds a few milliseconds more near Tokyo; past that, it's your own network's trip. The Latency panel above shows what you get.

Where does it come from?

Our own Hyperliquid node in Tokyo. We rebuild every coin's book from what the node writes for each block, and check our books against the node's own state every 10,000 blocks.

How does our node get its blocks?

Our Hyperliquid node is patched to pick its own peers: it keeps probing Hyperliquid's public peers and streams blocks from whichever is quickest at the moment. Its limits: it isn't a validator and has no direct link to the Hyperliquid Foundation's nodes, so a block reaches it a little after validators have it, usually about 0.2 s after Hyperliquid stamps it, and more while the public peers are slow. It's one node: if it falters, the stream waits for it.

How does the data reach me?

Through a global CDN: you connect to its edge nearest you, and the data crosses the CDN's own network between our node and that edge, not the public internet. Every viewer of a coin gets the same files, sent once from our node.

What if my connection drops or I miss an update?

Each channel numbers its deltas (seq). If one is missing, connect again: you start with a fresh snapshot of each channel. Answer every ping, or the connection is closed.

Is there history?

No: the stream is live. It starts from a snapshot of each channel when you connect.

Reference

What is L4 data?

Every individual order rather than the sizes summed at each price (L2): its id, price, size, the address that placed it and when. You see who is behind a level, and each order as it's added, changed or removed.

What are take profits and stop losses here?

Orders waiting to trigger, at their trigger price. They aren't in the order book until they trigger. One of size 0 belongs to a position: it closes the whole position, whatever its size then. Its position_size is that position's size as of the latest block, which we follow from every fill.

What are liquidations here?

Every open position that has a liquidation price, at that price: a long's on the bid side, a short's on the ask side, sized by the position. A position opened, changed or closed shows within about a second of its trade, and every position is refreshed each 15 seconds. A delta's ts is when its liquidation prices were taken.

Why Parquet?

Each message is a small, compressed file with typed columns and exact decimal prices and sizes, which every language reads with a standard library: no format of our own to parse.

Is this Hyperliquid's own feed?

No. It's ours, from our own node, independent of Hyperliquid.