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.
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.
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.
Manual code review
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:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.