01How margin is measured#
The payout base is the position's marginUsed from Hyperliquid's clearinghouseState at purchase time, frozen into the cover:
| Margin type | marginUsed | Liquidation price |
|---|---|---|
| Isolated | Margin locked to the position (plus any added margin). | Depends only on this position. Stable unless you add or remove margin. |
| Cross | Position value ÷ leverage at mark: the margin the position requires, not the account's total equity. | Account-wide (liquidationPx). Moves when other positions win or lose, or when equity is withdrawn. |
curl -s https://api.hyperliquid.xyz/info \
-H 'Content-Type: application/json' \
-d '{"type":"clearinghouseState","user":"0xYOUR_WALLET"}' \
| jq '.assetPositions[].position | {coin, szi, leverage, marginUsed, liquidationPx, positionValue}'
02Cross: what to watch#
A cross position shares equity with every other position in the account. Its liquidation price can move closer without the covered coin moving at all. The premium is fixed at purchase on the liquidation price at that moment.
- Opening another losing position, or withdrawing USDC, moves every cross liquidation price closer. The cover still pays, but you priced less risk than you are now running.
- A cross liquidation is recorded with
dir: "Liquidated Cross Long"(or Short). Only the covered coin's liquidation fill pays its cover. - One account-level liquidation can liquidate several cross positions at once. Each covered coin pays its own cover.
03Isolated: the clean case#
An isolated position's liquidation price depends only on its own entry, size, margin and maintenance requirement. Hyperliquid's maintenance margin is half of the initial margin at the coin's maximum leverage (0.5 / maxLeverage), so the liquidation move is about 1/leverage − 0.5/maxLeverage. The model's approxLiqPx(entry, leverage, side, 0.5 / maxLeverage) reproduces it for calculators when no live position exists; live quotes always use Hyperliquid's own liquidationPx.