Perpetual DEX Internals
Perpetual futures are the most traded instrument in crypto - more volume than spot markets. Unlike traditional futures, perps never expire. They use a funding rate mechanism to keep their price tethered to the underlying spot price. Protocols like GMX, dYdX, and Hyperliquid have built billion-dollar markets entirely on-chain, each with different architectural tradeoffs.
? Architecture Comparison
Oracle: Chainlink + FastPriceFeed
Zero slippage trades against the pool
Traders PnL = LPs PnL
Chain: Cosmos appchain (v4)
MEV-resistant with in-protocol sequencer
CEX-like UX with decentralized settlement
Speed: <1s finality
Custom HyperBFT consensus
Vaults for market-making
Funding Rates
How perpetual futures stay pegged to spot price through periodic payments between longs and shorts
Virtual AMMs
How vAMMs create synthetic price exposure without real liquidity - the engine behind on-chain perps
Liquidations
Maintenance margins, liquidation cascades, and how insurance funds absorb bad debt
How a perpetual works in 90 seconds
A perpetual future is a leveraged contract with no expiry that tracks a spot index through periodic funding payments. A trader posts collateral, picks an isolated or cross-margin mode, and opens a position whose size is collateral leverage. The exchange computes a mark price - typically a smoothed midpoint of its own order book and an external index - and reprices the position continuously. Unrealized PnL is collateral (mark / entry ? 1) for a long, and the inverse for a short. Because the perp never expires, the exchange has to manufacture convergence between mark and index, which is the entire job of the funding rate.
Funding settles in 8-hour epochs at 00:00, 08:00, and 16:00 UTC on most venues. The rate is roughly (Mark ? Index) / Index divided across periods-per-day, plus a small interest term. When the rate is positive, every open long pays the per-period rate to every open short on their notional; when negative, shorts pay longs. The exchange does not pocket funding, it only defines the formula. That payment is what discourages the perp from drifting away from spot: persistent positive funding bleeds longs until the mark closes the gap.
Liquidation is the other convergence force. Each tier of position size has a maintenance-margin ratio (MMR) - sometimes as low as 0.4% on small books, climbing to 5-10% for large positions. When equity in the position falls below the MMR threshold the exchange force-closes the position, taking a liquidation fee and routing residual loss to the insurance fund or, on pool-based DEXes, to ADL. Cascades happen when one batch of liquidations moves price into the next tier and triggers the next batch - the structural risk every leveraged-derivatives venue is designed around.
Key concepts
- Funding rate
- Funding rate is the per-period cash payment that pulls a perpetual's mark toward its index. The standard formula is Funding = clamp(Premium / periods-per-day + Interest, +/-cap), where Premium = (Mark ? Index) / Index. Cash flows directly between trader collateral wallets every 8 hours on most venues. Persistent positive funding indicates crowded long positioning; persistent negative funding signals crowded shorts and is the harvestable side of delta-neutral cash-and-carry trades.
- Mark vs index price
- Index price is the average of underlying spot venues used as the truth source. Mark price is the venue's own internal price for the perp - usually a clamped midpoint of order-book depth and the index - and is what unrealized PnL and liquidations are computed against. Splitting the two stops a manipulator from printing bad liquidations purely by walking the local order book, while still letting the perp react to real perp-market sentiment.
- Maintenance margin and tiered leverage
- Maintenance-margin ratio (MMR) is the floor below which a position is liquidated. On tiered systems the MMR rises with position size - sub-$50K positions can run at 0.4% MMR with up to 125 leverage, while $1M-$5M positions cap at roughly 10 and 5% MMR. The tier table is the venue's tool for limiting concentrated risk; large positions are intentionally penalized to keep the insurance fund's loss-given-default bounded.
- Liquidation cascade
- A cascade is the self-reinforcing loop where forced liquidations sell into the book, the resulting move trips the next leverage tier, and the next batch fires. Cascades amplify when mark price tracks the local order book closely; they damp when mark anchors to a multi-venue index. Most insurance-fund pulls and ADL events trace back to a cascade rather than a clean directional move.
- Virtual AMM (vAMM)
- A vAMM uses x y = k constant-product math but with virtual reserves rather than real LP tokens. Trades shift the bookkeeping reserves and therefore the quoted price - bigger trades take worse fills exactly as on a spot AMM - and trader PnL is paid from a backing pool or insurance fund. Perpetual Protocol v1 popularized the design; Drift and a handful of newer venues still use modified vAMM cores today.
- Insurance fund vs ADL
- The insurance fund is a pool of accumulated fees and liquidation surpluses that absorbs losses when a position liquidates below its bankruptcy price. Auto-deleveraging (ADL) is the next-line backstop: when the fund cannot cover the gap, the venue force-closes the most-profitable opposite-side positions pro-rata at the bankruptcy price. CEXes lean on insurance funds; pool-based on-chain perps like GMX V2 lean on ADL because their pool is the implicit reserve.
Why perpetuals matter
Perpetuals are the dominant instrument in crypto by daily volume, with notional perp turnover routinely a multiple of spot turnover across both centralized and decentralized venues. As of April 2026, on-chain perp DEXes - pool-based designs like GMX, order-book L2s like dYdX v4 on Cosmos, and consensus-native books like Hyperliquid - collectively settle billions of dollars of notional per day, and the funding rate at the largest of those venues is the single most-watched proxy for crypto positioning sentiment. Because funding payments flow directly between traders, the rate also gates an entire class of strategies: cash-and-carry desks, basis-trading hedge funds, and synthetic-dollar protocols like Ethena's USDe all sit on the short side of perps to harvest positive funding while staying flat to spot.
Architecturally, the perp primitive is also where every DeFi venue's design tradeoffs surface most clearly. A pool-based perp like GMX trades execution simplicity for LP directional risk; an order-book perp like dYdX v4 trades a bespoke appchain for matching fidelity; a vAMM trades capital efficiency for explicit ADL exposure. The differences in MMR tiers, mark-vs-index design, and insurance-fund sizing across venues are not cosmetic - they directly determine which kinds of cascades survive and which trader profiles are economically viable on each platform.
Frequently asked questions
- What is the funding rate and how is it actually paid?
- Funding rate is the per-period payment that keeps a perpetual's mark price tethered to spot. Most venues compute it roughly as (Mark ? Index) / Index periods-per-day plus an interest term, and most settle every 8 hours at 00:00, 08:00, and 16:00 UTC. When the rate is positive, longs pay shorts on every open position; when negative, shorts pay longs. The cash settles directly between trader collateral wallets - the exchange does not earn funding, it only sets the formula.
- How is mark price different from index price?
- Index price is the average of underlying spot venues (Binance, Coinbase, Kraken on most CEXes; the same plus Chainlink references on most DEXes). Mark price is the venue's own derived perp price, often a smoothed midpoint of the order book and the index, used for unrealized PnL and liquidations. The split exists because using only the order book would let a manipulator print bad liquidations, and using only spot would ignore real perp-market sentiment.
- How is a liquidation price calculated?
- For an isolated long, liquidation triggers when remaining margin falls below the maintenance-margin requirement: Liq Price ? Entry (1 ? (Collateral ? Fees) / Position Size + MMR). For a short the sign flips. Maintenance margin scales with position size - sub-$50K positions on tiered exchanges run as low as 0.4% MMR, while $1M-$5M positions can sit at 5% MMR or higher. Cross-margin liquidation uses portfolio equity instead, so any unrelated PnL feeds into the same calculation.
- What is a liquidation cascade?
- A cascade is the self-reinforcing loop where one batch of liquidations sells into the order book, the resulting price move triggers the next leverage tier, and so on until the imbalance clears. Cascades are why mark-vs-index design matters: a venue that liquidates strictly on its own thin order book amplifies cascades, while one that anchors mark to a multi-venue index dampens them. Insurance-fund pulls and ADL events almost always trace back to a cascade.
- How does a vAMM differ from a real AMM?
- A virtual AMM uses the same x y = k constant-product math as Uniswap, but the reserves are bookkeeping numbers rather than real tokens deposited by LPs. Trades adjust the virtual reserves and therefore the quoted price, so larger trades face worse execution exactly as on a spot AMM. The protocol absorbs trader PnL and pays it from a backing pool or insurance fund. vAMMs were popularized by Perpetual Protocol v1 and live on in modified form at Drift, while pool-based designs like GMX route flow through a real basket.
- Why does delta-neutral funding farming exist and who runs it?
- When perp funding is persistently positive - common in bull markets - a trader can hold spot ETH and short the same notional in a perpetual to harvest the funding payment with no directional exposure. Net annualized yields of 15-30% have been routine during sustained risk-on periods. The cash-and-carry trade is the entire engine behind synthetic-dollar designs like Ethena's USDe, and a meaningful share of CEX funding flow on any given day is delta-neutral books rebalancing rather than directional retail traders.
- What is the difference between insurance funds and ADL?
- When a position is liquidated below its bankruptcy price, the loss has to land somewhere. Insurance funds - pools of fees and prior liquidation surplus - absorb that loss first; ADL (auto-deleveraging) is the backstop that fires when the insurance fund cannot cover the gap. ADL force-closes the most-profitable opposite-side positions at the bankruptcy price, pro-rata, so the venue stays solvent. CEXes prefer insurance funds; on-chain pool-based perps like GMX V2 lean on ADL because their pool acts as the implicit insurance reserve.