docs icon indicating copy to clipboard operation
docs copied to clipboard

quote.ts logic wrong

Open michaeltang608 opened this issue 2 years ago • 1 comments

When running the quote logic in quoting project of v3-sdk, i can't get the right price of WETH/USDC after switching the tokens in config.ts. By delving into the code, i found that the parameters passed into quoteExactInputSingle() function https://github.com/Uniswap/examples/blob/main/v3-sdk/quoting/src/libs/quote.ts of quoter contract instance is out of order, which should be CurrentConfig.tokens.in and CurrentConfig.tokens.out. This is because token0 and token1 within the pool contract will always be USDC and WETH.

image

michaeltang608 avatar Dec 21 '23 07:12 michaeltang608

Thank you for this! Still very present as today

Krumil avatar Sep 30 '24 13:09 Krumil

Fixed now, thanks for reporting!

Dayitva avatar Oct 21 '25 14:10 Dayitva