Open rico2009 opened 12 months ago
@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.
@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.
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 ~