Closed dwdpbcsf closed 2 years ago
It's not a bug, the fee taken on 1 unit of any token leaves 0 units remaining to swap. You can't swap less than 1 unit. 1
here represents 1 wei of ETH
Thanks for your help! I understand. | 丁文迪 | |
---|---|---|
@.*** | 签名由网易邮箱大师定制
On 02/28/2022 23:37,Moody @.***> wrote:
It's not a bug, the fee taken on 1 unit of any token leaves 0 units remaining to swap. You can't swap less than 1 unit. 1 here represents 1 wei of ETH
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>
Hello. Have some issue with quoteExactInputSingle(). It works for me 50/50. I can't figure out why it doesn't work with some currencies
for example tokenIn: '0x6b175474e89094c44da98b954eedeac495271d0f', tokenOut: '0xbbbbca6a901c926f240b89eacb641d8aec7aeafd', fee: 3000,
failed(( with Error: call revert exception
if amountIn == 1, res is 0 if amountIn == 2, res is 2730, close to the real market price if amountIn == 3, res is 5461, ... so the real amountIn is (amountIn - 1) why?
And the liquidity is limited. But as the amountIn become bigger, the amountOut is bigger.
I use the uniswap v3 sdk to do the same thing. (https://docs.uniswap.org/sdk/guides/creating-a-trade) The same problems occur.
If amountIn is 1, the amountOut is 0, and so on.
So, is this a bug?