The function closeLiquidation doesn't check the health factor of the debt position, but instead checks if the user has repaid the whole debt. This would wrongly liquidate the user if either the price of the collateral has increased or if the user has repaid part of the debt during the grace period.
A user gets liquidated in 2 steps. First anyone can call the initiateLiquidation by specifying the user address to liquidate. Then when the grace period has finished the user can get liquidated. During the grace period the user has to repay the whole debt to prevent being liquidated. There are 2 scenario where the user could be wrongly liquidated due to not checking the health factor in closeLiquidation function even if the health factor is above liquidation
threshold :
First scenario is if during the grace period , the price of collateral increases such that the user health factor is above the healthFactorLiquidationThreshold.
Second scenario is when the user repays part of the debt such that the health factor increases above healthFactorLiquidationThreshold.
The liquidation is initiated by checking the health factor in the function to initiate liquidation.
But this isn't implemented when checking to close the liquidation:
User can get wrongly liquidated.
Check the health factor in the closeLiquidation function.
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.