Part 2

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

Market::isAutoDeleverageTriggered should return true when debt is greater than delegated credit

Summary

The function Market::isAutoDeleverageTriggered incorrectly returns false when delegatedCreditUsdX18 is less than or equal to totalDebtUsdX18. This logic should return true, as the system has already exceeded a debt ratio of 1:1, which should trigger auto deleveraging. This bug could prevent the auto deleverage system from activating when required, leading to potential insolvency risks.


Vulnerability Details

The function checks:

if (sdDelegatedCreditUsdX18.lte(totalDebtUsdX18) || sdDelegatedCreditUsdX18.isZero()) {
return false; // @audit - should return true as it already passed ratio 1
}

If the delegated credit is less than or equal to total debt, it returns false, meaning auto deleverage does not activate. When delegated credit ≤ total debt, the system is already over-leveraged, so ADL should be triggered. Returning false in this case prevents ADL activation, operations that worsen the market's condition.

If delegated credit is less than total debt, the market is already in a risk state, so the function should return true immediately.


Impact

  • The market could remain in an over-leveraged state, increasing insolvency risks.

  • If ADL does not activate when needed, the system could mint excessive USD tokens, reducing their backing and stability.


Recommendations

return true when delegated credit is less than debt

Updates

Lead Judging Commences

inallhonesty Lead Judge
10 months ago
inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!