# 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
$$


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nx-finance.gitbook.io/nx-finance-whitepaper/protocol-mechanism/health-factor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
