> For the complete documentation index, see [llms.txt](https://nx-finance.gitbook.io/nx-finance-whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nx-finance.gitbook.io/nx-finance-whitepaper/protocol-mechanism/health-factor.md).

# Health Factor

## What is Health Factor?

It is an index that indicates the risk level of your position according to the current token price.

## Three levels of Health Factor

**Red:** Your position is currently at high risk, approaching the liquidation threshold. You can withdraw your collateral now; however, some of it will be used to repay the lending pool. Immediate action is recommended to prevent significant losses.

**Yellow:** The risk level of your position is moderate. It is crucial to closely monitor market conditions and be prepared to take prompt action to mitigate potential losses.

**Green:** Your position is secure, with ample margin before reaching the liquidation point. While immediate concern is minimal, continued vigilance is advised.

| **Health Factor** | **Index**       |
| ----------------- | --------------- |
| Red               | X < 1.15        |
| Yellow            | 1.15 < X < 1.25 |
| Green             | 1.25 < X        |

## Equation of Health Factor

$$
Health Factor = \frac{(Collateral Value + Leverage Value)}{Loan Value}
$$

## Equation of Liquidation Threshhold

$$
\frac{1}{Health Factor} >0.95
$$
