-
Notifications
You must be signed in to change notification settings - Fork 433
error: no tick data provider was given #184
Comments
This error is not thrown by the constructor but by functions that require Tickdata on Pools that are initialized without ticks. |
Hey @Florian-S-A-W I'm trying to swap tokens using the uniswap universal router - 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD. I have shared my code snippet below, Any help is useful to me as I'm new to this and can't figure out where I'm going wrong. Also, I have a query whether this universal router can execute transactions on v2,v3 and mixed routes ? I'm referring a YT video for this - https://www.youtube.com/watch?v=LfJImqRQUkI&pp=ygUYdW5pc3dhcCB1bml2ZXJzYWwgcm91dGVy
|
Take a look at the universal router sdk: https://github.com/Uniswap/universal-router-sdk |
Also, I have a query whether this universal router can execute transactions on v2,v3 and mixed routes ? Can I use the uniswap API to fetch the quote and universal router to swap the tokens ? Is there any working example which I can refer to ? |
Yes, the universal router can make trades on both V2, V3 and also the NFT marketplace. The routing-api is an AWS deployment of the smart-order-router. I have never used it with AWS personally but it should work the same as the smart-order-router package if you prefer it. Have you looked at this guide which uses the smart-order-router? The function Something I just realised can be quite confusing is that the V3SwapRouter is just named SwapRouter in the docs several times, so you would think SwapRouter02 is version 2 of it. It's not, it's a combination of the V2 and V3 SwapRouter that supports both protocols. It also has this confusing name in the guide. You could also look at tests in the sdk-repo (just one example here). The universal router is used in the interface and the swap widget, you could look at that as well. Both are rather big projects though. I would place my focus on understanding the smart-order-router and the universal-router-sdk packages for your issue. It's not part of the v3-sdk unfortunately. |
Yes, there seems to be a bit of confusion. Currently I'm going through the universal-router tests to understand the flow. I want to build a small swap interface using uniswap. Currently I'm using the quote api directly - https://api.uniswap.org/v2/quote. There are two universal router as far as I can see in their deployed-addresses folder |
I recently asked the same question and the answer is that both are fine. |
Thanks for the clarification mate. Is there any issue if I use uniswap quote api directly ? |
I think that is an internal API that Uniswap Labs uses. It's not public. |
Ok. I just implemented the universal router sdk and tried to swap following the code given in their test file. But my transaction failed, here is the hash. Can you help me debug this ? Below is my code snippet.
|
Are the call parameters created for the correct router? Did you use the class from universal-router-sdk as there are so many across the sdks with that name. |
yes i'm importing the below classes
below is an instance of my calldata being created
Am I making any mistake for the |
The Permit2 allowance is expired. Otherwise this seems to be correct. I suggest playing around with Tenderly a bit. Its a very useful tool. I'm not affiliated or anything I just really like it. |
Ya @Florian-S-A-W i agree Tenderly is very useful tool in simulating transactions. Thanks for sharing. I could not understand the "Permit2 allowance is expired" ? What exactly do I need to do ? I was swapping MATIC with USDC, do I need to perform |
Take a look at the documentation: https://docs.uniswap.org/contracts/permit2/overview |
Hey @Florian-S-A-W , tenderly helped me a lot, I also implemented permit2 sdk. But I get the following error - hash, which I'm unable to debug using tenderly. Can you help me out please ? |
I'm creating a pool instance using the Pool class where it mentions that the ticks are optional but if i donot pass ticks then it throws an error of "error: no tick data provider was given".
Please help me.
The text was updated successfully, but these errors were encountered: