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.

One chain, two execution environments

Foundation

HyperCore holds the markets as native state and the HyperEVM runs contracts; one HyperBFT consensus orders both, joined by precompiles and CoreWriter.

Hyperliquid runs two execution environments on one chain.

  • HyperCore is the engine: order books, margin, matching and balances, written into the protocol.
  • The HyperEVM is a general-purpose Ethereum-style contract platform on the Cancun rules without blobs, with HYPE as gas.

One HyperBFT consensus orders both into what the docs call one state: no second ledger, so no bridging risk.

Say your contract reads a perp position through a precompile, then places an order through CoreWriter. The read returns inside the transaction. The order executes 0.35 to 0.51 s after the HyperEVM block (measured on mainnet, n=52).

HyperCore order books, margin balances, positions NATIVE STATE HyperEVM contracts, HYPE gas 1 s and 60 s blocks GENERAL PURPOSE read precompiles, 0x800 onward state as of HyperEVM block build CoreWriter, 0x3333...3333 runs after the HyperEVM block a refusal never reverts the sender HyperBFT one consensus, one ordering, one state
Reads return inside the transaction but reflect the moment the HyperEVM block was built. Writes land later and report nothing back.
Crossing Mechanism Carries
Read, HyperCore to contract precompiles: addresses that behave like contracts, from 0x0000000000000000000000000000000000000800 perp positions, spot balances, vault equity, staking delegations, oracle, mark and spot prices, the L1 block number, lending state, outcome status, as of the latest HyperCore state when the HyperEVM block is built
Write, contract to HyperCore CoreWriter: sendRawAction(bytes) on 0x3333333333333333333333333333333333333333, emitting a log orders, cancels, transfers, vault deposits, staking, lending, account mode changes, outcome operations, executed after the HyperEVM block as the contract’s own HyperCore account
Move, either way transfers, separate from both bridges: send a linked token to its system address, 0x20 then the big-endian token index (HYPE: 0x2222222222222222222222222222222222222222) the token, credited on the other side

A refusal is silent: the transaction succeeds, the log is emitted, gas is spent and the money stays put. Within a block: L1 block built, HyperEVM block built, HyperEVM to HyperCore transfers, then CoreWriter actions (execution order).

Measured values are from mainnet unless stated.

Crossing Direction When it lands Cost
Precompile read HyperCore to contract state as of HyperEVM block construction 2000 + 65 * (input_len + output_len) gas
CoreWriter order (action 1) contract to HyperCore 0.35 to 0.51 s after the HyperEVM block, measured, n=52 about 25,000 gas burned; about 47,000 for a basic call
CoreWriter spot send, USD class transfer, send asset (6, 7, 13) contract to HyperCore 0.006 to 0.46 s, measured, n=6 each as above
CoreWriter outcome split and merge (17) contract to HyperCore same block, 0.01 to 0.68 s, measured on testnet, n=6 as above
CoreWriter vault transfer (2) contract to HyperCore 4.05 to 4.10 s, measured, n=6 as above
Asset transfer HyperEVM to HyperCore same L1 block, right after the HyperEVM block similar to an ordinary token transfer
Asset transfer HyperCore to HyperEVM queued to the next HyperEVM block 200,000 gas at that block’s base fee, charged on HyperCore
Small HyperEVM block not applicable every 1 s 3M gas limit
Big HyperEVM block not applicable every 60 s 30M gas limit
  • A token sits in a HyperCore spot balance (trades on the books) or a HyperEVM balance (used by contracts). Moving it is a transfer, not a trade.
  • Anything on the HyperEVM, including moving back, needs HYPE there for gas. The HyperCore to HyperEVM leg is charged on HyperCore: in HYPE per the FAQ, or in the token sent when HYPE runs short (measured on testnet).
  • No history. Precompiles answer only at the latest block. Any explicit block number fails, including the current head.
  • You can never move 100 per cent to the HyperEVM. The 200,000 gas comes out of the HyperCore balance. On testnet, 99 of 100 USDC cost 0.000588 USDC; all 100 was rejected with “Insufficient USDC or HYPE balance for token transfer gas”.
  • Rounding is rejected, not burned. Where the HyperEVM has fewer decimals, as for USDC (8 on HyperCore, 6 on the HyperEVM), a HyperCore to HyperEVM amount not a multiple of 10^|evmExtraWeiDecimals| wei is rejected (5 of 5 cases), silently if sent from a contract. Floor first.
  • Read with a precompile, act through CoreWriter, verify with a precompile in a later block. Nothing is atomic across the two: see patterns and what one HyperEVM transaction can and cannot do.
  • The contract must be an activated HyperCore account before the HyperEVM block is built. Funding it by transfer in the same block still gets the action rejected.

The CoreWriter payload is a four-byte header plus the ABI-encoded fields:

byte 0 encoding version, 0x01
bytes 1-3 action id, big-endian (7 = USD class transfer)
bytes 4.. abi.encode(fields), no function selector

For each side in depth, see the HyperEVM and HyperCore; for silent failures at the boundary, see Footguns, measured.