the calculation of momentum could have a negative values in some cases giving these equation to calculate momentum
w(t) = w(t − 1) + κ · ( 1/p(t) * ∂p(t)/∂t − ℓp(t))
where ℓp(t) = 1/N * ∑( 1/p(t)i * ∂p(t)i/∂t)
You see that value of ℓp(t) is a sum of ( 1/p(t)i * ∂p(t)i/∂t)[i]
So ℓp(t) > every ( 1/p(t)i * ∂p(t)i/∂t)[i]
Then the second part of the equation could have a negative weight value
combining this with a small old weight result in a negative weight
Add this test function in MomentumRuleTest contract
Wrong calculation of weights for Momentum role breaks all logic of the contract
Calculation of weights is a core to the protocol and can't have any small error as it have huge impact on the protocol.
manual review
apply this require with a scalar kappa
_clampWeights will check that these weights are positive and in the boundaries before writing them in storage.
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.