OFFCODE
Sign inCreate account

What a perpetual swap actually is, mathematically and practically

Perpetuals are the most-traded crypto derivative. Most users never learn how they work. Here is the full picture: pricing, margin, liquidation, and edge cases.

22/04/2026 · 12 min de leitura · Futures · Perpetuals · Education

The original problem

Traditional futures contracts have expiration dates. You agree to buy or sell an asset at a future date at a fixed price. At expiration, the price converges to spot via delivery or cash settlement.

Crypto needed a futures-like product without delivery (because moving crypto in size is operationally hard) and without expiration (because traders wanted continuous exposure).

BitMEX launched the perpetual swap in 2016. The mechanism: track spot price via funding rates between longs and shorts, settle continuously in USDC or another stable margin asset.

How the price stays anchored to spot

If the perp trades at $108,000 and spot is $107,800 (perp premium = 0.2%), funding flows from longs to shorts every 8 hours. Longs paying = longs decrease, basis tightens.

If the perp trades at $107,500 and spot is $107,800 (perp discount = 0.3%), funding flows from shorts to longs. Same mechanism in reverse.

The funding rate is calculated continuously and applied at fixed intervals (every 8 hours on most exchanges, every 1 hour on dYdX, etc). The exact formula varies by venue.

Margin types

Isolated margin: each position has its own margin. If one liquidates, only that margin is lost. Other positions are unaffected. Use for trades you want to ring-fence.

Cross margin: all positions share a single margin pool. Profitable positions can subsidize underwater ones. More capital efficient but a cascade can take all positions down simultaneously.

Most professionals use cross margin with strict total leverage caps. Most retail uses isolated to limit blast radius per trade.

Liquidation mechanics

A liquidation triggers when your position's margin ratio drops below the maintenance margin requirement (typically 0.5-2% of position notional).

On liquidation, the exchange closes your position at the current market price (usually with a small adverse skew called the liquidation fee). You lose the margin posted to the position.

If the liquidation can't fully close at the maintenance level (e.g., a massive gap move), the exchange's insurance fund covers the gap, or auto-deleveraging kicks in (profitable opposing positions are partially closed to balance the book).

Auto-deleveraging (ADL)

ADL is the worst-case mechanism. When the insurance fund can't absorb losses, profitable positions on the opposite side are partially closed at the bankruptcy price.

This is rare but it does happen during extreme volatility. The 2020 March crash, the May 2021 flash crashes, the 2022 LUNA collapse all triggered ADL on multiple exchanges.

How to avoid being ADLed: keep some positions less profitable (paradoxically, the most profitable get ADLed first), or use exchanges with strong insurance funds.

Mark price vs last price

Liquidations don't happen at the last traded price. They happen at the "mark price," a smoothed index that combines spot prices from multiple exchanges and the recent perp price.

This prevents flash-crash manipulation. If one exchange has a 5% wick down and back, your liquidation isn't triggered because the mark price didn't move that much.

Different exchanges use different mark price formulas. OFFCODE's futures use a weighted average of major spot venues plus a perp impact-price component.

Inverse vs linear perps

Linear perps (USDC-margined): margin and P&L are in USDC. Position size and price are quoted in USDC. Most modern perps are linear. Used by Binance, OFFCODE, Bybit.

Inverse perps (coin-margined): margin and P&L are in the underlying crypto (BTC, ETH). You bet on the USD price but the math is denominated in coin. Used historically by BitMEX, still on some exchanges.

For most retail traders, linear is simpler. P&L is in dollars; you don't need to convert. Inverse has tax efficiency in some jurisdictions but the math is harder.

Position sizing and notional

Notional position value = (size in BTC) × (current price in USDC). A 0.5 BTC position with BTC at $108k = $54,000 notional.

Required margin = notional / leverage. At 5x leverage, $54,000 notional needs $10,800 margin. At 25x, it needs $2,160.

Maintenance margin (the threshold for liquidation) is typically 0.5% of notional for major perps, scaling up with tier. Larger positions have higher maintenance requirements.

Practical examples

Open a long 1 BTC perp at $108,000 with 5x leverage. Margin posted: $21,600 USDC. Maintenance margin at 0.5%: $540. Liquidation price (approximate): $86,940 (a 19.5% drop).

BTC rises to $115,000. P&L = +$7,000. Position now worth $115k, margin is $28,600 USDC, leverage has dropped to roughly 4x.

Funding has been 0.01% per 8h positive (you pay shorts). Over 3 days: $108,000 × 0.01% × 9 funding periods = $97.20 paid. Net P&L: $6,903.

Bottom line

Perpetual swaps are the cleanest leverage product in crypto. They're transparent, liquid, and well-understood by professionals.

Use them carefully. Most retail traders lose money because they treat perps as lottery tickets. Used correctly (proper sizing, stops, funding awareness), they're a powerful capital-efficient tool.

← Todos os artigos