DeFiLayer 1Layer 2
14,723 OP
View results
Submission Details
Severity: high
Invalid

ScrvusdOracleV2:_obtain_price_params profit unlock rate is wrongly calculated which result in incorrect rates

Summary

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.

Vulnerability Details

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]

if params.full_profit_unlock_date > params.last_profit_update:
params.profit_unlocking_rate = params.balance_of_self * MAX_BPS_EXTENDED // (
params.full_profit_unlock_date - params.last_profit_update
)

Here, the formula only accounts for the remaining time (full_profit_unlock_date - last_profit_update) without reflecting the gain.

Impact

incorrect rate calculation , may lead to tokens unlocking too fast or too slow.

Tools Used

Manual Review

Recommendations

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.

Updates

Lead Judging Commences

0xnevi Lead Judge
2 months ago
0xnevi Lead Judge 2 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

0x00a Submitter
about 2 months ago
0xnevi Lead Judge
about 2 months ago
0xnevi Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.