# Health Factor

Some users have complicated portfolios that contain multiple collateral assets in different currencies, and potentially multiple debts in other currencies.

This makes calculating a max LTV complicated and hard for users to interpret. For this reason, we use a more general metric called the health factor that is easy to interpret for all portfolios.

The health factor gives an approximate sense of how close an account is to liquidation. Every account's health factor is between 1 and 10. The closer it is to 10, the healthier it is. The closer it is to 1, the closer it is to liquidation.

The health factor is defined as an account's collateral value after all risk adjustments divided by its net asset value before any risk adjustments scaled to sit between 1 and 10. An account's collateral value after all risk adjustments is called its free collateral.

$Health Factor = 1 + (freeCollateral / netAssetValue) * 9$

### Example calculations

Here are some example health factor calculations for different multi-currency portfolios.

Example 1: nETH + Prime wBTC collateral vs. Prime USDC debt

// Account portfolio details

ETH collateral: 2,000 USDC worth of nETH
wBTC collateral: 1,000 USDC worth prime wBTC
Debt: 1,000 USDC of Prime USDC
ETH collateral factor: 0.8
wBTC collateral factor: 0.8
USDC borrow factor: 1.1
nETH collateral haircut: 0.15
Prime wBTC collateral haircut: 0
Prime USDC borrow buffer: 0

Risk-adjusted USDC loan value = 1,000 * 1.1 = 1,100
Risk-adjusted ETH collateral value = 2,000 * (1 - 0.15) * 0.8 = 1,360
Risk-adjusted wBTC collateral value = 1,000 * 0.8 = 800

// Calculating health factor

Free collateral = 1,360 + 800 - 1,100 = 1,060
Net asset value = 2,000 + 1,000 - 1000 = 2,000
Health factor = 1,060 / 2,000 = 1 + (0.53 * 9) = 5.77

#### Example 2: nETH collateral vs. Prime USDC + Prime DAI debt

// Account portfolio details

Collateral: 2,500 USDC worth of nETH
USDC debt: 1,000 USDC of Prime USDC
DAI debt: 500 USDC worth of Prime DAI
Collateral factor: 0.8
USDC borrow factor: 1.1
DAI borrow factor: 1.1
nETH collateral haircut: 0.15
Prime USDC borrow buffer: 0
Prime DAI borrow buffer:

Health factor = 50 / 1,000 = 1 + (0.05 * 9) = 1.45