The liquidation fee in the LiquidationBranch
contract is calculated as a fixed amount directly from the global configuration, without considering the actual liquidation amount. This approach can lead to inaccuracies and unfairness in the fees charged to liquidated accounts, impacting the overall financial integrity of the system.
In the current implementation, the liquidation fee is fetched from the global configuration as a fixed value:
https://github.com/Cyfrin/2024-07-zaros/blob/d687fe96bb7ace8652778797052a38763fbcbb1b/src/perpetuals/branches/LiquidationBranch.sol#L123-L124
This value is applied uniformly to all liquidations regardless of the amount being liquidated. The issue arises because this fixed fee does not scale with the size of the liquidation, leading to potential overcharging or undercharging of fees.
Liquidated accounts may be charged disproportionately high or low fees compared to the actual cost of liquidation, leading to potential unfairness.
Manual Code Review
Update the GlobalConfiguration Contract:
Introduce a new field for the liquidation fee percentage.
Update the LiquidationBranch Contract:
Calculate the liquidation fee dynamically using the percentage fee from the global configuration.
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.