Leverage and margin
How margin works on perpetual futures: initial and maintenance margin, cross and isolated accounts, a derived liquidation price, effective leverage, and fee and funding drag.
You’ll learn
- Define initial margin, maintenance margin, equity, notional and effective leverage precisely
- Derive the liquidation price of a long or short position and reproduce a venue’s published example
- Calculate return on margin after trading fees and funding
- Explain why a position’s quoted leverage can differ from its effective leverage
- Estimate the chance of touching a liquidation level over time with a simple model, and state that model’s limits
Withdrawing margin on purpose
On March 12, 2025, a large ETH long on Hyperliquid was closed by the venue’s liquidation system after the trader withdrew margin from the account. Hyperliquid said no exploit or hack took place. It said the trader withdrew equity, lowering their margin, and was then liquidated, ending with about $1.8 million in profit. Its liquidity vault, HLP, lost about $4 million over the prior 24 hours, roughly 1% of its $451 million in total value locked, as reported by The Block. Reports differ on size: The Block cites 160,234 ETH, or about $306.85 million in notional value, from the analytics account Lookonchain, while Cointelegraph describes a position of roughly $200 million. Hyperliquid set its maximum leverage at 40x for BTC and 25x for ETH, which raised maintenance margin for larger positions, and it introduced stricter margin requirements when collateral is withdrawn from open positions.
That event turns on a point many traders never need to think about: margin is not only a deposit made once at the start of a trade. It is a running balance, and the rules around it decide who bears a loss when the balance runs out. This lesson builds those rules from accounting first principles.
The margin account
Notional value: Position size multiplied by a reference price: |q| × P. A position of 5 ETH at $2,000 has a notional value of $10,000.
Equity (account value): Collateral deposited plus unrealized profit or loss on open positions, plus or minus realized profit, fees and funding already booked. For a single position, E = C + q(P − P0), where C is collateral, P0 the entry price, and q is positive for a long and negative for a short.
Initial margin: The equity required to open or increase a position. It is often written as a fraction of notional. Hyperliquid documents it as position size × mark price ÷ leverage.
Maintenance margin: The minimum equity required to keep a position open. If equity falls below this, the position becomes eligible for liquidation.
Effective leverage: Total notional value divided by current equity: L = Σ|qiPi| / E. It changes every time the price changes.
A perpetual trader borrows nothing in the everyday sense. There is no loan balance. The margin is a performance bond, the collateral that stands behind future losses. Leverage appears because the exposure is larger than the bond. This is why perpetual positions can pay funding without any interest being charged on the notional by a lender, and why the venue’s concern is not a repayment date but whether equity stays above a threshold.
| Venue | Initial margin | Maintenance margin |
|---|---|---|
| Hyperliquid | Notional ÷ chosen leverage, with a maximum by asset (read on Nov. 5, 2026: BTC 40x, ETH 25x, SOL 20x) | Half of the initial margin at maximum leverage. So 1.25% at 40x and 2% at 25x, with margin tiers for larger positions |
| dYdX v4 | |size| × oracle price × initial margin fraction. The fraction rises with open notional in a market, up to 100%. ETH-USD read 2% on Nov. 5, 2026 | |size| × oracle price × maintenance margin fraction, fixed for each market. ETH-USD read 1.2% on Nov. 5, 2026 |
| Binance USDⓈ-M | Set by leverage, within tiers by position size | Notional × maintenance rate − maintenance amount, both from the tier for that notional |
| GMX | Depends on market settings | Remaining collateral must stay above 0.25% to 1% of position size, or an absolute floor, after losses, fees and capped negative price impact |
As documented in November 2026. These settings change, and they vary by asset and position size. Check the current page before using a figure.
Tiers exist because closing a large position moves the market more than closing a small one. A linear maintenance fraction would understate the cost of unwinding a very large position. So the fraction rises with size, as Hyperliquid’s March 2025 change also shows.
Binance’s published maintenance margin example
- 10 BTCUSDT perpetuals at a mark price of 26,000 have a notional of 260,000 USDT, which falls in tier 3 on the page’s table.
- That tier has a rate of 1% and a maintenance amount of 1,300.
- Maintenance margin = 260,000 × 1% − 1,300 = 1,300 USDT.
How leverage scales returns
Return on margin is the profit divided by the collateral committed. For a price return r and initial leverage L, ignoring costs:
R is return on initial margin, L is notional divided by initial margin, and r is the price return for a long position (negative r for a short with a rising price).
That relation is linear, so leverage scales gains and losses by the same factor. What it does to survival is not linear, because the account cannot lose more than its equity without an outside party bearing the excess. A fall of 1/L erases all of the initial margin before any maintenance buffer. So the relevant question is not how much a position gains in a good scenario. It is how often the path reaches the liquidation level before the good scenario can occur. A long position that needs a 10% rise but first faces a 9% fall is closed before the rise, and no later price recovery helps it.
Example: the same price move at 10x
- Example position: $2,000 margin and $20,000 notional, so L = 10.
- A +3% price move gives 20,000 × 0.03 = +$600, a +30% return on margin.
- A −3% price move gives −$600, a −30% return on margin. Equity is now $1,400 and notional $19,400.
- Effective leverage has risen to 19,400 / 1,400 = 13.9x without the trader doing anything.
Cross and isolated margin
Isolated margin: Collateral assigned to one position. A loss on that position cannot consume other account funds, and that position can be liquidated while the rest of the account is untouched.
Cross margin: All of the account’s eligible collateral supports all of its cross positions. Gains on one position can support another, and a large loss on one can liquidate them all.
Hyperliquid documents cross margin as its default, for capital efficiency, and isolated margin as a way to confine an asset’s collateral to that asset. The trade-off is direct. Cross margin avoids liquidation of one position when the account overall is healthy, but it couples risks. Isolated margin confines a loss, but a position can be closed despite ample funds elsewhere. Backstop liquidation shows the difference. On Hyperliquid, a backstop of a cross position transfers the trader’s cross positions and cross margin to the liquidator, while a backstop of an isolated position transfers only that position and its margin.
Unified or multi-asset margin extends cross margin to collateral other than a stablecoin. The account’s collateral value then depends on how the venue prices that collateral, which ties a position’s survival to a second asset’s price feed. Lesson 13 shows how this can matter under stress.
Deriving the liquidation price
Liquidation occurs when equity equals maintenance margin. Take a single isolated position with collateral C and size q at entry price P0, and maintenance fraction m. For a long position (q > 0):
Solve the equity condition for P. The numerator P0 − C/q is the bankruptcy price, where equity is zero. Dividing by 1 − m lifts it to the level where the maintenance requirement is reached.
For a short position with size |q|, equity is C − |q|(P − P0). Setting it equal to m|q|P gives:
The bankruptcy price P0 + C/|q| is above entry, and maintenance margin pulls the trigger below it.
Hyperliquid publishes the same relation in a different form: liq_price = price − side × margin_available / position_size / (1 − l × side). Here side is +1 for long and −1 for short, l is one over the maintenance leverage, and margin_available is equity minus the maintenance requirement at the current price. Substituting shows that the expressions are algebraically equal.
Example: liquidation prices at nominal 10x
- Example inputs: entry $2,000, q = 5, collateral $1,000, m = 1.25%. Notional is $10,000 and L = 10.
- Long: (2,000 − 1,000/5) / (1 − 0.0125) = 1,800 / 0.9875 = $1,822.78, a fall of 8.86%.
- Short: (2,000 + 1,000/5) / (1 + 0.0125) = 2,200 / 1.0125 = $2,172.84, a rise of 8.64%.
- Check using the Hyperliquid form for the long: margin available = 1,000 − 0.0125 × 10,000 = 875. Then 2,000 − 875 / 5 / 0.9875 = $1,822.78.
| Nominal leverage | 1/L | Fall to liquidation with m = 1.25% |
|---|---|---|
| 2x | 50.00% | 49.37% |
| 5x | 20.00% | 18.99% |
| 10x | 10.00% | 8.86% |
| 20x | 5.00% | 3.80% |
| 25x | 4.00% | 2.78% |
| 40x | 2.50% | 1.27% |
Example with a fixed maintenance rate. On a live venue the rate varies by asset and size. At 40x the maintenance requirement consumes half of the initial margin.
A cross-margin account has no single liquidation price in this strict sense, because any other position’s profit or loss moves the available margin. A displayed liquidation price is therefore conditional: it assumes everything else stays constant. Binance’s published cross-margin formula shows the structure.
For a long position in one-way mode. WB is cross wallet balance, TMM1 the maintenance margin of other contracts, UPNL1 the unrealized profit or loss of other contracts, cumB the maintenance amount, EP the entry price and MMR the maintenance rate. The page displays the formula as an image, and this form was reconstructed from its variable list and confirmed against its examples.
Binance’s ETHUSDT worked case, reproduced
- Inputs from the page: WB = 1,535,443.01, TMM1 = 71,200.81, UPNL1 = −56,354.57, cumB = 135,365, q = 3,683.979, EP = 1,456.84, MMR = 10%.
- Numerator: 71,200.81 − 135,365 − 1,535,443.01 + 56,354.57 + (3,683.979 × 1,456.84) ≈ 3,823,715.
- Denominator: 3,683.979 × 0.90 ≈ 3,315.58.
- Result: about 1,153.26, matching the page.
Quoted leverage and effective leverage
The leverage number on a trading screen is usually a setting. It determines how much initial margin the venue assigns to a position, and it says little by itself about how close an account is to liquidation. In cross margin, excess collateral may sit far above what the setting implies.
A real account: 20x on the label, about 1.1x in fact
- A child vault of HLP, Hyperliquid’s public protocol vault (address beginning 0x010461c1), was read through the public API on November 5, 2026.
- Its BTC position was labeled cross, leverage value 20, with position value $229.59 and margin used $11.48. That is 229.59 / 20, so the label sets the margin assigned to the position.
- The whole account showed equity of about $3.06 million and total notional of about $3.46 million.
- Effective leverage = 3.46 / 3.06 = about 1.13x.
Effective leverage moves in three ways: when the price moves, when positions change, and when collateral changes. The March 2025 case in the opening used the third route. Withdrawing $X of equity raises effective leverage with no trade at all. In example numbers, $200,000 of notional on $40,000 of equity is 5x. Withdraw $30,000, and it is 20x. That is why Hyperliquid limits withdrawals of unrealized profit and margin. Its documentation, read in November 2026, states transfer_margin_required = max(initial_margin_required, 0.1 × total_position_value), so an account must keep at least 10% of total notional when transferring out. Cointelegraph reported a 20% requirement on certain positions when the rule was announced in March 2025. The two figures come from different dates, and the current documentation governs.
Binance’s auto-deleveraging rule uses a definition close to this lesson’s: effective leverage equals absolute position notional divided by account balance plus unrealized profit. The venue itself therefore treats current equity as the true denominator.
Fees and funding as drag
Trading fees and funding are charged on notional, but a trader’s capital is the margin. Costs therefore scale with leverage in the same way as returns, and they apply whether or not the price moves.
f is the trading fee per side as a share of notional, and fundingt is the rate at each funding time while the position is held, counted positive when paid. Funding may be a credit if the position is on the receiving side.
Example: holding 10x long for 30 days
- Example inputs: margin $2,000, notional $20,000, taker fee 0.05% per side, and funding held at the default 0.01% per 8 hours for 90 intervals, paid by longs.
- Fees: 2 × 0.05% × 20,000 = $20, which is 1% of margin.
- Funding: 90 × 0.01% × 20,000 = $180, which is 9% of margin.
- Total drag: $200, or 10% of margin over a month.
- The price must rise 200 / 20,000 = 1% just to break even.
Liquidation adds another cost. On GMX, the fee is a percentage of notional rather than of collateral: 0.20% for standard markets, 0.30% for single-token and synthetic markets, and 0.45% for newly listed high-volatility markets. On dYdX, the default maximum penalty is 1.5%, adjustable by governance, and up to the account’s remaining value may be transferred to the insurance fund. The trader does not simply lose margin down to the threshold. They can also lose the buffer between it and zero, partly because a forced order pays for the liquidity it consumes. On Hyperliquid, maintenance margin is not returned in a backstop liquidation, though remaining collateral stays with the trader after a successful book liquidation.
Path risk: the chance of touching a level
A price need not end below a liquidation level to close a position. It only has to touch it. For a price following driftless Brownian motion, the reflection principle gives a simple approximation for the chance of touching a level at log distance d within time T.
Φ is the standard normal distribution function and σ is the volatility per unit of time. It doubles the probability of ending beyond the level, because a path that reaches the level is then equally likely to finish on either side.
Example: 30 days at 3% daily volatility
- σ√T = 0.03 × √30 = 16.4%. The distances come from the table above, treated as approximately equal to their log values.
- 2x, d = 49.4%: z = 3.00, so Pr ≈ 2Φ(−3.00) = 0.27%.
- 5x, d = 19.0%: z = 1.16, so Pr ≈ 25%.
- 10x, d = 8.86%: z = 0.54, so Pr ≈ 59%.
- 25x, d = 2.78%: z = 0.17, so Pr ≈ 87%.
The model has clear limits, and every limit makes it optimistic or simply wrong in stress. Crypto returns have fat tails and volatility clusters, so a constant σ understates extreme moves. Prices can jump past a level, so the bound can be crossed with no chance to act. Margin requirements themselves can change. Funding and fees reduce the distance over time, and the mark price may differ from any spot series a student uses. Treat the formula as a way to reason about holding time and distance together. It is not a tool for setting a position size.
Do high leverage caps make a market more dangerous?
One side argues that caps directly limit the size of a shock any account can transmit. It points to Brunnermeier and Pedersen’s model, in which margins can become destabilizing and funding and market liquidity reinforce each other in spirals, and to Hyperliquid’s own decision to tighten its caps after March 2025. The other side argues that a cap on one venue moves risk rather than removing it. A trader can split a position across accounts or venues, so a lower cap may cut visible leverage more than actual leverage. Capping also has a cost: requirements raised in a stressed market can force the closures they intend to prevent. Evidence on crypto caps specifically is limited, since venue changes rarely offer a clean control group.
Common mistakes
- Equating 10x with a 10% distance to liquidation. Maintenance margin makes it closer, and costs reduce equity further.
- Reading the leverage label as account risk. It may set initial margin only, while effective leverage depends on the whole account.
- Treating a displayed cross-margin liquidation price as fixed. It moves with every other position, with funding and with collateral value.
- Calling return on margin the same thing as return on capital. Spare collateral held elsewhere in the account also carries risk or opportunity cost.
- Ignoring funding because the rate looks tiny. A rate charged on notional is a much larger rate on margin.
- Assuming a loss stops at the margin posted. On some venues and scenarios a shortfall falls on an insurance fund or on other traders (Lesson 13). The account usually bears none of the excess, but others do.
Problem set
- An example account opens a 3 ETH short at $2,500 with $1,500 of isolated collateral and a 2% maintenance fraction. Find nominal leverage, the bankruptcy price and the liquidation price.
Show solution
Notional = 3 × 2,500 = $7,500, so leverage = 7,500 / 1,500 = 5x. Bankruptcy price = 2,500 + 1,500/3 = $3,000. Liquidation price = 3,000 / 1.02 = $2,941.18, a rise of 17.65%. - Derive the approximate price distance to liquidation for a long position in terms of L and m, and evaluate it at L = 25 and m = 2%.
Show solution
With C/q = P0/L, Pliq = P0(1 − 1/L)/(1 − m). The fractional fall is 1 − (1 − 1/L)/(1 − m) = (1/L − m)/(1 − m). At L = 25 and m = 2%: (0.04 − 0.02)/0.98 = 2.04%. Half of the 4% margin is used up by the maintenance requirement. - An example long has $5,000 equity and $25,000 notional. The price falls 8%. Find the new equity, notional and effective leverage. How much collateral would be needed to return to the initial 5x?
Show solution
The loss is 25,000 × 0.08 = $2,000. Equity = $3,000 and notional = $23,000, so L = 7.67x. To reach 5x, equity must be 23,000 / 5 = $4,600, so $1,600 of new collateral is required. - An example position has $50,000 notional and $5,000 margin. The taker fee is 0.04% per side. Funding paid averages 0.015% per 8 hours for 60 days. Find the total cost and the break-even price move.
Show solution
60 days has 180 intervals. Funding = 180 × 0.015% × 50,000 = $1,350. Fees = 2 × 0.04% × 50,000 = $40. Total = $1,390, which is 27.8% of margin. The break-even move = 1,390 / 50,000 = 2.78%. - Use the reflection approximation to compare a 10x long over 7 days and over 90 days with d = 8.86% and σ = 3% a day. What does the result imply about the leverage figure on its own?
Show solution
7 days: σ√T = 7.94%, z = 1.12, Pr ≈ 2 × 0.132 = 26%. 90 days: σ√T = 28.5%, z = 0.31, Pr ≈ 2 × 0.378 = 76%. The same leverage has very different touch risk at different horizons, so leverage alone does not describe risk. The model’s assumptions also make both figures rough. - Two example accounts each show a 2x BTC position of $100,000 notional. Account A is isolated with $50,000 assigned. Account B is cross with $50,000 equity, and a $200,000 notional ETH long in the same account. Which account is more exposed to a 30% market fall, and why?
Show solution
Account B. Its effective leverage is 300,000 / 50,000 = 6x, so a 30% fall in both assets would lose $90,000, more than its equity. Account A would lose $30,000 on $50,000 of margin and survive. The 2x label appears on both positions, but only A’s position is confined to that margin. The figures assume the assets fall together.
References
- Hyperliquid. Margining documentation (read November 2026). Source
- Hyperliquid. Liquidations documentation (read November 2026). Source
- dYdX. Margin documentation (read November 2026). Source
- dYdX. Liquidations documentation (read November 2026). Source
- Binance. How to calculate liquidation price of USDⓈ-M futures contracts (read November 2026). Source
- Binance. What is auto-deleveraging and how does it work? (read November 2026). Source
- GMX. Liquidations and auto-deleveraging documentation (read November 2026). Source
- Brunnermeier, M., and Pedersen, L. (2009). Market Liquidity and Funding Liquidity. Review of Financial Studies 22(6), 2201-2238. Source
- The Block (March 12, 2025). HYPE drops 8.5% amid $4 million HLP vault loss following Hyperliquid whale liquidation event. Source
- Cointelegraph (March 2025). Hyperliquid ups margin requirements after $4 million liquidation loss. Source
Exercise
- Read the clearinghouseState request on this page. Query any public vault or address you are studying, and do not publish a conclusion about a person.
- For each position, compare the leverage label with positionValue ÷ marginUsed. Then compute the account’s effective leverage as totalNtlPos ÷ accountValue.
- Take one isolated position, if the account has one, and rebuild its liquidationPx from entry, margin and the maintenance rate using the formula in this lesson.
- Explain any gap. Candidates include margin tiers, funding already booked, and collateral changes since entry.
- Write two sentences on what the record cannot tell you about the account owner’s total exposure.
Check yourself
1. A long position has 10x nominal leverage and a maintenance fraction above zero. Where is the liquidation trigger relative to a 10% price fall?
2. An account withdraws collateral and places no trades. What happens?
3. A position shows 20x, yet the account’s total notional is 1.1 times its equity. What is the best description?
4. Why does a displayed cross-margin liquidation price change when a different position moves?
5. A trader compares two positions with the same price return. The higher-leverage one loses a much larger share of margin to funding. Why?
6. The reflection approximation shows a high chance of touching a level. Which limit is most relevant in a sudden crash?
7. Which venue choice shows that the amount of margin needed scales with size?
Describes past on-chain activity and how our data is built. Not investment advice. Method details: data methodology. Live panels: tracked whale wallets, updated 2026-11-05 15:41 UTC.