scammed - ChainlinkOracle assumes 1:1 ratio for stETH/ETH #209
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Disputed
The sponsor disputed this issue's validity
scammed
High
ChainlinkOracle assumes 1:1 ratio for stETH/ETH
Summary
ChainlinkOracle will use the
wstETH/stETH
exchange rate for pricinglpTokens
, meaning it assumes a 1:1 ratio forstETH/ETH
, which is not true most of the time (Ξ0.999900 at the time of writing).Vulnerability Detail
The issue stems from the
priceX96
implementations and the fact that there is no way to derive A/B token prices when there is no direct price feed:Indeed the first Vault deployment will be only with wstETH as underlying token and in order to calculate its price in terms of ETH we should first derive the rate of
wstETH/stETH
-wsteth::getStETHByWstETH
Then stETH/ETH chainlink price feed should be used to multiply and then normalize the decimals. The exact same primer can be found in Lido’s github - https://github.com/lidofinance/wsteth-eth-price-feed/blob/main/contracts/AAVECompatWstETHToETHPriceFeed.sol#L39-L45
Issue with mellow is that wstETH price is calculated in terms of stETH only, and used like that, wrongly assuming stETH and ETH will trade at 1:1 ratio forever.
Impact
Arbitrage opportunities in Mellow due to miss-calculated wstETH price in terms of ETH.
Similar issues:
Code Snippet
https://github.com/mellow-finance/mellow-lrt/blob/dev-symbiotic-deploy/src/oracles/ChainlinkOracle.sol#L80-L99
https://github.com/mellow-finance/mellow-lrt/blob/ba168622a53e66c7655df5a6249760ecd9aa8f7d/src/oracles/WStethRatiosAggregatorV3.sol#L15-L17
Tool used
Manual Review
Recommendation
Chainlink oracle should be extended to support wstETH as performed in the Lido finance example.
Duplicate of #266
The text was updated successfully, but these errors were encountered: