Closed sherlock-admin closed 5 months ago
2 comment(s) were left on this issue during the judging contest.
ubl4nk commented:
invalid or LowImpact -> i asked it previously from the Sponsor and they will have their own liquidators to liquidate these kind of positions.
takarez commented:
invalid: the if statement ensure that its more than 0
Sponsors comments, this also seems to be noted as a design decision based on comments
At the end of the day, someone has to pay for the liquidation of bad debts. If we provide a portion of margin assoicated with a position to the liquidators then there will be a larger impact on the UNIT price or to the LPs.
xiaoming90
high
No incentive to liquidate positions where
settledMargin < 0
Summary
There is no incentive to liquidation position where the
settledMargin
is less than 0, which affects the solvency of the protocol.Vulnerability Detail
Prompt liquidation of positions is important to the solvency of protocol. Liquidators are incentivized to promptly liquidate such "underwater" positions by receiving a liquidation fee for doing so.
However, if the position's
settledMargin
is less than zero, no liquidation fee/incentive will be given to the liquidator. As such, any liquidator that performs the liquidation against these accounts will have to bear the cost of execution.https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/LiquidationModule.sol#L142
Impact
Prompt liquidation of positions is important to the solvency of protocol. These underwater accounts (
settledMargin < 0
) do not provide any liquidation fee as an incentive. Thus, liquidators will not be incentivized to perform liquidation against these accounts and will avoid liquidating these accounts as they will have to bear the gas cost of executing the transaction. As a result, underwater positions and bad debt accumulate in the protocol, threatening the solvency of the protocol.Code Snippet
https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/LiquidationModule.sol#L142
Tool used
Manual Review
Recommendation
Consider incentivizing the liquidators/keepers to liquidate underwater accounts where it's
settledMargin < 0
so that these positions can be liquidated promptly.