# Liquidations

## Liquidations

Liquidations are an integral part of a DeFi money market, they help to maintain the health of the protocol. Whilst different protocols may use slightly different mechanisms, they mostly follow the same principals; a *Liquidator* repays the borrowers liabilities in exchange for the borrowers collateral at a discount.

Hyperdrive supports multiple markets where each accounts position in a specific market is isolated from all other markets.

## Terminology

In order to understand how the liquidation works, you need to understand the following terminology.

#### Liabilities <a href="#liabilities" id="liabilities"></a>

The *Liabilities* is the total debt that you have owing to the protocol. This is simply the amount that have you borrowed plus any unpaid interest that has accrued on your position. A small amount of interest is accrued on your *Liabilities* every second.

#### Loan to Value (LTV)

The Loan to Value ratio is a measure of how much you can borrow relative to the value of your supplied collateral.

#### Liquidation Loan to Value (LLTV)

The Liquidation Loan to Value is the maximum Loan-to-Value (LTV) ratio you can reach before your position becomes eligible for liquidation.

#### Borrow Limit <a href="#borrow-limit" id="borrow-limit"></a>

The *Borrow Limit* is the maximum amount that the protocol will lend. The *Borrow Limit* is calculated based on the collateral that you have supplied to each individual market. Each collateral asset that can be supplied to the protocol has a Maximum Loan-To-Value (LTV) ratio defined for it based on its risk analysis.

For example, if BTC was worth 20,000 USD and it had an LTV of 70%, then for each BTC you supplied to the protocol, you would be able to borrow a maximum of 14,000 USDT. Your overall borrowing limit is therefore the summation of everything you have supplied multiplied by its LTV.

```
Borrow Limit = SUM(Assets x LTV)
```

#### Liquidation Limit <a href="#health-score" id="health-score"></a>

The Liquidation Limit is the maximum amount of liabilities that an account is allowed to accrue within a market before the position being considered unhealth and subject to liquidation.

#### Health Score <a href="#health-score" id="health-score"></a>

Within the Hyperdrive protocol, a borrowers position is measured by its *Health Score*. The *Health Score* is a number between 0 and 1000 and is calculated as;

```
Health Score = Liquidation Limit / Liabilities
```

When your *Health Score* drops below 100 you are then exposed to the risk of being liquidated. It is therefore vital that you pay attention to your *Health Score* and when it gets too low, start to repay your liabilities or add more collateral to the market.

#### Liquidation Discount <a href="#liquidation-discount" id="liquidation-discount"></a>

When a *Liquidator* liquidates a borrowers position, there is an economic cost to doing so. In order to make the liquidation process economically viable, the liquidator will receive more of your collateral in USD terms than the value that they paid towards your liabilies. This difference is defined as the *Liquidation Discount* and is a discount that is applied to the price of the asset at the time of the liquidation.

For example, if BTC was worth 20,000 and it had a Liquidation Discount of 10%, the liquidator would effectively be able to "buy" your BTC at 18,000 per BTC, therefore making a 10% profit for performing the liquidation.

### Practical Examples <a href="#practical-examples" id="practical-examples"></a>

For the scenarios we will assume the following asset configuration.

| Asset | Price  | LLTV | Liquidation Discount |
| ----- | ------ | ---- | -------------------- |
| BTC   | 20,000 | 80%  | 10%                  |
| ETH   | 1,000  | 70%  | 10%                  |
| HYPE  | 2      | 50%  | 10%                  |

#### Scenario 1 <a href="#scenario-1" id="scenario-1"></a>

Alice has the following portfolio.

| Asset     | Supply | Total Value | Borrow Limit |
| --------- | ------ | ----------- | ------------ |
| BTC       | 1      | 20,000      | 16,000       |
| **TOTAL** |        | **20,000**  | **16,000**   |

She has borrowed against her position and her liabilities are now 16,001 taking her position to an unhealty state with a health score of 99. The *Liquidator* chooses to pay 50% of her liabilities, or 8,000 in total. In exchange for paying 8,000 off her liabilties, the *Liquidator* will receive 0.4444\~ BTC in return.

```
BTC = Repayment / (Price - Discount)BTC = 8,000 / (20,000 - 10%)BTC = 8,000 / 18,000BTC = 0.4444~
```

Alice's portfolio now looks like this.

| Asset     | Supply | Total Value | Borrow Limit |
| --------- | ------ | ----------- | ------------ |
| BTC       | 0.5556 | 11,112      | 8,889        |
| **TOTAL** |        | **11,112**  | **8,889**    |

More importantly, Alice's liabilites are now 8,000 and her *Health Score* has been returned to 112.

#### Scenario 2 <a href="#scenario-2" id="scenario-2"></a>

Bob has the following portfolio.

| Asset     | Supply | Total Value | Borrow Limit |
| --------- | ------ | ----------- | ------------ |
| BTC       | 0.1    | 2,000       | 1,600        |
| ETH       | 3      | 3,000       | 2,100        |
| HYPE      | 2000   | 4,000       | 2,000        |
| **TOTAL** |        | **9,000**   | **5,700**    |

He has borrowed against his position and his liabilities are now 5,701 taking his position to an unhealty state with a health score of 99. The *Liquidator* chooses to pay 50% of his liabilities, or 2,850 in total. In exchange for paying 2,850 off her liabilties, the *Liquidator* will receive 3 ETH in return. In this case however, the Liquidator would only end up paying 2,700 towards the liabilties.

```
ETH = Repayment / (Price - Discount)ETH = 2,850 / (1,000 - 10%)ETH = 2,850 / 900ETH = 3.166~
```

In this scenario, if the Liquidator paid 2,850 towards the position, it would need 3.166 ETH in return, however, thats more than what Bob has in his portfolio. Therefore, the liquidator ends up paying less towards the liabilties.

```
Repayment = MIN(3, 3.166) * (Price - Discount)Repayment = 3 * (1,000 - 10%)Repayment = 3 * 900Repayment = 2,700
```

Bob's portfolio now looks like this.

| Asset     | Supply | Total Value | Borrow Limit |
| --------- | ------ | ----------- | ------------ |
| BTC       | 0.1    | 2,000       | 1,600        |
| ETH       | 0      | 0           | 0            |
| HYPE      | 2000   | 4,000       | 2,000        |
| **TOTAL** |        | **6,000**   | **3,600**    |

More importantly, Bob's liabilites are now 3,001 and his *Health Score* has been returned to 119.


---

# 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://hyperdrive-2.gitbook.io/hyperdrive/borrowing/liquidations.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.
