The getWstethEthPrice
function in the LibWstethEthOracle
library calculates the price of wstETH
(Wrapped stETH) in terms of ETH (Ethereum). It calculates the price by considering the Chainlink price and Uniswap price, ensuring robustness and accuracy in the price calculation process.
Now getWstethEthPrice
calls LibChainlinkOracle.getPrice
/LibChainlinkOracle.getTwap
with the timeout argument of LibChainlinkOracle.FOUR_DAY_TIMEOUT
which is set to 345600 seconds (4 days). This duration is four times longer than the Chainlink heartbeat that is 86400 seconds (1 day), potentially introducing a significant delay in recognizing stale or outdated price data.
See the following code:
The Chainlink heartbeat
indicates the expected frequency of updates from the oracle. The Chainlink heartbeat for STETH / ETH is 86400 seconds (1 day).
https://docs.chain.link/data-feeds/price-feeds/addresses?network=ethereum&page=1&search=0x86392dC19c0b719886221c78AB11eb8Cf5c52812
But the defined FOUR_DAY_TIMEOUT
in the LibChainlinkOracle
is 345600 seconds (4 days).
This timeout which is significantly longer than the heartbeat can lead to scenarios where the LibChainlinkOracle library accepts data that may no longer reflect current market conditions. Also, in volatile markets, a 4-day window leads to accepting outdated prices, increasing the risk of price slippage.
Manual Review
Consider reducing the FOUR_DAY_TIMEOUT
from 4 days to 1 day to align more closely with the Chainlink heartbeat on STETH/ETH, enhancing the relevance of the price data.
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.