Mempool and Proposals
Coming soon - Hyperliquid pending orders, cancels and modifies before they are in a block, and the next block as proposed.
Mempool and Proposals
Coming soon. These endpoints are not available yet, and the format below may change before launch.
What participants sent to the exchange before it is in a block, and the next block as proposed. The same data, decoded per symbol and combined with a live L4 order book, is delivered by HyperStream.
Concepts
- Bundle. Participants' signed actions reach validators in bundles. A bundle has a hash and holds from one to a few thousand actions (median about 220). About 25 bundles arrive per second.
- Mempool. Bundles a node has received that are not in a block yet. Our node receives them through the peer it follows, a median 221 ms before the block that contains them is applied.
- Instruction. One order, cancel or modify taken from a bundle. Other action types are left out.
- Block proposal. The header of the next block: who proposes it, its time and the hashes of the bundles it will hold, in execution order. Known a median 66–68 ms before that block arrives.
What the data is not
- Nothing in the mempool has happened. An instruction may be rejected, reordered or never included. The streams remain the record of what did happen.
- The source can stop. A non-validating node receives the mempool only while its upstream peer forwards it. Then nothing arrives. That state is reported; it is not an error.
- No history, no replay, no sequence numbers. A message that was not delivered is gone. A slow client skips to the newest data.
- About one bundle in five holds no order, cancel or modify. Such a bundle produces no mempool message, yet its hash appears in a proposal.
GET /v1/mempool
Live binary feed; the response never ends by itself. Content-Type: application/octet-stream, response header X-Mempool-Wire-Version: 1. Metered at one unit per bundle delivered.
On the wire every frame is preceded by its length: u32, little endian. A frame starts with one byte, its kind:
| Kind | Name | Rest of the frame | Meaning |
|---|---|---|---|
| 0 | keepalive | nothing | The connection is alive (every 5 s when nothing else is sent) |
| 1 | bundle | see below | One bundle, reduced to its orders, cancels and modifies |
| 2 | flowing | nothing | Bundles are arriving (again) |
| 3 | idle | nothing | No bundle for 2 s: the node receives no mempool now |
| 4 | lagged | u32 skipped | This client read too slowly; that many bundles were not sent to it |
The first frame is always a state (flowing or idle).
Bundle frame, all integers little endian:
u8 1 kind
u8 version 1
i64 time the node's clock when it received the bundle, .NET ticks, UTC
u8 hash length, then that many bytes: the bundle's hash
u16 signed actions in the bundle
u16 instructions left out
u16 groups, then each group = the instructions of one signed action:
i64 nonce the sender's clock, Unix ms
8 B signature key first 8 bytes of the signature's r
u8 flags bit 0: a vault / sub-account address follows (20 B)
u8 instructions, then each:
u8 kind and flags bits 0-2 kind: 0 order, 1 cancel by order id, 2 cancel by client order id, 3 modify
bit 3 buy, bit 4 reduce-only, bit 5 client order id present,
bit 6 trigger order, bit 7 exchange order id present
u8 more flags bits 0-2 time in force: 0 none, 1 Alo, 2 Ioc, 3 Gtc, 4 FrontendMarket, 5 LiquidationMarket
bits 3-4 trigger kind: 0 none, 1 tp, 2 sl
bit 5 market once triggered
bit 6 the client order id of the order a modify replaces is present
i32 asset Hyperliquid asset id
order, modify: price, size, and for a trigger order the trigger price,
each as u8 scale + i64 unscaled value (value / 10^scale)
u64 order id when its bit is set
16 B client order id when its bit is set
16 B replaced client order id when its bit is set- .NET ticks are 100 ns units since 0001-01-01 UTC. Unix nanoseconds = (ticks − 621355968000000000) × 100.
- Left out and counted in "instructions left out": actions that are not an order, a cancel or a modify, and an instruction whose fields do not fit the encoding.
- Size: about 45 bytes per instruction, 17 % of the node's own JSON; about 1.3 MB/s per client.
- A client more than 256 bundles (about 10 s) behind skips to the newest and gets a
laggedframe.
GET /v1/mempool/status
| Field | Type | Meaning |
|---|---|---|
flowing | bool | A bundle arrived within the last 2 s. Also false when nobody follows the feed |
reading | bool | The service is following the node's mempool |
clients | integer | Clients on GET /v1/mempool |
bundles | integer | Bundles read since the instance started |
instructions | integer | Orders, cancels and modifies sent on |
instructions_left_out | integer | Instructions not sent on |
unparsed_lines | integer | Node records this version could not read |
node_bytes | integer | Bytes of the node's lines read |
feed_bytes | integer | Bytes of the frames made from them |
The counters move only while a client follows the feed.
GET /v1/proposals
Live NDJSON; the response never ends by itself. Content-Type: application/x-ndjson. One line per block, metered at one unit per line:
{"round":1540302396,"proposer":"0x80f0...","time":1795596675561607200,"hashes":["0x891e...","0xc048..."],"committed":{"round":1540302395,"proposer":"0x9dd8...","time":1795596675486285000,"hashes":["0x7cbe..."]},"received":1795596675620000000}| Field | Type | Meaning |
|---|---|---|
round | integer | Consensus round of the proposed block. Not the block height |
proposer | string | Validator proposing it |
time | integer | The proposed block's time, Unix nanoseconds |
hashes | array of string | Bundles of the proposed block, in execution order |
committed | object | The block committed just before it, same four fields |
received | integer | When the service read the line from the node, Unix nanoseconds |
State lines, sent first and whenever the state changes:
| Line | Meaning |
|---|---|
{"state":"flowing"} | Blocks are arriving |
{"state":"idle"} | None arrive |
{"state":"lagged","skipped":N} | This client read too slowly; N blocks were left out |
503 when the instance does not offer the proposal feed: do not retry.
GET /v1/proposals/status
| Field | Type | Meaning |
|---|---|---|
enabled | bool | The instance offers the proposal feed |
flowing | bool | A block arrived within the last 3 s |
clients | integer | Clients on GET /v1/proposals |
blocks | integer | Blocks read since the instance started |
undecoded_frames | integer | Blocks not laid out as this version knows them (a node format change) |
connects | integer | Connections the service made to the node |
refusals | integer | Connections the node refused |
last_error | string | Why the stream last ended, if it did |