Hyperliquid Wiki Protocol & Ecosystem Knowledge Base
🔍

Perpetual Futures & Risk Mechanics

Comprehensive technical reference on perpetual contract mathematics, margin management, continuous funding rate mechanisms, mark pricing formulas, and liquidation safeguards on Hyperliquid.

1. Contract Architecture

Hyperliquid perpetual contracts are linear, USDC-margined derivative instruments tradable on the Hyperliquid trading platform. Unlike dated futures contracts, perpetuals have no expiry or settlement date. Position balances, unrealized profit and loss (uPnL), and fee deductions are denominated and settled in USDC collateral.

💡
Linear Payoff Structure: For a position size of S units opened at entry price P_entry and evaluated at current price P_mark:
Long PnL = S · (P_mark - P_entry)
Short PnL = S · (P_entry - P_mark)

2. Mark Price & Anti-Manipulation Engine

To prevent premature liquidations caused by temporary order book illiquidity or localized market manipulation ("scam wicks"), the protocol risk engine evaluates margins against a robust Mark Price rather than the raw Last Traded Price.

📐 Mark Price Derivation Pipeline
[External Spot Oracles] ➔ [Index Price] ➔ [Median Filtering with EMA & Impact Mid] ➔ [Mark Price]
        │                       │                                │                           │
    Pyth, Binance,           Volume-Weighted            Clamped bounds to prevent      Applied for Margin
    Coinbase Feeds           Aggregation                flash manipulations            & Liquidations

Mark Price Calculation Formula:

Mark Price = Median(Oracle Index Price, Last Trade Price, Order Book Impact Mid Price)

The Impact Mid Price calculates the average execution price of a standardized notionally significant order size ($10,000 USD equivalent) on the native order book, ensuring that single small trades cannot artificially distort mark valuations.

3. Funding Rate Mechanism

Because perpetual contracts have no fixed expiration date, a continuous Funding Rate mechanism (official documentation) anchors the perpetual market price to the external spot index price. Payments occur peer-to-peer between long and short position holders without protocol extraction.

Market State Funding Rate Sign Cash Flow Direction
Perp Price > Spot Index (Bullish Premium) Positive (+) Long position holders pay Short position holders
Perp Price < Spot Index (Bearish Discount) Negative (-) Short position holders pay Long position holders

Funding rate payments accrue continuously and settle dynamically on an hourly cadence, derived from the 8-hour exponentially weighted premium index.

4. Margin Modes: Cross vs. Isolated

Cross Margin (Default) — see margin docs
All available USDC account collateral is shared across all open perpetual positions. Profits from one winning position offset unrealized losses on another, maximizing capital flexibility and preventing isolated liquidations.
Isolated Margin
Collateral is allocated strictly to an individual position. Maximum loss is strictly capped to the dedicated margin assigned to that specific trade, isolating the remainder of the user’s account equity from liquidation risk.

5. Liquidation Engine & Backstop Protocol

A position enters liquidation when account equity falls below the mandatory Maintenance Margin Requirement (MMR) (liquidation mechanics).

  1. Margin Warning Check: When Account Margin Ratio < Maintenance Margin Threshold, the position becomes eligible for deterministic liquidation.
  2. Liquidation Execution via HLP: The protocol matching engine takes over the at-risk position. The position is liquidated directly against available order book depth or absorbed by the HLP (Hyperliquidity Provider) Vault backstop mechanism.
  3. Auto-Deleveraging (ADL) Protocol: In rare catastrophic market events where mark prices gap past bankruptcy prices before HLP absorption, the ADL algorithm orderly closes the highest-leveraged, most profitable counterparty positions to guarantee full protocol solvency without socialized debt.

🔗 Official External References & Primary Sources

To verify the facts, technical formulas, and architectural parameters presented in this article, consult the following primary sources and official documentation: