Borrowers enter liquidation when they fall below a certain health factor threshold, however improving their health is not accounted for once the liquidation starts.
Liquidators can start liquidations via initiateLiquidation which determines whether a user should be liquidated based on a health factor calculation
The health factor is determined by dividing the value of all user deposited NFTs and their debt+interest with an adjustment for liquidationThreshold
Users can maintain a healthy position by either depositing more NFTs or partially repaying their debt. However once liquidation starts, improving their health doesn't allow them to stop the liquidation, only a full repayment can. Liquidation can only be stopped by calling closeLiquidation, unfortunately, no health checks are performed there.
Users who partially repaid their debt or deposited more collateral won't be able to close the liquidation and their funds are practically lost.
Additionally this opens up potential timing issues such as:
Alice sees they are eligible for liquidation and decide to deposit more collateral and repay a small amount to improve health
Bob sees the transaction in the mempool and front-run calls initiateLiquidation
isUnderLiquidation[Alice] = true, however Alice's transaction goes through
Alice can't close the liquidation despite having improved their health.
Alice can't withdraw her NFT due to being under liquidation, her partial repayment is neglected too
Grace period passes, Alice is liquidated and all NFTs are seized
Sufficiently collaterized user was liquidated, more NFTs were liquidated than they should've.
Logic error, missing functionality, unfair liquidations.
Either add a health factor check in closeLiquidation same as in initiateLiquidation or disallow NFT deposits during liquidation as they do nothing to improve user's health.
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.