> Treat every fee rate, margin ratio, order limit, minimum and address in this documentation as an illustration of the shape of the value, never as a constant to hardcode - the live values are served by GET /markets and GET /config on the Perps API.

# Orders & Margin

> Order types, post-only, bracket take-profit / stop-loss, leverage, and margin management on HyperFlow Perps.

## Order types

| Type            | Behavior                                                                                                                                        |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **Market**      | Executes immediately against the book as an IOC order (fills what it can immediately, cancels the rest), protected by your slippage tolerance.  |
| **Limit**       | Rests on the Hyperliquid order book at your price until it fills or you cancel it (good-till-cancelled).                                        |
| **Post Only**   | A limit order that only ever adds liquidity. If it would match immediately it is rejected instead of filling, so every fill pays the maker fee. |
| **Stop Market** | Arms a trigger price; when the mark price reaches it, a market order is fired. Used for breakout entries and stop-losses.                       |

All order sizes can be entered in **USD or in the asset** (switchable), or as a percentage of your available balance via the size slider.

### Slippage protection

Market orders carry a configurable slippage tolerance (set in the trade panel's settings). This is a hard bound, not best-effort: the market order is sent as an immediate-or-cancel order with a limit price of mark × (1 ± your tolerance). You can never be filled beyond that price — any portion that can't fill within the bound is cancelled rather than filled worse.

### Post-only

Pick **Post Only** in the order form to guarantee a maker fill. The order is sent to Hyperliquid as add-liquidity-only: it rests at your price, or — if that price would cross the book — the venue rejects it and nothing fills. A rejected post-only order shows in your order history as *Post-only order would have immediately matched*; place it again further from the market.

### Take-profit / stop-loss

* **Bracket order (attached TP/SL)** — toggle "Take Profit / Stop Loss" when placing a market or limit entry to attach a whole-position take-profit and/or stop-loss. Both are submitted with the entry and shown in your open orders while the entry works, but they only arm once the entry fills — so there is never a moment where a filled entry sits unprotected. If the entry is cancelled before any fill, the attached TP/SL are cancelled with it; if it fills in part, they arm against the position that fill opened. Arming a bracket TP/SL replaces any existing whole-position TP/SL of the same kind. Until they arm they can be cancelled but not edited; editing the entry's price re-checks that the attached levels are still on the correct side.
* **Position TP/SL** — add or edit TP/SL on any open position from the positions table, including **partial TP/SL**: close a chosen fraction of the position at each trigger level.

TP/SL levels are drawn on the chart and can be managed from there.

### Reduce-only

Mark any order **reduce-only** and it can only decrease your position — never flip or increase it. Reduce-only orders are exempt from the minimum order value, so you can always close dust.

### Managing orders

* **Modify** a resting limit or post-only order's price or size in place — no cancel-and-replace needed.
* **Cancel** individual orders, or **cancel all** resting orders in one action.
* Orders are signed per-request (EIP-712) and can be submitted in batches of up to 20.

## Leverage

Leverage is set **per market** with integer steps from 1x up to the market's maximum (see [Markets & Trading Rules](/perps/markets)). Your leverage selection is remembered per market and applies to new position openings.

## Margin

HyperFlow Perps uses **isolated margin**: each position holds its own collateral, and losses on one position can never draw down another position's margin.

* **Add margin** to a position to push the liquidation price further away.
* **Remove margin** that exceeds the position's initial margin requirement.
* Margin adjustments are applied asynchronously — the UI shows the pending state until confirmed.

Before you submit any order, the trade panel shows the **order value**, the **required margin**, and the **estimated liquidation price** — so there are no surprises after the fill.

## Closing positions

Close from the positions table with:

* **Market close** — immediate, full or partial (by percentage, USD, or asset amount).
* **Limit close** — rest a closing order at your chosen price.
* **Close all** — flatten every open position in one confirmation.

**Next:** [Markets & Trading Rules](/perps/markets)