# liquidation Fee

## 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&#x26;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
* [x] validateLiquidationCall
* [x] getConfigurationData
* [x] calculateAvailableCollateralToLiquidate
* [x] <mark style="color:orange;">setBorrowing</mark>
* [x] <mark style="color:orange;">setUsingAsCollateral</mark>
* [x] \_burnDebtTokens
* [x] <mark style="color:orange;">updateInterestRates</mark>
* [x] <mark style="color:orange;">updateIsolatedDebtIfIsolated</mark>
* [x] liquidate/burn collateral
* [ ] liquidation fee
* [ ] Wrap-up

## Liquidation fee

Liquidation fee is taken from the user and transferred to treasury.

<figure><img src="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2FylmSLGrn6fdf0tq9uluS%2Fimage.png?alt=media&#x26;token=81464bd1-ec6f-4fce-b4df-3ad3a0e92261" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2FO29QNxmiRKGTYc0nE5L6%2Fimage.png?alt=media&#x26;token=78b7cbbf-c1ff-4630-be16-bcc22d35d309" alt=""><figcaption><p>AToken.sol</p></figcaption></figure>

<figure><img src="https://1829638638-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0k7YXwFGMFZcsyqkM4q1%2Fuploads%2FhIJTHmNLP7JCzh4lcxCL%2Fimage.png?alt=media&#x26;token=6a314f35-1498-4b3c-b58c-276463b94170" alt=""><figcaption><p>AToken.sol</p></figcaption></figure>

* ATokens are transferred to the treasury as liquidation fee.&#x20;
* validate is set to false, so no HF check is done.
