liquidate

liquidationCall()

Overview

This function is called by liquidators to liquidate "bad loans". Accounts with a health factor of less than 1 are eligible for liquidation.

Assuming user's healthFactor < 1:

  • if healthFactor > 0.95 => close factor set to 50%

  • if healthFactor <= 0.95 => close factor set to 100%

Liquidators are awarded with liquidation bonus, which can be paid in ATokens or the underlying asset as well.

  • user’s health factor: 0.95<hf<10.95 < hf < 1, the loan is eligible for a liquidation of 50%.

  • user’s health factor: hf<=0.95hf <= 0.95 , the loan is eligible for a liquidation of 100%.

Drawing
  • executeLiquidationCall contains the core logics

executeLiquidationCall

Execution flow

We will breakdown and examine the unique sections of logics within executeLiquidationCall. Code delineated in orange are common functions and can be explored in that section.

Visual Aid

Last updated