1

i see uniswapv3 quoter or factory or router contracts doesn't have getPair, getReserve and other similar ABI functions like UniswapV2. does UniswapV3 have Equivalent for this functions? or did they depreciated?

2 Answers 2

1

Uniswap V3 factory has getPool function which takes two token addresses and the pool's fee (100, 500, 3000 or 10000) and returns address of the pool. Knowing the pool address you can get balances of both tokens by using ERC20 balanceOf function on both token contracts (passing pool's address as a parameter).

Here is link to the factory on mainnet: https://etherscan.io/address/0x1F98431c8aD98523631AE4a59f267346ea31F984#readContract

5
  • Thanks very much. but what are those pool's fee and by what criteria i choose among (100, 500, 3000 or 10000) and what is their units? Sep 11, 2023 at 16:23
  • 100, 500, 3000 and 10000 correspond to 0.01%, 0.05%, 0.3% and 1% fee pool respectively. These are the only 4 options enabled in regular Uniswap V3 deployment. You would pass 100, 500, 3000 or 10000 to the getPool function as a parameter
    – Vas Treck
    Sep 11, 2023 at 16:25
  • So if i can set the pool fee by my own, not only me , everyone sets low fee. So what is the purpose of the third argument? does i get any advantage if i set higher fee? Sep 11, 2023 at 16:33
  • you provide these 3 parameters to find out the pool's address. There could be 4 pools created for each token pair - each pool with its own fee. These pools are not connected in any way - they are independent from each other. It's up to liquidity providers to which pool to put their tokens. Usually 0.3% and 1% fee pools are used for volatile tokens and 0.05% and 0.01% fee pools for stables and such.
    – Vas Treck
    Sep 11, 2023 at 16:44
  • crystal clear. Thanks a lot Sep 11, 2023 at 16:46
0

Uniswap v3 supports creating multiple pools of the same pair with varying fee tiers, v3 factory has a getPool function, taking two addresses and a fee. As opposed getPair which takes only the two addresses.

The v3 pools use the token balances, which you can get by calling balanceOf on each token in the pair and passing the address of the pool.

The mechanics across those two versions of the protocol vary quite a lot, so there isn't parity between most of the functions.

7
  • Hello maka. Happy to see u again. So i can swap between any pair by creating new pool right? because it uses tokens balance. Sep 11, 2023 at 16:31
  • Not sure I understand the question. You can create a path if there isn't one, by seeding liquidity for the pools in the path. But you will have to seed them with a lot to facilitate a good trading price for any substantial amounts.
    – Maka
    Sep 11, 2023 at 16:43
  • Do i must seed liquidity by both side. I mean let's aassum WETH/LINK is not exist in pair list. if i want to create WETH/LINK, should i seed both WETH and LINK liquidity? Sep 11, 2023 at 16:48
  • v3 supports seeding single sided liquidity, play with it on a testnet like goerli.
    – Maka
    Sep 11, 2023 at 17:07
  • Ok thanks a lot brother ... Sep 11, 2023 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.