Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: medium
Invalid

Liquidation will fail for Blacklisted collateral

Summary

The current liquidation logic in the contract fails when a user's collateral asset is blacklisted, causing the liquidation process to revert. The issue arises because the code assumes that all collateral assets are transferable and their value can be liquidated into USD. When a collateral asset is blacklisted, the protocol cannot transfer or value it properly, leading to incomplete liquidations or protocol losses. This vulnerability creates systemic risks to the protocol's solvency, particularly during volatile market conditions.

Vulnerability Details

// deduct maintenance margin from the account's collateral
// settlementFee = liquidationFee
ctx.liquidatedCollateralUsdX18 = tradingAccount.deductAccountMargin(
TradingAccount.DeductAccountMarginParams({
feeRecipients: FeeRecipients.Data({
marginCollateralRecipient: perpsEngineConfiguration.marginCollateralRecipient,
orderFeeRecipient: address(0),
settlementFeeRecipient: perpsEngineConfiguration.liquidationFeeRecipient
}),
pnlUsdX18: ctx.accountTotalUnrealizedPnlUsdX18.abs().intoUD60x18().add(
ctx.requiredMaintenanceMarginUsdX18
),
orderFeeUsdX18: UD60x18_ZERO,
settlementFeeUsdX18: ctx.liquidationFeeUsdX18,
marketIds: ctx.activeMarketsIds,
accountPositionsNotionalValueX18: ctx.accountPositionsNotionalValueX18
})
);

When a user tries to liquidate a user account collateral margin that is blacklisted this would revert making the account immune o liquidation

Impact

The current system may leave liquidatable accounts unresolved, potentially causing unrealized losses that accumulate over time

Tools Used

Manual Audit

Recommendations

Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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