Liquidation process in LendingPool
consists in 2 steps: initiateLiquidation
where a liquidationStartTime
counter is started and, after liquidationGracePeriod
has expired, finalizeLiquidation
can be called to settle the liquidation.
Liquidation can be started if collatera-to-debt ratio, named healthFactor, falls under a specific value.
healthFactor
can oscilate due to 2 reasons: collateral value changes or debt accumulates interest, increasing the borrower's debt.
After grace period expires, LendingPool::finalizeLiquidation can be called.
This function executes the following :
-borrower's NFT are transferred to stabilityPool
,
borrower's debt is burned and his data is updated;
reserve assets are transferred from stabilityPool
to lendingPool
to cover for liquidated debt position.
The problem is finalizeLiquidation
doesn't check for borrower's healthFactor
which could have improved for several reasons:
borrower's debt was partially or fully repaid via repay
or repayOnBehalf
;
collateral asset value increased.
Even if healthFactor
is considered healthy, borrowers are still liquidatable.
Borrowers may be liquidated unfairly.
Update finalizeLiquidation
to check for borrower's health factor. Proceed with liquidation only if health factor is unhealthy.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.