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

Initial and maintenance margins can be equal, leading to an instant liquidation

Summary

According to the createPerpMarket, IMR and MMR can be equal:

if (params.initialMarginRateX18 <= params.maintenanceMarginRateX18) {
revert Errors.InitialMarginRateLessOrEqualThanMaintenanceMarginRate();
}

Deploying market with such configuration will lead to almost instant position liquidation and will harm the users who will be good with being allowed to open positions with lower margin.

Vulnerability Details

When both IMR and MMR are equal or similar to each other, high percent of the positions will be instantly liquidated, when their order is being executed. This will happen because market pair is volatile and in short amount of time can fall below the IMR = MMR and keeper to identify and liquidate it.

Impact

Instant position liquidation since the configuration allows passing similar numbers as margin requirements.

Tools Used

Manual Review

Recommendations

Add some buffer to prevent passing similar numbers.

Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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