This finding is aspired by Inability to perform partial liquidations allows huge positions to accrue bad debt in the system with changes to fit Zaros.
The liquidateAccounts() function allows liquidators to liquidate accounts and receive collateral in return.
The issue is that the current functionality only allows liquidating the whole positions of accounts. This means that partial liquidations cannot be performed and prevents liquidators from liquidating whale accounts that hold huge positions in the system.
In the liquidateAccounts() function, we can see it liquidates the entiretradingAccountId
instead of allowing the liquidator to supply a specific amount they can be liquidated to improve the collateral ratio of the id and the overall health of the system.
Since the liquidations cannot be performed unless the liquidator can match upto the collateral deposited by the whale, the system will be undercollaterized causing bad debt to accrue.
The effect of this issue will increase as more such positions exist in the system that cannot be liquidated by the liquidators.
vscode
Implement a mechanism to allow liquidators to partially liquidate positions. This would also require refactoring the collateral paid out to them based on the amount they cover.
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.