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

Sushi swaprouter contract address in Etherscan #2

Open
Samboy76 opened this issue Jun 12, 2023 · 3 comments
Open

Sushi swaprouter contract address in Etherscan #2

Samboy76 opened this issue Jun 12, 2023 · 3 comments

Comments

@Samboy76
Copy link

Hello, cannot find this swaprouter V3 address anywhere in the sushi.com documentation section of deployment contract addresses. It only has one though for QuoterV2 but not for SwapRouter. Can you share this with me?

@AsterixMechant
Copy link

Same here, can't seem to find it anywhere

@AsterixMechant
Copy link

AsterixMechant commented Dec 23, 2023

@Samboy76 You probably either figured it out by this time or gave up trying, but here's the solution for anyone struggling with this in the future: there is no router, however, you don't actually need one.

If you go over to the sushiswap website, go to the pools index, filter by SushiswapV3, and then by the pair you want, and click to navigate to the pool's details, you should see a hash at the end of the url in your browser's address bar. That hash is the pool address.

The whole purpose of having the swap router is being able to obtain the pool address for a given pair, so taking these steps solves the problem of not having the router. Though you'll need to manually write down the address of every pool you want to use somewhere in your code, like in some .env file you can read from. The pools rarely ever change addresses so I guess this should be a good solution.

Captura de Tela 2023-12-23 às 04 43 49

@AsterixMechant
Copy link

AsterixMechant commented Dec 23, 2023

I remain corrected: the swap router is not meant to give you a pool address. The factory is. But regardless of that, and I apologize for the confusion, you can still work around the lack of the swap router address. You can grab the pool address as per my instructions in my last comment, and then go over to Etherscan (or Arbiscan, or BscScan...whatever suits the network you're using) and grab the pool ABI from there. That's all you need. Once you have the Abi, you can manually instantiate a contract using ethers.js or whatever library you're using, and have all the fucntionality that would otherwise have been provided by the swap router.

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

2 participants