Order types and time in force
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
FrontendMarketand 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.
Iockeeps partial fills.expiresAfteronly 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
GtcorIocorder (post-only among them), then cancels, thenGtcandIoc. 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).
The numbers
Section titled “The numbers”| 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 |
Choosing the right order
Section titled “Choosing the right order”- 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
Iocat your own worst price. - Reduce-only on every exit: a repeated or delayed close cannot flip you.
Sending an order from code
Section titled “Sending an order from code”{ "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
Iocwith a worst price;limitPxandszare 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
Iocthat 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.