Margin

Margin is the collateral required to open perp contracts.

Margin Mode

By default, positions are cross margined and access account equity. In cross margin mode, unrealized PnL is available as initial margin for new positions.

Users can select isolated margin for precise control. Unrealized PnL in isolated positions is used as additional margin for the open contract. At any time, margin can be added or removed from isolated positions within the bounds of the initial margin and account equity. Isolated margin liquidations do not affect other positions.

Margin Requirements

Leverage can be set by a user between 1 and the max leverage. Max leverage depends on the asset. The leverage of an existing position can be increased without closing the position, decreasing the initial margin requirement (IMR).

The margin required to open a position or create an order is the dollarized position size divided by the leverage. Margin supporting open orders cannot be withdrawn.

Positions will be liquidated when isolated margin or account equity is less than the maintenance margin requirement (MMR).

Supported Collateral

Account equity is the sum of collateral value, PnL, and net funding. Users can add margin by depositing supported collateral, including USDC, USDT, WETH, and WBTC. All collateral adds margin at face value. Volatile Asset Collateral, such as WETH and WBTC, is dynamic according to the mark price.

For example, a user deposits 1 Bitcoin when $BTC = $100,000, so they have $100,000 margin. If $BTC increases to $110,000, then margin updates proportionally to $110,000. Within margin accounts, this enables capital efficient funding arbitrage and delta-neutral hedging.

In cases of profit and positive yield, USD-denominated state is added. In cases of loss, USD-denominated state is subtracted, but the underlying VAC is not converted until withdrawal or liquidation. This means that if losses are reversed, the principle VAC is untouched.

Formulas

Margin Requirements

Variables

  • s = position size

  • p = entry price

  • p' = liquidation price

Formulas

Initial Margin Fraction (IMF) = 1/leverage Maintenance Margin Fraction (MMF) = IMF(max_leverage)/2

Initial Margin Requirement (IMR) = |s| * p * IMF Isolated Maintenance Margin Requirement (MMR) = |s| * p * MMF

MMR for Other Positions (MMR_o) = ∑(|s| * p * MMF) Cross Maintenance Margin Requirement = MMR_o + |s| * p' * MMF

Last updated