Part 2

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

CreditDelegationBranch::withdrawUsdTokenFromMarket mints usd which can deleverage the protocol significantly

Summary

The function CreditDelegationBranch::withdrawUsdTokenFromMarket mints USD tokens based on the requested amount but does not verify whether this action maintains the market’s debt ratio after minting. The function only ensures that the credit capacity is greater than zero before proceeding but does not re-evaluate the debt ratio after minting the tokens. This oversight may lead to unintended deleveraging, potentially undermining the market's stability. This can change the debt to credit ratio significantly after minting. But there are no checks after usd mint to ensure good health of the market

Vulnerability Details

The function verifies that the creditCapacityUsdX18 is greater than zero before proceeding. It then mints USD tokens based on the requested amount without re-evaluating whether the minting causes a significant change in the market’s debt ratio. The check for creditCapacityUsdX18 is performed before minting, meaning that once tokens are minted, the updated debt ratio is not validated.
If the minting process increases the market’s debt significantly, it could lead to undesirable deleveraging, which might cause a market imbalance. In bull season, when there's too many positive PnL, the debt will continue to increase due to unrest

Impact

  • Since the function does not ensure that the new debt ratio remains within acceptable limits after minting, the system may allow excessive debt accumulation.

  • If the market unintentionally enters a deleverage state, it may force unnecessary liquidations or lead to a shortfall in collateral backing

Tools Used

  • Manual code review

Recommendations

Introduce a maxDebtRatio threshold beyond which minting is disallowed.
Before finalizing the minting process, verify that the debt ratio remains within permissible bounds.

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!