Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quote.ts problem with direction #55

Open
rico2009 opened this issue Oct 11, 2023 · 2 comments
Open

quote.ts problem with direction #55

rico2009 opened this issue Oct 11, 2023 · 2 comments

Comments

@rico2009
Copy link

examples/v3-sdk/quoting/src/libs/quote.ts

line 21:
const quotedAmountOut = await quoterContract.callStatic.quoteExactInputSingle(
poolConstants.token0,
poolConstants.token1,
poolConstants.fee,
fromReadableAmount(
CurrentConfig.tokens.amountIn,
CurrentConfig.tokens.in.decimals
).toString(),
0
)

poolConstants.token0 and token1=> two tokens of the pool , sorted by address
some time will reverse input and output address ~

@michaeltang608
Copy link

@rico2009 hi, i encountered the same issue and agreed with your opinion. Finally I solved this by changing poolConstants.token0 to CurrentConfig.tokens.in.address, and poolConstants.token1 to CurrentConfig.tokens.out.address.

@davedavinci
Copy link

@rico2009 hi, i encountered the same issue and agreed with your opinion. Finally I solved this by changing poolConstants.token0 to CurrentConfig.tokens.in.address, and poolConstants.token1 to CurrentConfig.tokens.out.address.

I second this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants