Documentation
SocialsStatisticsLaunch App
  • Welcome to Mars Protocol
  • Getting Started
    • How to set up a Wallet
    • Connect your wallet
    • Using a Credit Account
  • Credit Accounts
  • Perpetual Futures (Perps)
    • Perps Vault (Counterparty Vault)
    • Funding Rate Mechanism
    • Price Impact
    • Open Interest Caps
    • Vault Solvency Protection
    • Health Factor
    • Liquidations
  • Spot & Margin Trading
  • Lending & Borrowing
  • Leveraged Yield Farming
  • High Leverage Strategies
  • Managed Vaults
    • Creating a Vault
      • How to Resume Vault Creation After Failed Transaction
    • Managing a Vault
    • Depositing into Vault
  • Risk Methodology
    • Asset Listing
    • Protocol Risk Framework
    • Perps Risk Framework
      • Maximum Leverage & LTVs
      • SkewScale
      • Open Interest Caps
      • Maximum Funding Velocity
      • Mitigating Risks of Static Parameters
    • Deposit Caps Risk Framework
  • Governance
    • MARS Token
  • Smart Contracts
    • Address Provider
    • Account NFT
    • Credit Manager
    • Health
    • Incentives
    • Oracle
    • Params
    • Red Bank
    • Rewards Collector
    • Swapper
    • Zapper
    • Perps
  • Brand kit
    • The Mars Brand
  • Legal
    • Mars FUD Bible
    • Terms of Service
    • Privacy Policy
    • Cookie Policy
Powered by GitBook
On this page
  • Long Position Health Factor
  • Short Position Health Factor
  • Component Defintions
  • Multiple Perp Positions
  • Health Factor Interpretation
  • Risk Management Through Health Factor
  • Example of Health Factor Calculation
Edit on GitHub
Export as PDF
  1. Perpetual Futures (Perps)

Health Factor

The health factor is a critical risk metric that determines whether a trading account remains solvent and above liquidation thresholds.

The health factor computation varies depending on whether the account holds long or short perpetual positions, as each direction presents different risk profiles. The formula incorporates risk-weighted assets, position values, funding payments, and safety margins through closing fees to provide a comprehensive assessment of account solvency.

Long Position Health Factor

For accounts holding a single long perpetual position, the health factor is calculated as:

HF=RWA+P×(LTVp−ϕc)+f$+×LTVpD+P0+f$−HF = \frac{RWA + P \times (LTV_p - \phi_c) + f_{\$}^+ \times LTV_p}{D + P_0 + f_{\$}^-}HF=D+P0​+f$−​RWA+P×(LTVp​−ϕc​)+f$+​×LTVp​​

Short Position Health Factor

For accounts holding a single short perpetual position, the health factor is calculated as:

HF=RWA+P0+f$+×LTVpD+P×(2−LTVp+ϕc)+f$−HF = \frac{RWA + P_0 + f_{\$}^+ \times LTV_p}{D + P \times (2 - LTV_p + \phi_c) + f_{\$}^-}HF=D+P×(2−LTVp​+ϕc​)+f$−​RWA+P0​+f$+​×LTVp​​

Component Defintions

  • RWARWARWA (Risk-Weighted Assets): The value of all collateral assets other than the perpetual position, weighted by their respective loan-to-value ratios

  • DDD : Total borrowings excluding the perpetual position being evaluated

  • LTVpLTV_pLTVp​: The loan-to-value parameter specific to perpetual positions, determining leverage

  • ϕc\phi_cϕc​: The closing fee percentage

  • P0P_0P0​: The notional value of the position when it was opened, calculated as |q| × p_{ex,0}

  • PPP: The current notional value of the position, calculated as |q| × p_{ex}

  • : Positive funding payments owed to the position holder (added to assets)

  • : Negative funding payments owed by the position holder (added to liabilities)

Multiple Perp Positions

In cases where an account holds multiple perpetual positions across different markets, the health factor is computed similarly by aggregating the corresponding numerator and denominator components from each position. Each perpetual position contributes its respective terms based on whether it is long or short, with all components summed together to calculate the overall account health factor.

Health Factor Interpretation

The health factor provides clear guidance on account status:

  • HF ≥ 1.0: Account is healthy and above liquidation threshold

  • HF < 1.0: Account is subject to liquidation to protect system solvency

  • Higher values: Indicate greater safety margins and ability to withstand adverse price movements

  • Values approaching 1.0: Signal increasing risk and potential need for additional collateral

Risk Management Through Health Factor

The health factor serves multiple risk management functions:

  1. Position Sizing: Maximum position sizes are determined by ensuring health factor remains above 1.0

  2. Liquidation Trigger: Automatic liquidation begins when health factor drops below 1.0

  3. Real-time Monitoring: Continuous calculation allows traders to monitor their risk exposure

Example of Health Factor Calculation

Consider a trader with the following account composition:

  • $50,000 USDC collateral (Liquidation LTV for USDC = 92%)

  • $20,000 in other risk-weighted assets

  • $10,000 total debt

  • 10 ETH long position opened at $2,000 per ETH

  • Current ETH price: $2,200

  • Perpetual LTV: 90%

  • Closing fee: 0.075%

  • Accumulated funding: +$100 (positive, owed to trader)

Calculations:

  • RWA = $50,000 × 0.92 + $20,000 = $66,000

  • P₀ = 10 × $2,000 = $20,000

  • P = 10 × $2,200 = $22,000

  • f₊ = $100, f₋ = $0

HF=66,000+22,000×(0.90−0.00075)+100×0.9010,000+20,000+0=2.86HF = \frac{66,000 + 22,000 \times (0.90 - 0.00075) + 100 \times 0.90}{10,000 + 20,000 + 0}=2.86HF=10,000+20,000+066,000+22,000×(0.90−0.00075)+100×0.90​=2.86

This health factor of 2.86 indicates a well-collateralized position with significant safety margin before liquidation.

Last updated 4 days ago