After withdrawing funds, you should still be far away from liquidation instead of just stepping on the liquidation line.
Why <= instead of <?
• Assuming collateralValue - nftValue == userDebt.percentMul(liquidationThreshold), the user's health factor will become 1 after the withdrawal, which also meets the liquidation threshold, indicating that as long as the market price drops slightly, liquidation will be triggered immediately.
• In this case, the user will be liquidated instantly, which may lead to:
Very poor user experience (thinking that it can be safely withdrawn, but it is immediately liquidated).
Therefore, the collateral value after withdrawal must be strictly greater than the minimum collateral requirement to be safe.
After the withdrawal, the value of the user's collateral can be exactly equal to the liquidation threshold, which also meets the liquidation requirement and the liquidation will be triggered.
Manual review
Using <= can ensure that users are still far away from liquidation after withdrawing funds, rather than just stepping on the liquidation line.
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.