How Perpetual DEXs Work · Perpetual Contracts · 3/4
Margin & Liquidation
Leverage is what makes perpetual futures both powerful and dangerous. Understanding margin and liquidation isn't optional — for traders it's survival, and for market operators it's the machinery that keeps a market solvent. A correct directional call with wrong position sizing can end in the same place as a wrong call: zero.
What Is Margin?
Margin is the collateral you deposit to open a leveraged position. Instead of putting up the full value of a trade, you put up a fraction; the margin exists to absorb your losses.
If you want to open a $100,000 BTC-PERP position:
- 1x leverage: You need $100,000 (no leverage, same as spot)
- 5x leverage: You need $20,000
- 10x leverage: You need $10,000
- 40x leverage: You need $2,500
The margin is your skin in the game. When your losses approach your margin, bad things happen.
Initial Margin vs Maintenance Margin
Two critical thresholds govern every leveraged position:
Initial Margin (IM): The minimum collateral required to open a position. It is notional / leverage, so the leverage you choose sets it, up to the asset's maximum leverage.
Maintenance Margin (MM): The minimum collateral required to keep a position open. It is always lower than the initial margin. On Hyperliquid it is set to half of the initial margin at the asset's max leverage — so it depends on the asset, not on the leverage you picked (Margining docs).
Example on Hyperliquid for BTC-PERP (as of October 2026, from the live meta endpoint and Margin tiers):
- Max leverage: 40x for positions up to $150M notional (20x above that)
- Maintenance margin: 1.25% (half of the 2.5% initial margin at 40x)
- For a $100,000 position at 10x, you deposit $10,000
- The position is liquidated when equity falls below $1,250
How Liquidation Works
Liquidation is the forced closure of your position when your equity falls below the maintenance requirement. On Hyperliquid the sequence is (Liquidations docs):
- You open a $100,000 long BTC-PERP at $60,000 with $10,000 isolated margin (10x)
- BTC falls to about $54,700 (by the mark price, not the last trade) — your equity is now about the $1,250 maintenance margin
- The liquidation engine sends market orders for the position to the order book. For positions above $100,000, only 20% is sent in the first liquidation order
- If the book closes enough of the position, any remaining collateral stays with you — Hyperliquid charges no separate clearance fee
- If equity drops below 2/3 of maintenance margin without the book absorbing the position, a backstop liquidation transfers it to the liquidator vault (a component of HLP), and the remaining maintenance margin is not returned
The backstop is the venue's buffer — what other exchanges call an insurance fund. If even that is not enough and an account goes negative, auto-deleveraging (ADL) closes profitable positions on the opposite side at the previous mark price, ranked by profit and leverage, so the venue never carries bad debt (ADL docs). Each HIP-3 DEX has its own on-chain backstop liquidator for assets with cross margin enabled, and falls back to ADL (HIP-3 docs).
Cross Margin vs Isolated Margin
This is one of the most important decisions a trader makes on any perp DEX:
Isolated Margin
- Each position has its own dedicated margin
- If Position A gets liquidated, Position B is unaffected
- You know exactly the maximum you can lose on each trade
- Pros: Risk isolation, clear max loss
- Cons: Less capital efficient, can get liquidated even if your account has plenty of free capital
Cross Margin
- All positions share one margin pool (your account balance)
- Profits from one position can offset losses in another
- You're harder to liquidate because your whole balance acts as margin
- Pros: More capital efficient, fewer unnecessary liquidations
- Cons: A single bad trade can drain your entire account, cascading liquidations
On Hyperliquid, cross margin is the default. Some assets are strict isolated (margin cannot be removed). HIP-3 DEXs also support a "no cross" mode, and enabling cross margin on a HIP-3 asset is irreversible and subject to validator eligibility standards (Margining docs, HIP-3 docs).
Practical Liquidation Examples
Both examples use Hyperliquid's ETH-PERP parameters (25x max leverage, so 2% maintenance margin) and the liquidation price formula.
Scenario 1: Isolated Margin Long
- Open: 10x long ETH at $3,000 with $1,000 isolated margin
- Position size: $10,000
- Liquidation price: ~$2,755
- Max loss: $1,000 (your isolated margin)
- Rest of account: untouched
Scenario 2: Cross Margin Long
- Account balance: $3,000
- Open: 10x long ETH at $3,000 with $1,000 initial margin
- Position size: $10,000
- Liquidation price: much lower (~$2,140) because all $3,000 backs the position
- Max loss: $3,000 (your entire account)
For cross positions, the leverage you set doesn't change the liquidation price — only how much of the balance is reserved as initial margin. Cross margin gives you more room to be right, but the downside is your whole account.
Liquidation Cascades
One of the most dangerous phenomena in leveraged markets is the liquidation cascade:
- Price drops sharply, liquidating long positions
- Liquidations are market sells, pushing the price down further
- Lower price triggers more liquidations
- Those liquidations push the price even lower
- Repeat until the cascade exhausts itself
This is why you see violent wicks in crypto. Design choices such as a robust mark price, partial liquidations of large positions and a backstop liquidator are there to dampen cascades, but they cannot remove them — thin books make them worse.
What This Means for Market Operators
If you deploy a HIP-3 market, several of these levers are yours (HIP-3 docs, deployer actions):
- Max leverage and margin tiers: They set the maintenance margin. High leverage on a thin or volatile market means positions go straight from healthy to backstop or ADL.
- Oracle quality: Liquidations follow the mark price, which is built on your oracle. A manipulable oracle is a liquidation weapon.
- Open interest caps: Capping OI limits how much has to be unwound in a cascade.
- Margin mode: Isolated-only markets contain damage; cross margin is irreversible once enabled and must meet validator standards.
- Liquidity: Liquidations go to the order book first. Without makers quoting through stress, more positions fall through to the backstop and ADL.
Margin and liquidation are mechanical — they follow rules, not emotions. Learn the rules, and you control the risk. Ignore them, and the market will teach you the hard way.