The calculateNewEmissionRate() function implements contradictory logic for the benchmarkRate, using it as both a floor and a ceiling in different scenarios. This creates a mechanism that works against its intended purpose of maintaining effective emission rate adjustments.
The function uses benchmarkRate in two contradictory ways:
As a floor when utilization is high, taking the higher value between increasedRate and benchmarkRate
As a ceiling when utilization is low, taking the lower value between decreasedRate and benchmarkRate
Intent: Benchmark as the target emission rate: If the goal is for the emission rate to tend towards benchmarkRate based on utilization, this logic isn’t achieving that. When over-utilized, you only increase up to maxEmissionRate, but benchmarkRate is a floor. When under-utilized, you only decrease down to minEmissionRate, but benchmarkRate is a ceiling. It creates a sticky effect.
Potential Stalling: If the utilization rate fluctuates around the target, but stays just on one side for a prolonged period, the emission rate might get stuck at either the minEmissionRate or the maxEmissionRate, even if the utilization would ideally want it closer to the benchmarkRate.
Unintended Minimum/Maximum Values: If the utilization rate continues to drop dramatically, you might want the emission rate to eventually fall below benchmarkRate so that you can lower the token emissions as far as possible. However, this logic prevents that.
The emission rate becomes stuck at the benchmark rate when crossing the utilization target threshold
The adjustment mechanism fails to respond to utilization changes as designed
The system's ability to incentivize desired utilization levels through emission rate adjustments breaks down
Manual code review
Implement consistent benchmark rate logic by using it as a floor only:
This change ensures:
The benchmark rate serves as a consistent floor
The emission rate adjusts smoothly based on utilization
The system maintains proper bounds with minEmissionRate and maxEmissionRate
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.