Skip to content
Leverage can liquidate a position. Paper results are not a forecast. These pages describe what the app does today.
Docs09
Browse the docs

Margin & liquidation

Margin is isolated: each position posts its own collateral and can lose that collateral, and no more. The formulas below are the ones the engine runs, so you can reproduce any number on your screen.

On this page

Collateral and equity#

A paper account starts with 10,000 USD of collateral, and a reset returns it there. Everything else is derived from four running totals.

Account
equity    = starting collateral + realized − fees − funding + unrealized
available = starting collateral + realized − fees − funding − margin locked in positions
            (and not committed to resting orders)

Isolated margin#

Initial margin
margin = notional / leverage

Margin is locked when a position opens and returned, with the result, when it closes. A loss on one position cannot reach another position’s margin. Adding to a position adds margin at the new leverage. There is no cross margin and no portfolio margin.

Maintenance margin and liquidation#

A position is liquidated when its equity falls to its maintenance margin. The maintenance rate comes from the market’s own maximum leverage:

Formulas
mmr         = 1 / (2 × maximum leverage of the market)
effective   = margin − funding already paid on this position
long  liq   = (entry × size − effective) / (size × (1 − mmr))
short liq   = (entry × size + effective) / (size × (1 + mmr))

Worked example#

A long of 10 coins at an entry of 100 is 1,000 USD of notional. At 5x it posts 200 USD. The market allows 40x, so the maintenance rate is 1/80 = 1.25%.

text
liq  = (100 × 10 − 200) / (10 × (1 − 0.0125))
     = 800 / 9.875
     ≈ 81.01          (about 19% below the entry)
fee  = 1,000 × 4.5 bps = 0.45 USD at entry (taker)

Funding already paid moves the liquidation closer, because it reduces the effective margin.

What a liquidation does#

  1. The engine checks each position against its liquidation price, using the guarded mark and the one-minute extremes since the last check.
  2. If the price touched it, the position is closed at the liquidation price, or at the mark when the price gapped past it.
  3. The posted effective margin is lost. It is booked as a realized loss, and the liquidation counter on the account goes up.
  4. Resting reduce-only orders on that market are cancelled.

Why the stop comes first#

A new position needs a stop inside its liquidation price. The ticket check requires the stop distance plus one percentage point to stay under the estimated liquidation distance. If a stop and the liquidation price are both touched in the same minute, the one nearer to the entry fires.

Fees#

RoleRateWhen
Taker4.5 bps of notionalMarket, IOC, FOK, a limit that crosses the mark, stops, targets, closes
Maker1.5 bps of notionalA resting limit or post-only order that fills later

Fees come out of collateral and count toward the daily loss stop. Rates are fixed constants in the paper engine. They are modeled on a typical venue schedule and are not read from your own account.

Funding#

Funding settles on each clock hour using the venue’s published hourly rate and the guarded mark. A positive rate means longs pay shorts, and a negative rate means the reverse. The rate is capped at 4% an hour.

text
payment = direction × rate × size × mark × hours
direction = +1 for a long, −1 for a short   (positive = you pay)

Payments reduce the position’s effective margin and the account’s collateral. Hours that passed while nobody was watching are settled on the next check, at the current rate. That is an approximation: real funding uses the rate of each past hour.

Insurance buffer#

Paper liquidations feed a simple shared ledger. When a position is liquidated, the equity left at the close, positive or negative, is added to the buffer. It is an accounting number that shows how liquidations would have netted out. It never changes your balance.

Elize Bot is not affiliated with or endorsed by Hyperliquid, Elysium, Kinetiq or Montra. Names are used only to say which venue or chain a feature talks to. Leveraged positions can be liquidated, and a paper result is not a forecast of a real one.