Open hats-bug-reporter[bot] opened 7 months ago
There is also difference in comments
wstETH/ETH == ~1.15 as you shared from the coinmarketcap link:
(ensure to change your quote currency to ETH in the top right to see this.
Meaning for every wstETH sold you get 1.15 wETH. This matches the existing implementation within OrigamiWstEthToEthOracle
eg you can add this as a new test within OrigamiLovStEthIntegrationTest.t.sol#L20
This is using a forked mainnet of block 19238000
function test_wstEthToEthPrice() public {
assertEq(
lovTokenContracts.wstEthToEthOracle.latestPrice(IOrigamiOracle.PriceType.SPOT_PRICE, OrigamiMath.Rounding.ROUND_DOWN),
1.156862651867541366e18
);
Github username: @0xLogos Twitter username: -- Submission hash (on-chain): 0x37fc00d2a6b15947d735a80beae8f4695e9ffbd09148137a5e671b05a9d2fd5c Severity: high
Description: Description
Expected calculation for wstETH/ETH is wstETH/stETH * stETH/ETH from scope file description.
stETH/ETH is obtained from chainlink and is correct. But first component (wstETH/stETH) is obtained using
stEth.getPooledEthByShares
which is wrong. This method returns eth/stETH, not wstETH/stETH.Let's query it on etherscan here https://etherscan.io/token/0xae7ab96520de3a18e5e111b5eaab095312d7fe84#readProxyContract#F22
Answer is ~1.15 which is expected value for eth/stETH, but not wstETH/stETH because stETH price < wstETH price so ration should be < 1.
https://coinmarketcap.com/currencies/lido-finance-wsteth/ https://coinmarketcap.com/currencies/steth/