# Health factor

We compare the total current debt of the token with underlying loans current value and collateral(s) to determine the health.

$$
Hf = \frac{C\_{cv} + LA\_{cv}}{L\_{net}}
$$

where,

$$Hf =$$ Health factor

$$C\_{cv} =$$ Collateral current value in USD

$$LA\_{cv} =$$ Loan account current value in USD

$$L\_{net} =$$ Net liabilities (Original loan + interest) in USD

Note: For on-chain computations, we use USDT as base value to compute values.

Health is monitored at two levels:

1. dToken level: Determines the total health of the protocol for this asset
2. user loan level: Determines health of a user’s individual loan

### **dToken health:**

$$L\_{net} =$$ total value of the debt issued by the contract across the protocol

&#x20;$$C\_{cv} = \Sigma\_{1}^{n} C\_{icv},$$ n is the total number of supported collaterals, $$C\_{icv}$$ is the net value of the ith collateral locked.

$$LA\_{cv}$$ unspent loan amounts + Sum (spent loan amounts)

### **User loan health:**

For the above loan discussed, the health factor can be computed as below:

1. **Before partial withdrawl**

   * $$C\_{cv} =$$ 1 ETH \* 100 = 100
   * $$LA\_{cv} =$$ 300 USDC = 300
   * Assuming an interest of 2 USDC accrued,

     $$ $L\_{net} =$ $$ 300 + 2 USDC = 302

So, Health factor $$(Hf) =$$ (100 + 300)/302 = **1.32**

***

2. **Post spend**

$$LA\_{cv}$$ = 3 ETH x $100 = $300

So, Health factor $$(Hf) =$$ (100 + 300)/302 = **1.32**

**Health factor determines if a loan can be liquidated. Read Liquidations for more info.**


---

# 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://docs.hashstack.finance/developers/supply-and-borrow/borrow/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.
