QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: high
Invalid

Incorrect Calculation of mulFactor in Gradient-Based Weight Adjustment

Summary

The calculation of mulFactor in the QuantAMMGradientBasedRule contract deviates from the documented formula ( line 22 in the QuantAMMGradientBasedRule contract), leading to a mismatch between the intended weight adjustment logic and its implementation.

Vulnerability Details

The code calculates mulFactor as:

locals.mulFactor = oneMinusLambda.pow(THREE).div(convertedLambda);

This corresponds to:

However, the documentation specifies it should be:

This error reverses the roles of and $1−𝜆$, leading to increased sensitivity to recent data rather than smoothing trends over time. The issue resides in the _calculateQuantAMMGradient function of the QuantAMMGradientBasedRule contract.

Impact

Increased Reactivity: The weights become overly sensitive to recent data, potentially leading to instability in the pool's operations.

Higher Arbitrage Costs: Aggressive weight updates may increase arbitrage activity, resulting in higher costs for liquidity providers.

Deviation from Design Intent: The current implementation does not align with the documented behavior, potentially misleading users and developers relying on the expected behavior.

Tools Used

Manual code review

Recommended Mitigation

Update the calculation of mulFactor in the code to align with the documented formula:

locals.mulFactor = convertedLambda.pow(THREE).div(oneMinusLambda);

This change ensures that:

Updates

Lead Judging Commences

n0kto 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!