DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Liquidation is not incentivized for liquidators in some scenarios

Summary

Liquidating accounts with available collateral smaller than the liquidation and settlement fee and with many active positions is not incentivized or profitable to liquidators as they would lose in gas fees.

Vulnerability Details

Liquidation is performed on trading accounts with insufficient available margin to cover their active positions. This may occur when a position suffers a significant loss or if margin value drops in market value. Liquidation is done by permitted liquidators and these liquidators act to close the active positions of the insolvent account, while deducting the settlementFee(liquidator fee) from the account.

// deduct maintenance margin from the account's collateral
// settlementFee = liquidationFee
ctx.liquidatedCollateralUsdX18 = tradingAccount.deductAccountMargin({
feeRecipients: FeeRecipients.Data({
marginCollateralRecipient: globalConfiguration.marginCollateralRecipient,
orderFeeRecipient: address(0),
settlementFeeRecipient: globalConfiguration.liquidationFeeRecipient
}),
pnlUsdX18: requiredMaintenanceMarginUsdX18,
orderFeeUsdX18: UD60x18_ZERO,
settlementFeeUsdX18: ctx.liquidationFeeUsdX18
});

During liquidations, several gas intensive operations may occur including looping all available collateral types, and through all active positions of the account. Liquidation is done in all-or-none mechanism where all active positions are closed.
There are 2 conditions which cause liquidations to not be profitable

  1. The liquidationFee is global meaning that the same fee is charged to an account with just 1 active position and those with max active positions. Liquidators would spend potentially alot more amount of gas for an account with maximum active positions with the same settlement fee being charged.

  2. If an account available margin is insufficient to cover the settlement fee and required margin, the available collateral balance is deducted. For accounts with very small available margins such that they are even lower than the settlementFee, liquidating these accounts is not profitable.
    It is also posible for an account with very small margin to have max open positions as position can be opened with very neglible amounts. Combining both scenarios make liquidating these accounts more unfavorable.

Impact

In multiple scenarios, liquidators would lose in terms of gas when liquidating insolvent accounts. There is less motivation to liquidate these accounts and insolvent accounts with bad debt may persist in the system.

Tools Used

Manual Review

Recommendations

Adjust the settlement fee based on the number of active positions on the insolvent account

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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