The UpdateWeightRunner::_getData function can return a price of 0 when the oracle address is not approved, and no backup oracles exist.
The QuantAMM admin can remove an approved oracle address by calling the UpdateWeightRunner::removeOracle function. Therefore, an oracle that was previously approved can later be unapproved.
The UpdateWeightRunner::_getOracleData function returns OracleData(0, 0) when the _oracle address is not an approved oracle.
UpdateWeightRunner::_getOracleData function:
The UpdateWeightRunner::_getData function retrieves price data by calling the UpdateWeightRunner::_getOracleData function. If the optimisedOracles[i] address is unapproved, the returned oracleResult.data and oracleResult.timestamp are 0, failing the staleness checks. When the primary (optimized) oracle fails the checks, the function attempts to use backup oracles. If no backup oracles exist, this section is skipped due to array length checks, and the function proceeds to using the price of 0 from the primary oracle.
UpdateWeightRunner::_getData function:
The UpliftOnlyExample contract retrieves price data from the UpdateWeightRunner::getData function to calculate the notional value of LP tokens in USD. This value is used to calculate fees when users remove liquidity. As a result, a price of 0 could lead to incorrect fee calculations.
A price of 0 could be used to calculate pool weight updates, leading to incorrect weight adjustments.
Consider reverting in the else block when numAssetOracles == 1:
Likelihood: Low, when an oracle is removed. Impact: High, Pools using the removed oracle will corrupt the gradient and moving average calculation.
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.