When distributing rewards to a gauge, _calculateReward function is used to determine the amount to distribute.
The important thing to note is the way period emission is assigned.
As we can see, it depends on the gauge type, since the period emission is already chosen based on the gauge type, the gauge’s reward should be calculated by its share relative to the total weight within its own gauge type. However, that's not the case, as in the following line, the gauge share is determined based on its share compared to total weights of ALL gauges no matter the type.
Next, the function determines the typeShare that will be used to calculate rewards. This is redundant because the period emission already reflects the emission amount allocated for that gauge type. The intended behavior should be that if, for instance, RWA gauges receive 500 tokens in total, then each RWA gauge should receive an amount proportional to its weight relative to the total RWA gauges weight. Instead, the current logic calculates it as:
This will dilute rewards for a gauge, as the weight used to calculate its share includes all gauges. Additionally, the rewards will be diluted further by multiplying by typeShare, which serves a purpose of splitting rewards between gauge types, while rewards are already split by assigning an emission for a particular gauge type.
Dilution of rewards for a gauge.
Calculate gaugeShare using total weights of all gauges withing its type, instead of totalWeight of all gauges. Remove the type share from calculations as emissions are already split between each gauge type.
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.