# Liquidation

## **Overview**&#x20;

Elara Protocol facilitates secure overcollateralized lending, ensuring that a borrower's collateral value always exceeds their borrowed balance. This mechanism is crucial for protecting the protocol and its lenders from potential losses. While Elara is designed to minimize liquidations, extreme market conditions may lead to scenarios where a borrower's position becomes undercollateralized, triggering the liquidation process.

## **Liquidation Mechanics**

ElaraLend's liquidation process is inspired by [Compound V2](https://compound.finance). Accounts become eligible for liquidation when their overall health factor falls below 1, indicating that the total value of collateral no longer adequately covers the borrowed amount.

## **Liquidation Process**

1. **Liquidation Trigger:** When an account's health factor drops below 1, it becomes eligible for liquidation.
2. **Liquidator Action**: Third-party liquidators, often automated bots, can repay a portion of the borrower's debt and receive the corresponding collateral at a slight discount.
3. **Collateral Seizure**: The liquidator receives the discounted collateral, with a small portion directed to Elara's Insurance Fund.
4. **Cross-Pool Handling**: For cross-pool borrowing, the liquidation process automatically manages the settlement across different pools.

## **Liquidation Function**&#x20;

Liquidators initiate the process by calling the `liquidateBorrow` function on the relevant Elara token contract.

## **Risk Mitigation and Protocol Stability**&#x20;

Elara implements several measures to maintain protocol stability and minimize bad debt:

1. Real-time Monitoring: Continuous tracking of account health factors.
2. Gradual Liquidation: Allows for partial liquidations to avoid market impact.
3. Price Oracle Safeguards: Implements upper bounds for asset prices, particularly for stablecoins and LSTs, to prevent manipulation.

## **Bad Debt Handling**&#x20;

In rare cases of extreme market volatility, bad debt may accrue if an account's collateral value falls dramatically before liquidation can occur. Elara's approach to bad debt:

1. Insurance Fund: Primary mechanism for covering any accrued bad debt.
2. Pool Isolation: The two-layer structure helps contain risks within specific pools.
3. Withdrawal Limitations: In extreme scenarios, temporary restrictions on asset withdrawals may be implemented to protect the protocol's overall health.

## **Liquidation Incentives**&#x20;

To ensure timely liquidations, Elara offers a liquidation bonus to incentivize liquidators. This bonus varies based on the asset type and current market conditions.


---

# 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://learn.elara.finance/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.
