The PowerChannelUpdateRule contract exhibits severe numerical instability in its weight calculations when processing certain combinations of parameters. This can result in astronomically large weights (>1e77) while still maintaining a sum of 1e18. Despite existing guard rails in the system, none effectively prevent this instability from causing economic damage to users of QuantAMM-approved pools.
Location: pkg/pool-quantamm/contracts/rules/PowerChannelUpdateRule.sol
The issue can occur in QuantAMM-approved pools when certain parameter combinations are approved that trigger numerical instability in the power channel calculations:
Small prices (1e6)
Small kappa values (1e6)
Large Q values (>3e18)
Extreme initial weights (0.001e18/0.999e18)
While existing guard rails check for:
Parameter validation (kappa > 0, Q > 1e18)
Weight interpolation bounds
Manual weight setting limits (0 < weight < 1e18)
None of these prevent the PowerChannelUpdateRule from calculating extreme weights that, while mathematically valid, could destabilize pool pricing and harm users.
Test Results:
A pool is created with parameters that can trigger numerical instability
The QuantAMM team approves the pool and its parameters for the update weight runner process
When certain price conditions occur, the pool enters a numerically unstable state
Price calculations become unreliable
Users of the pool suffer economic damage
Severity: HIGH
Technical Impact:
Generates astronomically large weights (>1e77)
Breaks pool mathematics while maintaining superficial invariants
Creates unreliable price calculations
Affects approved pools using PowerChannelUpdateRule
System becomes unstable and unpredictable
Economic Impact:
Unreliable price calculations leading to significant economic damage
High risk of substantial loss of user funds
Systemic risk to connected pools or protocols
Potential for complete pool failure
Undermines fundamental trust in the protocol
Despite Pool Approval Requirements:
While pools require QuantAMM team approval, this is insufficient protection because:
Parameter combinations that trigger instability are non-obvious
Effects may only manifest under specific market conditions
Once approved, pools can enter unstable states without further checks
Human approval process is prone to oversight
Economic damage can be severe before issues are detected
The approval process provides a false sense of security rather than meaningful protection
Systemic Risk:
Affects core pool mathematics
No effective circuit breakers or recovery mechanisms
Can impact multiple pools simultaneously
May trigger cascading failures in integrated protocols
Recovery requires manual intervention
Foundry testing framework
Manual code review
Mathematical analysis of power channel formula
Custom test suite for numerical stability
Add Parameter Bounds:
Implement Intermediate Value Checks:
Add bounds checking on intermediate calculations
Validate power operation results
Ensure weight changes remain within reasonable bounds
Add circuit breakers for extreme results
Improve Parameter Validation Process:
Add validation checks for parameter combinations during pool approval
Document safe parameter ranges
Consider automated parameter validation tools
Add monitoring for approved pools' weight calculations
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.