Decoding uniswap v3 Router with 2 swaps #32
-
Seems that the lib does not correctly decode for cases where there are 2 swaps in one, here is an example TX: The output seems pretty strange, and is definitely incorrect for the second leg, where USDT value is very large.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Hello @Chief-Alchemist |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response, had a look, makes sense, one question I have left. You mention to solve for this we should:
How do we know whether we should or should not set amountIn? ie if there are more than 1 swaps overwrite the amountIn or? |
Beta Was this translation helpful? Give feedback.
-
(Converting issue #31 into a discussion) When there is a first swap with an unknown Worth to be noted, this SDK supports now 2 convenient methods that deal with this case for you:
|
Beta Was this translation helpful? Give feedback.
-
Useful discussion, thanks! ;) |
Beta Was this translation helpful? Give feedback.
(Converting issue #31 into a discussion)
When there is a first swap with an unknown
amountOut
(when the trx is encoded), then a second swap which has to use it as its ownamountIn
.Worth to be noted, this SDK supports now 2 convenient methods that deal with this case for you:
v2_swap_exact_in_from_balance()
v3_swap_exact_in_from_balance()