Market
Market orders execute immediately as a single IOC limit with a slippage cap. Full technical reference: wire format, slippage math, fees, edge cases.
A market order is the fastest possible execution path Borsa offers. It is not a true "market" type at the exchange level — Hyperliquid does not have one. Instead, Borsa sends a single IOC limit order priced at the current mid plus your slippage cap, in the direction that crosses the book.
Execution Model
When you press Buy or Sell in the MARKET tab, Borsa builds exactly one OrderRequest and posts it once. The order is sized to your full size input, given a price that crosses the book by up to slippage on the worst-case side, and tagged with tif: "Ioc" so any unfilled remainder cancels instead of resting.
Wire format
{
a: <asset_id>,
b: <true for buy, false for sell>,
p: <formatted limit price = mid × (1 ± slippage)>,
s: <formatted size>,
r: <reduceOnly>,
t: { limit: { tif: "Ioc" } }
}
For a buy: p = mid × (1 + slippage). The order will match every ask up to that price. For a sell: p = mid × (1 - slippage). The order will match every bid down to that price.
Why it isn't a "real" market order
Hyperliquid's matching engine takes only limit orders. To get market semantics from a limit, you set a price aggressive enough to cross the entire visible book inside your acceptable slippage and mark the order IOC so any unfilled tail goes away instead of resting at that uncompetitive price.
The result: you fill whatever's available up to your cap, no more, and never leave a stale order on the book.
Slippage cap
The slippage parameter (default 5%) is the maximum price deviation from current mid you're willing to accept. It is not an expected slippage — it's a worst-case bound. Actual fill is usually much tighter, since the order matches level by level starting from the inside.
In the Advanced section, Max Slippage overrides the default with 0.5%, 1%, 2% or 5%. Tighter values reduce worst-case loss but increase the chance of partial fills if the book is thin or moves while your order is in flight.
When to Use
- You need the position now and accept whatever the book offers within your cap.
- You're closing a position fast — a market sell on the exit side.
- Liquidity looks deep enough that 5% slippage is generous.
When Not to Use
- The book is thin and 5% slippage would let you sweep multiple levels of bad liquidity. Use a Burst order instead — same immediate-execution intent but with adaptive book sweeping and a tighter, enforced slippage cap.
- You care about a specific entry level. Use a Limit order.
- You want to spread the order over time. Use TWAP.
- You want size distributed across a range of prices. Use Scale.
Inputs
| Input | Required | Notes |
|---|---|---|
Side | Yes | Long/Short on perps, Buy/Sell on spot/outcomes. |
Size | Yes | Base-asset quantity. |
Leverage | Perp only | Applied to the position post-fill. |
Reduce Only | Optional | Rejects fills that would increase position absolute. |
Max Slippage | Optional (Advanced) | Default 5%. Max deviation from mid. |
Trigger | Optional (Advanced) | Turns the order into a stop or take-profit that fires at market when price reaches the trigger. Leave empty for a regular order. |
Priority fee | Optional (Advanced) | Hyperliquid priority fee in basis points (Off, 1, 2, 4, 8 or a custom value). See below. |
Set TP/SL | Optional (Advanced) | Adds reduce-only trigger orders in the same batch. |
TP / SL Attachment
When TP or SL prices are filled in, Borsa includes them in the same order action as additional triggered legs:
orders: [
{ ...main IOC market order... },
{ isBuy: !main, trigger: { isMarket: true, triggerPx: tp, tpsl: "tp" }, reduceOnly: true, ... },
{ isBuy: !main, trigger: { isMarket: true, triggerPx: sl, tpsl: "sl" }, reduceOnly: true, ... },
]
grouping: "normalTpsl"
The normalTpsl grouping tells Hyperliquid these legs are linked. If you cancel one trigger, only that one is removed — the parent fill is not affected.
Options under Set TP/SL:
- $ or %: enter TP and SL as prices or as a percent from entry.
- TP exit: Market (default) exits at market when the TP is hit, always fills and pays taker. Limit rests a maker limit at the TP price (
isMarket: false), earns the maker rate, but may not fill if price gaps through. Stops always exit at market. - Size: the TP/SL size as a percent of the entry size (100% = full). A partial size that would fall below the $10 minimum falls back to the full size.
The trigger price is evaluated against mark price, not last trade. See Trading Fundamentals for the difference.
Trigger (Stop / Take-Profit Entry)
When Trigger has a price, the market order becomes a trigger-market order: t: { trigger: { isMarket: true, triggerPx, tpsl } }. Hyperliquid fires it at market when the mark price reaches the trigger. Whether it is a stop or a take-profit follows which side of the current price the trigger sits on: a buy that fires when price rises is a stop, a buy that fires when price falls is a take-profit (and the reverse for sells). The hint under the field spells out what will happen, for example "Buy market fires when price rises to 2100 · stop."
Priority Fee
Priority fee buys a latency edge on Hyperliquid: roughly 45ms faster per basis point for a market order. It is sent as grouping: { p } and charged from your undelegated staking balance (not your trading balance) as a fraction of the filled notional. It is not available on reduce-only orders, trigger orders, outcomes, or with an attached TP/SL (both use the grouping field, and the TP/SL wins).
Fees
Market orders always pay the taker fee. With the default builder fee included, on perps that's typically 0.045% of notional per fill. On spot, taker fees are higher (typically 0.07%). Your tier may reduce these — see Fees and Referrals.
The order may fill across multiple levels; each match is a separate fill and is fee'd independently, but all settle in the single response from this one request.
Edge Cases & Failures
- Partial fill, no remainder. If the book had less than your size at the acceptable price range, you'll be filled for what was available and the rest cancels (IOC semantics). The toast reports the actual filled size.
- Total no-fill. If the inside of the book moved past your slippage cap between your read of mid and the order landing on the exchange, no level matches and the entire order cancels with no fill. Resubmit or switch to Burst.
- Stale mid.
midis the last value received by the WebSocket. If the WS lagged, your computed price may not actually cross. Borsa refreshes mid from the same store the rest of the trading view uses, so this is rare but possible. - Below minimum. Hyperliquid rejects orders worth less than $10. Borsa pre-validates and surfaces the error before sending.
Concrete Example
You set Buy, 0.5 ETH, slippage 5%, current mid 2,000.
OrderRequest {
a: 4, # ETH perp asset id
b: true, # buy
p: "2100", # 2000 × 1.05, formatted to tick
s: "0.5", # 0.5 ETH
r: false,
t: { limit: { tif: "Ioc" } }
}
Suppose the book inside 2100 contains: 0.3 @ 2001, 0.4 @ 2003, 0.2 @ 2008.
Result: fills 0.3 @ 2001 + 0.2 @ 2003 = full 0.5 ETH at average 2001.8.
The remaining 0.2 @ 2003 plus 0.2 @ 2008 stays in the book — your order is gone. Average fill 2001.8, slippage actual = 0.09%, slippage cap was 5%.
Related
- Burst — same immediate-fill intent, but with smart book sweeping and a tighter enforced cap.
- Limit — when price control matters more than speed.
- Trading Fundamentals — mark vs oracle vs last, funding, margin.