> 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="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2Fv1eFIDfMZBGmuKTeA6eH%2Fimage.png?alt=media&amp;token=8226c766-002d-4162-bc86-12350dedde39" 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="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2FJuitLpz5cq6pGKmtt7dX%2Fimage.png?alt=media&amp;token=28ffb230-939e-4e20-bb69-d65aaf764d09" alt=""><figcaption></figcaption></figure>

<img src="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2F9elfel2UWEbtTxi3ElTG%2Ffile.excalidraw.svg?alt=media&amp;token=194361bd-f6b0-4124-8301-b0a140cdafbe" 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 %}
