Skip to content
TradePerpetuals9 pages
What a perpetual future isFoundationA perpetual future is a contract on an asset's price that never expires, kept close to that price by an hourly payment between longs and shorts.Contract specificationsPractitionerEvery Hyperliquid perp is a linear contract on 1 unit of its asset, defined by size decimals, maximum leverage, a margin table and a margin mode.FundingPractitionerFunding is an hourly payment between longs and shorts, set by how far the perp trades from the oracle price, that ties a contract with no expiry to its index.Margin: cross, isolated and margin tiersPractitionerMargin is the collateral behind a perp: initial margin to open, maintenance margin to stay open, shared in cross mode or ring-fenced in isolated mode.Leverage and liquidationPractitionerBelow maintenance margin, positions go to the order book as market orders; below two thirds of it, the liquidator vault takes them over.Auto-deleveragingExpertWhen an account goes below zero, auto-deleveraging closes the most profitable, most leveraged opposing positions at the previous mark price, leaving no bad debt.Hyperps and index perpetualsPractitionerHyperps fund against a moving average of their own mark price until spot trading exists; index perps track a formula the validators publish.AMM-priced perpetualsExpertSome perps price off a Uniswap V2 or V3 pool instead of exchange spot prices, and are isolated only, with margin locked in until the position closes.DelistingPractitionerWhen validators vote to delist a perp, positions settle at the 1-hour time-weighted oracle price before the vote and no new orders are accepted.

Order types and time in force

Foundation

Every order on HyperCore is a limit order with one of three time-in-force rules, Gtc, Ioc or Alo; a market order is a limit order with a worst acceptable price.

Every order answers two questions: the worst price you accept, and what happens to the part that can’t fill at once. The second sets your fee: taking resting liquidity pays the taker rate; resting and filling later pays the lower maker rate or earns a rebate (fees).

Time in force decides what happens on arrival

Section titled “Time in force decides what happens on arrival”

Every order is a price, a size, a side and a time in force (TIF):

Order TIF on the wire On arrival Unfilled part Fee
Limit, good til cancelled Gtc Fills against anything at its price or better Rests until filled or cancelled Taker on what fills at once, maker on the rest
Immediate or cancel Ioc Same Cancelled; fills already made stay Taker
Post only (add liquidity only) Alo Cancelled if it would match anything Rests; can only fill as a maker Maker
Market FrontendMarket Fills against the book up to a worst price Does not rest Taker

Say the best ask is 100 with 5 on offer, and you buy 8 at 100. A Gtc fills 5 as taker and rests 3 as maker; an Ioc fills 5 and cancels 3; an Alo is cancelled outright.

  • Market orders are not native: each is a limit order with TIF FrontendMarket and a worst price from the app’s slippage setting (one production app uses 3 per cent from the mark price).
  • Reduce-only is a flag, not a TIF. It is rejected if it would increase the position, and cancelled if it rests and stops reducing.
  • No fill-or-kill or good-til-date. Ioc keeps partial fills. expiresAfter only stops a delayed action landing late; the dead man’s switch cancels all open orders at a set time (orders).
  • Block ordering: actions sending no Gtc or Ioc order (post-only among them), then cancels, then Gtc and Ioc. A post-only or cancel beats a taker in the same block (the order book).

Stops, take profits, trailing stops, TWAP, scale and chase orders all end as one of these (TP/SL, TWAP and scale).

Parameter Value
TIF values in the order action Gtc, Ioc, Alo, FrontendMarket
TIF codes from a HyperEVM contract (CoreWriter action 1) 1 Alo, 2 Gtc, 3 Ioc; no FrontendMarket
Minimum order value $10 on perps; 10 units of the quote token on spot
Price at most 5 significant figures and at most 6 - szDecimals decimals (perps) or 8 - szDecimals (spot); integer prices always allowed
Size rounded to the asset’s szDecimals
Maximum market order value, perps $30,000,000 at max leverage 25 or more; $5,000,000 at 20 to 24; $2,000,000 at 10 to 19; $500,000 below 10
Maximum limit order value, perps 10 x the maximum market order value
  • Gtc limit: you have a price and can wait.
  • Post only: maker rate or rebate, never taker. If the market moved through your price, it’s cancelled.
  • Market: the fill matters more than the price. In a thin book, prefer an Ioc at your own worst price.
  • Reduce-only on every exit: a repeated or delayed close cannot flip you.
{
"type": "order",
"orders": [{
"a": 0,
"b": true,
"p": "95000",
"s": "0.001",
"r": false,
"t": { "limit": { "tif": "Alo" } }
}],
"grouping": "na"
}

a is the asset id, b buy, p and s decimal strings, r reduce-only. A market order sets "tif": "FrontendMarket" and p to the worst price. Each order gets its own statuses entry:

Error string Cause
“Post only order would have immediately matched, bbo was …” Alo would have crossed
“Order could not immediately match against any resting orders.” Ioc found nothing
“Reduce only order would increase position.” r: true on an order that adds to the position
“Order must have minimum value of $10.” below the minimum notional
“No liquidity available for market order.” market order into an empty side
“Price must be divisible by tick size.” price precision
  • Payload errors (empty batch, TP/SL not reduce-only, price too far from the reference price) come back once per batch.
  • From a HyperEVM contract (CoreWriter action 1), a market order is an Ioc with a worst price; limitPx and sz are 1e8 x the human value (CoreWriter).

FrontendMarket, upgrades and empty Ioc fills

Section titled “FrontendMarket, upgrades and empty Ioc fills”
  • Market orders do not fill during a network upgrade’s post-only period.
  • An Ioc that matches nothing returns an error status, not an empty fill.

For every order field and response, see Orders. For what happens when your order meets your own, see Self-trade prevention.