# Liquidation

## How liquidation works?

<figure><img src="/files/XVrO1t65TP7V7rVNJgeR" alt=""><figcaption></figcaption></figure>

Your **Borrow Balance** and **Supply Balance** are tracked using real-time data from decentralized oracles like **Pyth**, which are then used to calculate & monitoring your risk of liquidation.

The system visualizes your position through a graph showing:

1. **Borrow Limit Used**: The amount of your total borrowing capacity that you have used.
2. **Safe Borrow Limit**: The threshold below which your position is safe from liquidation. This is calculated based on the weighted average of the Loan-to-Value (LTV) ratios of your supplied assets.
3. **Liquidation Limit**: The critical level, shown as a line on the graph, beyond which your position is at risk of liquidation.

If your **Borrow Limit Used** surpasses the **Safe Borrow Limit**, borrowing beyond this point is blocked to avoid liquidation risk. If your position exceeds the **Liquidation Limit**, your account is eligible for liquidation.

When liquidation occurs:

* **Third-party liquidators** can repay **20%** of your outstanding loan by selling an equivalent amount of collateral.
* Liquidators are also rewarded with a **3% bonus** on the amount they liquidate, incentivizing them to help maintain protocol health.

## Liquidation Example

Imagine Alice deposits $12,000 worth of USDC as collateral and borrows $8,400 in ETH. Later, the value of ETH increases, pushing the total borrowed value to $9,000. Since her borrow now exceeds the safe collateral threshold, her position becomes eligible for liquidation.

A liquidator steps in and repays 20% of Alice’s ETH debt — that’s **$1,800**. In return, the liquidator receives $1,800 worth of Alice’s USDC collateral **plus a 3% bonus**, totaling **$1,854** in USDC.

After this partial liquidation:

* Alice’s USDC collateral is reduced by **$1,854**, leaving her with **$10,146** remaining.
* Her ETH borrow is reduced by **$1,800**, lowering it to **$7,200**.
* The liquidator pays $1,800 in ETH and receives $1,854 in USDC, earning a **$54 profit**.

Following the liquidation, Alice’s health factor improves, giving her more room before hitting the liquidation threshold again.


---

# 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.alphafi.xyz/alphalend/security/liquidation.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.
