HyperNode

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:

KindNameRest of the frameMeaning
0keepalivenothingThe connection is alive (every 5 s when nothing else is sent)
1bundlesee belowOne bundle, reduced to its orders, cancels and modifies
2flowingnothingBundles are arriving (again)
3idlenothingNo bundle for 2 s: the node receives no mempool now
4laggedu32 skippedThis 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 lagged frame.

GET /v1/mempool/status

FieldTypeMeaning
flowingboolA bundle arrived within the last 2 s. Also false when nobody follows the feed
readingboolThe service is following the node's mempool
clientsintegerClients on GET /v1/mempool
bundlesintegerBundles read since the instance started
instructionsintegerOrders, cancels and modifies sent on
instructions_left_outintegerInstructions not sent on
unparsed_linesintegerNode records this version could not read
node_bytesintegerBytes of the node's lines read
feed_bytesintegerBytes 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}
FieldTypeMeaning
roundintegerConsensus round of the proposed block. Not the block height
proposerstringValidator proposing it
timeintegerThe proposed block's time, Unix nanoseconds
hashesarray of stringBundles of the proposed block, in execution order
committedobjectThe block committed just before it, same four fields
receivedintegerWhen the service read the line from the node, Unix nanoseconds

State lines, sent first and whenever the state changes:

LineMeaning
{"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

FieldTypeMeaning
enabledboolThe instance offers the proposal feed
flowingboolA block arrived within the last 3 s
clientsintegerClients on GET /v1/proposals
blocksintegerBlocks read since the instance started
undecoded_framesintegerBlocks not laid out as this version knows them (a node format change)
connectsintegerConnections the service made to the node
refusalsintegerConnections the node refused
last_errorstringWhy the stream last ended, if it did