> For the complete documentation index, see [llms.txt](https://calnix.gitbook.io/aave-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calnix.gitbook.io/aave-book/functions/liquidate/validateliquidationcall.md).

# validateLiquidationCall

## Overview

<figure><img src="/files/0ccGoRTL5H2XZUoohcTt" alt=""><figcaption></figcaption></figure>

### Execution flow

* [x] <mark style="color:orange;">cache + updateState + get health factor</mark>
* [x] \_calculateDebt
* [ ] validateLiquidationCall
* [ ] getConfigurationData
* [ ] calculateAvailableCollateralToLiquidate
* [ ] <mark style="color:orange;">setBorrowing</mark>
* [ ] <mark style="color:orange;">setUsingAsCollateral</mark>
* [ ] \_burnDebtTokens
* [ ] <mark style="color:orange;">updateInterestRates</mark>
* [ ] <mark style="color:orange;">updateIsolatedDebtIfIsolated</mark>
* [ ] liquidate/burn collateral
* [ ] liquidation fee
* [ ] Wrap-up

## validateLiquidationCall

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

<img src="/files/qovIddMrGJLwKwanJjAl" alt="" class="gitbook-drawing">

A valid liquidationCall must fulfil the following criteria:

* Status flags for both collateral and borrow asset must be ACTIVE and NOT PAUSED
* L2 check
* Ensure user's health factor < 1
* Collateral check
  * check that liquidation threshold is non-zero
  * confirm that user is using the collateral: `isUsingAsCollateral`

Since the liquidator can claim a single collateral of choice - we need to check the collateral address passed to ensure that it is indeed a valid selection. Else we might liquidate an asset that was not marked as collateral.

{% hint style="info" %}
**Liquidation threshold**&#x20;

* is the percentage at which a loan is defined as under-collateralized.
* usually no more than 10-15% above LTV.

For example, a liquidation threshold of 80% means that if the loan value rises above 80% of the collateral, the loan could be liquidated.

If the loan reaches the liquidation threshold, Aave prevents a user from borrowing and the user must either partially close their position or provide more collateral.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://calnix.gitbook.io/aave-book/functions/liquidate/validateliquidationcall.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
