The MinimumVarianceUpdateRule contract experiences minor precision loss in maintaining the pool weight invariant (sum of weights = 1e18). The deviation stabilizes at -4 (4e-18 below target) after a single compounding, representing a very small but consistent mathematical imprecision in the total weight calculation.
Location: pkg/pool-quantamm/contracts/rules/MinimumVarianceUpdateRule.sol
The issue occurs in the weight calculations where small rounding errors accumulate to a stable deviation:
Proof of Concept:
Test Results:
Small but consistent deviation from exact 1e18 total weight
Deviation stabilizes at 4e-18 below target (0.0000000000000004%)
Initial compounding from -2 to -4, then stabilizes
Mathematical imprecision in weight calculations
Well within typical DeFi rounding error tolerances (1e15)
Consider adding weight normalization for perfect precision:
Optional improvements:
Add normalization step in base update rule
Consider higher precision for intermediate calculations
Add weight sum validation in testing utilities
Document expected precision characteristics
According the sponsor and my understanding, sum of weights does not have to be exactly 1 to work fine. So no real impact here. Please provide a PoC showing a realistic impact if you disagree. This PoC cannot contains negative weights because they will be guarded per clampWeights.
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.