The LendingPool.closeLiquidation() function incorrectly requires users to repay their entire debt (down to dust threshold) to exit liquidation, instead of checking if their position has become healthy again. This prevents users from exiting liquidation through partial repayments or additional collateral deposits, forcing unnecessary liquidations even when positions could be solvent.
The issue occurs in closeLiquidation() where the function enforces full debt repayment:
The core issue is that the protocol requires debt to be essentially zero (< DUST_THRESHOLD) to exit liquidation. This is fundamentally wrong because:
Users can make their position healthy again through multiple means:
Partial debt repayment
Additional collateral deposit
Combination of both
This works against the protocol, as in periods of volatility, most users would need to repay all their debt, which forces them to exit the protocol instead of making their position healthy again
The protocol's health factor calculation is designed to determine position safety:
However, it's not used to determine if users can exit liquidation or not, which leads to users who restore their position to a healthy state not being able to exit liquidation and getting liquidated even with a healthy position
Users are forced into full liquidation even when they restore position health through partial repayment or additional collateral
Protocol loses healthy positions that could have been restored, leading to unnecessary bad debt
Manual Review
Foundry
Replace debt check with health factor check in closeLiquidation():
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.