The health of the Aave Protocol is dependant on the 'health' of the loans within the system, also known as the 'health factor'. When the 'health factor' of an account's total loans is below 1, anyone can make a [liquidationCall()](notion://www.notion.so/developers/the-core-protocol/lendingpool#liquidationcall)
to the LendingPool
contract, paying back part of the debt owed and receiving discounted collateral in return (also known as the liquidation bonus as listed here).
This incentivises third parties to participate in the health of the overall protocol, by acting in their own interest (to receive the discounted collateral) and as a result, ensure loans are sufficiently collateralised.
There are multiple ways to participate in liquidations:
[liquidationCall()](notion://www.notion.so/developers/the-core-protocol/lendingpool#liquidationcall)
directly in the LendingPool contract.For liquidation calls to be profitable, you must take into account the gas cost involved in liquidating the loan. If a high gas price is used, then the liquidation may be unprofitable for you. See the 'Calculating profitability vs gas cost' section for more details.
When making a liquidationCall()
, you must:
user
) whose health factor is below 1.debtToCover
) and debt asset (debt
) that can be paid.
liquidationCall()
.debtToCover
to uint(-1)
and the protocol will proceed with the highest possible liquidation allowed by the close factor.liquidationCall()
to pay back the debts.collateral
) you are closing. I.e. the collateral asset that the user has 'backing' their outstanding loan that you will partly receive as a 'bonus'.receiveAToken
) after a successful liquidationCall()
.Only user accounts that have a health factor below 1 can be liquidated. There are multiple ways you can get the health factor, with most of them involving 'user account data'.
"Users" in the Aave Protocol refer to a single ethereum address that has interacted with the protocol. This can be an externally owned account or contract.
[getUserAccountData()](notion://www.notion.so/developers/the-core-protocol/lendingpool#getuseraccountdata)
to read the user's current healthFactor
. If the healthFactor
is below 1, then the account can be liquidated.