15,000 USDC
View results
Submission Details
Severity: high
Valid

Max debt amount available for liquidation isn’t calculated resulting in borrowers incurring unnecessary losses

When user’s collateral to debt ratio is less than MIN_HEALTH_FACTOR a keeper can liquidate their entire position which will result in unnecessary losses for borrowers.

Example
Assume a user deposited 1 ETH and its value is 1000. Assuming a liquidation threshold of 50% a keeper can liquidate their entire position which will result in unnecessary loses for a user. In this example it’s enough to liquidate only 2$ for a user to be above the threshold. This is however not a great approach because if health factor increases to a bit higher than MIN_HEALTH_FACTOR and then collateral dips again additional liquidation calls will be required.

Mitigation steps:
Compound fixed this by introducing a closeFactor which defines max % of user’s borrow amount available for liquidation
https://github.com/compound-finance/compound-protocol/blob/master/contracts/Comptroller.sol#L503
https://docs.compound.finance/v2/comptroller/#close-factor

Early versions of aave have this parameter set to 50%
https://github.com/aave/aave-protocol/blob/4b4545fb583fd4f400507b10f3c3114f45b8a037/contracts/lendingpool/LendingPoolLiquidationManager.sol#L179

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.