pool?
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
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.
Thanks you. I know how to create the pool from front end. I’m running it on a script currently
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).
Обсуждают сегодня