> For the complete documentation index, see [llms.txt](https://docs.alphafi.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.alphafi.xyz/old-doc/security/liquidation.md).

# Liquidation

## How liquidation works?

<figure><img src="https://content.gitbook.com/content/wPwnxap9BEJ7YQDLsDOs/blobs/GDN9jjBkizuQfIvtAMxw/image.png" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.alphafi.xyz/old-doc/security/liquidation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
