In SCRVUsdOraclev2.vy, the update_price
function does not use last_prices
for smoothing.
In update_price
function, it updates the last prices:
self.last_prices = [self._price_v0(), self._price_v1(), self._price_v2()]
However, it then updates the new price:
new_price: uint256 = self._raw_price(_ts, _ts)
There are multiple issues here:
New price is updated without verifying that price change is within bounds (within max_change), purely based on the timestamp passed from the ScrvUsdVerifierV1.sol
max_change is only checked in _smoothed_price
function, which is only called in the respective functions to calculate v0, v1, v2 prices.
Last prices stores the smoothed v0, v1, v2 prices, but they are not included in the logic when updating the new price.
This breaks the core logic of the protocol to avoid sudden price jumps or manipulation. There is no protection for sudden price updates.
Manual
Ensure last prices are considered when updating the new price to avoid sudden price changes.
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.