I mean difference between liquidity pool address and router address if any. I’m trying to fork uniswap to get a testrouter on Rinkeby. I want to know if the testrouter I deploy can also be considered as the liquidity pool of let’s say (eth/dai) as well
Mar 28, 2022, 2:17 AM
The router is the contract which interacts with all the different pairs on your behalf. This is why, you "approve" the router to move your tokens around. They are absolutely not interchangeable. They are different contracts with different purposes.
If you want to create eth/dai pool, you must own both of each token, and you can use the front end to create pool and add liquidity.
Mar 28, 2022, 2:36 AM
Thank you. I know how to create the pool from front end. I’m running it on a script currently
Mar 28, 2022, 2:38 AM
Ah, well you'll be interested in a few functions then... first make sure you own DAI, and then you'll want to DAI.approve(ROUTER_ADDR, AMOUNT), then you'll either want to use Router.addLiquidity or Router.addLiquidityETH. If you want to create with regular ETH, then use addLiquidityETH, otherwise, convert your ETH to WETH and then WETH.approve(ROUTER_ADDR, AMOUNT).
Mar 28, 2022, 2:44 AM