Skip to content
LearnHyperCore8 pages
HyperCore overviewFoundationHyperCore is where Hyperliquid's order books, margin, clearing and settlement run as native protocol state, applied by every validator in one order.The clearinghouse: one margin enginePractitionerHyperCore's clearinghouse holds balances and positions and checks margin on every trade; in standard mode each perp dex has its own balance and cross margin.The order book and matchingPractitionerEach HyperCore asset has one on-chain book matched in price-time priority, with cancels and post-only orders sequenced ahead of orders that take liquidity.Oracles, mark prices and robust price indicesPractitionerValidators publish perp oracle prices every 3 seconds; the mark price used for margin and liquidation is a median that no single book or venue can move.Quote assets: USDC, USDH, aligned and permissionlessPractitionerAny token can become a HyperCore quote asset if its issuer stakes 200k HYPE against a peg and liquidity standard; aligned issuers also share reserve yield.Vaults: HLP, protocol vaults, user vaultsFoundationA vault pools depositors' USDC into one HyperCore account run by one strategy; HLP is the protocol vault that makes markets and performs liquidations.Multi-sig accountsPractitionerHyperCore can make any account a native k-of-n multi-sig with no smart contract, but CoreWriter stops working for it and its HyperEVM side keeps the old key.API servers and how state reaches youPractitionerAPI servers follow a node, keep a local copy of HyperCore state, answer reads from it, and reply to a transaction only once it executes in a committed block.

The order book and matching

Practitioner

Each HyperCore asset has one on-chain book matched in price-time priority, with cancels and post-only orders sequenced ahead of orders that take liquidity.

On HyperCore the order book is protocol state. Every validator applies the same matching rule to the same order sequence, so all reach the same fills (why that matters).

Every perp, spot pair and outcome side has its own book, matched in price-time priority: best price, then earliest arrival. Prices are whole multiples of the tick size, sizes of the lot size (precision).

Perp books hold no margin; the clearinghouse checks it at placement and again for the resting side at match.

Say you rest a sell at 3,001 and the price jumps. You cancel; in the same batch, a taker sends an IOC buy at 3,001. Your cancel runs first; the taker finds nothing.

Consensus knows which transactions touch a book and runs each batch in three groups:

ONE CONSENSUS BATCH, IN EXECUTION ORDER 1. No GTC or IOC order post-only (ALO) orders, transfers, other actions 2. Cancels remove resting orders before anyone can hit them 3. At least one GTC or IOC orders that can take liquidity from the book Within each group: the order the block proposer put them in. A modify is grouped by the order it places.
Makers get to reprice or withdraw before takers arrive in the same batch.

Per the docs, cancels and post-only orders sent at time t almost always execute before GTC and IOC orders sent at t, across several blocks. Makers escape stale-quote pick-offs, so they can quote tight in volatility.

What this means for you. Post-only (ALO) is the only guaranteed way to be the maker. As a taker, expect quotes to vanish in fast markets.

  1. Placement. Via an API server, sequenced, then checked for tick, lot, minimum value and margin. Failure is a rejection; the book is untouched.
  2. Matching. Takes crossed liquidity, best price first, and settles each match at once: both accounts update, fees are charged, the maker’s rebate is paid to its wallet.
  3. Remainder. GTC rests, IOC cancels the rest, ALO (post-only) is rejected if it would match; triggers (take profit, stop loss) wait for their price, then act as market or limit (order types).
  4. End. Filled, or cancelled by the owner or by the protocol with a stated reason.

A HIP-4 outcome’s Yes and No books are one book: buying Yes at 0.62 is selling No at 0.38 (1 minus p). At the same merged price level, resting sells sort before resting buys on the other token (price-side-time priority). Measured on mainnet, an outcome’s two l2Book responses were exact 1 minus p mirrors (market shapes).

Parameter Value
Priority price, then time (price, side, time on outcome books)
Consensus batches per block usually 1 to 2
Minimum order value $10, per the docs’ own error example “Order must have minimum value of $10.”
Open order limit per user 1000, plus 1 per 5M USDC of volume, up to 5000
Outcome price grid 0.00001 to 0.99999 in 0.00001 steps; size in whole contracts
historicalOrders and userFills at most 2000 most recent entries

The main orderStatus values; the docs list 29, the rest covering open interest caps, liquidation, delisting, vault withdrawals, TP/SL siblings and narrower rejections:

Status Meaning
open resting on the book
filled fully filled
canceled cancelled by the user
triggered trigger order fired
rejected rejected at placement
marginCanceled cancelled at match time for insufficient margin
selfTradeCanceled cancelled by self-trade prevention
reduceOnlyCanceled reduce-only order that would no longer reduce
scheduledCancel cancelled by the dead man’s switch
badAloPxRejected post-only order that would have matched
iocCancelRejected IOC order that could not match
oracleRejected price too far from the oracle

Each order in a response is {"resting": {"oid": ...}}, {"filled": {"totalSz", "avgPx", "oid"}} or {"error": "..."}. An error inside "status": "ok" is still a failed order.

{ "type": "orderStatus", "user": "0x...", "oid": 77738308 }

oid may be a 16-byte hex client order id (orders). Each match yields two fill rows (taker, maker) with the same notional and tid. Deduplicate on tid, since hash is shared across one order’s partial fills.

  • modify works only on resting limit orders and returns a new oid: reconcile a timed-out modify by client order id. One that would cross returns the plain string “Price would cross book”.
  • No fill-or-kill, no good-till-date; IOC keeps partial fills.
  • With 1000 or more orders open, a new reduce-only or trigger order is rejected.
  • The fast-cancel flag cannot cancel trigger orders; a batch containing one is rejected.
  • An outcome order that both matches and rests can show in historical order queries as separate primary and dual orders.
  • An unquoted outcome book reports a mid of 0.5.

For each order type, see Order types; for quoting against this sequencing, Market making.