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.
The borrower who is under liquidation can repay his debt or depositNFT to deposit more collateral and close the liquidation process by calling closeLiquidation
In closeLiquidation, if userDebt is smaller than some dust amount, liquidation can be closed.
This is problematic. Liquidation is started based on a healthFactor. Borrower could :
i. partial repay his debt, enough to make his healthFactor healthy again OR
ii. deposit more RAACNft as colateral to make his healthFactor healthy.
Even if borrower repaid/ added more colateral and he doesn't meet liquidation condition anymore, he can't close the liquidation. After grace period expires he will be liquidated.
Borrowers may be liquidated unfairly loosing their collateral even if they hold almost no debt (close to DUST_THRESHOLD).
Update closeLiquidation and check user's health factor instead of user's debt.
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.