# Liquidation

### Liquitable Account

An account becomes eligible for liquidation whenever **either** of the following metrics breaches the market’s **liquidation threshold**.

$$
Risk Ratio = \frac{\sum\_{i}{f\_i\cdot abs(S\_i -B\_i)}}{S -B}
$$

$$
Leverage = \frac{S}{S -B}
$$

> Liquidation thresholds : `LiquidationRiskRatio` and `LiquidationLeverage` are set at the market level.

To reduce **Risk Ratio**, a user can lower exposure to higher-risk assets.

To reduce **Leverage**, repaying a portion of the debt is most effective.

At high leverage, both metrics become more sensitive to price swings, so proactive management is critical.

### Liquidation Process

1. **Continuous Monitoring**

   Constantly tracks each account’s Risk Ratio and Leverage, flagging any position that approaches liquidation thresholds
2. **Action Preparation**

   When a liquitable account is detected, liquidators (or automated bots) prepare to intervene, selecting the debt portion to be repaid and the collateral asset to seize
3. **Execution**

   The liquidator submits a transaction to repay part of the borrower’s outstanding debt. The repayment amount is capped by `liquidationCloseRatio`, ensuring only a limited slice of the position can be liquidated in a single event
4. **Collateral Seizure**

   In return, the liquidator claims the chosen collateral, receiving an extra incentive defined by `liquidationBonus`

### Key Parameters

<table><thead><tr><th width="216">Parameter</th><th width="101">Scope</th><th>Purpose</th></tr></thead><tbody><tr><td><strong>Liquidation Close Ratio</strong></td><td>Market</td><td>Caps how much of a position can be liquidated in a single transaction, protecting borrowers from full liquidation at once.</td></tr><tr><td><strong>Liquidation Bonus</strong></td><td>Asset</td><td>Percentage premium awarded to liquidators, incentivizing fast action and maintaining market health.</td></tr></tbody></table>


---

# 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.affluent.org/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.
