The profit_unlocking_rate is used to unlock tokens over time, but the current implementation in the Oracle does not properly account for the gain when calculating the rate. The rate is calculated by considering the remaining time (full_profit_unlock_date - last_profit_update), which does not reflect the actual profit to be unlocked. This causes an inaccurate unlocking rate, as the gain should be factored into the rate calculation, similar to how it's done in the Vault implementation.
In the Oracle, the profit_unlocking_rate is calculated as:
(https://github.com/curvefi/storage-proofs/blob/main/contracts/scrvusd/oracles/ScrvusdOracleV2.vy#L273)[Oracle#273]
Here, the formula only accounts for the remaining time (full_profit_unlock_date - last_profit_update) without reflecting the gain.
incorrect rate calculation , may lead to tokens unlocking too fast or too slow.
Manual Review
update the calculation to follow the Vault's approach for profit rate computation. Instead of using only the remaining time (full_profit_unlock_date - last_profit_update), use the gain-based period calculation as done in the Vault.
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.