LibUsdOracle:getUsdPrice
calls LibWstethUsdOracle:getWstethEthPrice
which is stETH/ETH
chainlink oracle, to calculate the current price of a given token in USD. This token valuation is used to determine the amount of stETH to skim from the user resulting from oracle arb. This is problematic since stETH/ETH has a 24 hour (1 day) heartbeat and a 2% deviation threshold. This deviation in price could easily cause loss of funds to the user. This protocol is not just using 1 day heartbeat, instead using 4 days heartbeat which is way worse.
The following getWstethEthPrice
function uses the stETH/ETH oracle to determine the price which as stated above has a 24 hour hearbeat and 2% deviation threshold (And beanstalk is using 4 days heartbeat), this means that the price can move up to 2% or 24 hours (even 4 days) before a price update is triggered. The result is that the on-chain price could be much different than the true stETH price.
This price is used when determining how much stETH to send back to the user. Since the oracle can be up to 2% different from the true price, the user can unfairly lose part of their funds.
User will be unfairly penalized due large variance between on-chain price and asset price. And the price of given token will also be not accurate as compared to market price.
Manual Review
Use the stETH/USD
oracle instead because it has a 1-hour heartbeat and a 1% deviation threshold.
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.