1inch / spot-price-aggregator

Liquidity-weighted dex price oracle for offchain price discovery
MIT License
273 stars 79 forks source link

WETH -> wstETH pricing is inverted with wrappers enabled #145

Closed blakearnold closed 3 months ago

blakearnold commented 4 months ago

When quoting mainnet WETH (0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) -> wstETH (0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0) the price returned is inverted and instead returns the wstETH -> WETH price when wrappers are enabled.

wstETH -> WETH is correct

Screenshot 2024-05-20 at 3 59 59 PM

WETH -> wstETH should be inverted, but is not

Screenshot 2024-05-20 at 3 59 18 PM

This is not an issue without wrappers:

Screenshot 2024-05-20 at 4 02 18 PM Screenshot 2024-05-20 at 4 02 39 PM
zZoMROT commented 4 months ago

Indeed, it seems there is a problem with the use of wrappers for dstToken. Thank you for identifying and highlighting this.

zZoMROT commented 3 months ago

The bug has been fixed in the new version of OffchainOracle. The new address of the main contract is:

Thank you for the improvement suggestion!

weth_wsteth wsteth_weth