The calculateBlockNormalisedWeight function uses an unbounded timeSinceLastUpdate parameter to calculate weight adjustments:
The absence of a maximum time delta constraint in weight calculations poses a significant risk to pool stability and security. When weight adjustments are calculated, the time since the last update is multiplied directly with the weight multiplier. In scenarios where updates are delayed or prevented for extended periods, this multiplication can result in dramatic weight shifts that far exceed normal operational parameters.
This vulnerability becomes particularly concerning in the context of automated market making, where weight ratios directly influence trading prices and pool behavior. An attacker could potentially manipulate update timing to force extreme weight changes, creating arbitrage opportunities or destabilizing the pool. The economic impact could be severe, as liquidity providers might suffer losses due to pool imbalances that deviate significantly from intended strategies.
The risk is compounded by the fact that the protocol's economic model assumes relatively frequent updates with moderate weight changes. The unbounded nature of time-based calculations breaks this assumption, potentially invalidating core economic security properties of the system.
Implement a maximum time delta constant:
Add validation in the calculation function:
Consider implementing a progressive dampening mechanism for longer time periods to prevent extreme shifts:
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.