The closeLiquidation function in its currently only checks if the borrower's debt is below a certain threshold to determine whether to remove them from liquidation status. This approach is not enough because it overlooks:
Partial Repayments: Borrowers might make partial repayments to avoid liquidation but still be at risk of being undercollateralized., which will revert in => if (userDebt > DUST_THRESHOLD) revert DebtNotZero(); which require user to pay all of there complete debt, but when they just repay enough to safe there position, they will still get liquidate.
Collateral Value Increase: The value of collateral (such as NFTs) may rise, improving the borrower's position.
Health Factor Consideration: A more comprehensive metric like the health factor should be used to assess liquidation eligibility.
Without incorporating the health factor, borrowers who should be protected from liquidation may still be flagged, while others who manipulate repayments could avoid liquidation unfairly.
Current Implementation of closeLiquidation
Partial Repayments
A borrower may repay just enough to avoid liquidation but remain undercollateralized.
The current debt check (DUST_THRESHOLD) is inadequate to ensure the borrower's position is fully solvent.
NFT Collateral Value May Increase
The protocol does not reassess the borrower's health based on collateral value (e.g., NFT price appreciation).
If collateral value increases, the borrower's financial position could improve, and they should not be liquidated.
No Health Factor Consideration
The contract does not include the health factor as a metric for determining liquidation status.
A proper check would consider both debt and collateral value to ensure the borrower is solvent before closing liquidation.
Unfair Liquidations: Borrowers may be unfairly liquidated even if their collateral value has increased, due to the lack of up-to-date checks.
Weak Liquidation Protection: Without a health factor validation, liquidation protection mechanisms become unreliable, putting borrowers at risk.
Implement Health Factor Check in closeLiquidation
To ensure proper liquidation protection, modify closeLiquidation to evaluate the borrower’s health factor before removing them from liquidation.
This will also protect againt any partial Repayment done by user to save there position.
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.