Skip to main content

Overview

Drift Protocol uses a cross-margined system where all collateral is shared across positions. Margin requirements are calculated based on position size, asset volatility, and market conditions.

Margin Types

  • Initial Margin - Required to open a new position
  • Maintenance Margin - Minimum margin to keep position open
  • Free Collateral - Available collateral for new positions

Initial Margin Calculation

The margin required to open a trade is calculated based on the position’s notional value:

Formula

Example

Liability Value Calculation

For standard perpetuals:
For prediction markets, short positions have different liability calculations based on the max price.

Oracle Price for Margin

Margin calculations use conservative oracle prices with offsets:

Size-Based IMF Adjustments

Margin requirements scale with position size using the Initial Margin Fraction (IMF):

Liability Weight (for shorts/liabilities)

Asset Weight (for longs/assets)

Larger positions require more margin due to:
  • Increased liquidation risk
  • Greater market impact
  • Reduced liquidity for larger sizes

Collateral Requirements

Calculate how much collateral is needed for a trade:

Example: Calculate SOL Collateral Needed

Liquidation Price

Calculate the price at which a position would be liquidated:

Example

High Leverage Mode

High leverage mode provides lower margin requirements:
High leverage mode increases liquidation risk. Use with caution.

Worst Case Position

Margin calculations consider open orders (worst case scenario):

Practical Examples

Check if User Can Open Position

Calculate Maximum Position Size