Margin and Leverage

Understanding Margin, Leverage, and Liquidation.

IMPORTANT NOTE: Currently, all [XYZ] Markets are Isolated-Only Hyperliquid markets. This means you cannot remove margin from an open [XYZ] position.

Trading with leverage means you can amplify gains and losses, so understanding margin is critical. Our margin and leverage logic are provided by Hyperliquid as a HIP-3 DEX. As such, while we provide a general summary of these mechanics below, you should review Hyperliquid's documentation related to margining and leverage:

  • Margin Mode: A default margin mode is selected when opening any position. For Hyperliquid perps, cross margin is the default.

    • Cross Margin: For Hyperliquid perps, cross margin is the default. This allows for maximal capital efficiency by sharing collateral between other cross margin positions but also means that liquidations in that asset may effect other cross positions.

    • Isolated Margin. Isolated margin allows an asset's collateral to be constrained to that asset. This prevents liquidations in that asset from affecting other isolated positions or cross positions. It also ensures that position is not affected by other cross liquidations or isolated liquidations.

    • Isolated-Only. Some assets are isolated-only, which are the same as isolated margin, but with an additional constraint that margin cannot be removed. In isolated-only markets, margin is proportionally removed as the position is closed.

  • Initial Margin: Initial Margin is the collateral required to open a position. The margin required to open a perps position is based on position_size * mark_price / leverage.

  • Maintenance Margin: Maintenance Margin is the minimum collateral you must keep to avoid liquidation. If your account equity (collateral + PnL) falls below the maintenance level, you'll be liquidated. The maintenance level is currently determined by multiplying the maintenance margin by the total open notional position. Currently, the maintenance margin is set to half of the initial margin at max leverage for that asset, which varies from 3-40x. In other words, the maintenance margin ranges from 1.25% (at 40x max leverage) to 16.7 (at 3x max leverage).

  • Leverage limits: Each Hyperliquid market has a maximum leverage. The interface and protocol will not let you exceed the max leverage for that market. These specifics are set by the deployer of an asset and will be communicated in the interface where applicable. Currently, all XYZ markets are capped at 20x leverage.

  • Liquidation process: If your Margin Ratio (collateral versus required margin) falls too low (i.e., losses have eaten too much of your collateral), your position will be liquidated. See Liquidations and Auto-Deleveraging for more.


[1] NTD: Don’t think this is true, confirm.

Last updated

Was this helpful?