Hi all,

Wondering if anyone could help with this one as it's currently a head scratcher.

Using a given token address I'm currently using EthersJS to query UniswapV3's getPool(...) to discover if any pools for that address have been created.

Problem is, to call getPool(...) you need to know the fee value beforehand, which has resulted in me having to make 3 calls using the most common fee values (500, 3000, 10000), which is obviously inefficient.

function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool)

Question is, is there a way to check the creation of a V3 pool without the fee value?

Many thanks

Mar 1, 2022, 4:40 PM
I'm not sure on v3 code, but if it was me I would just rewrite the function to pull the fee data from the contract before to looks for the pool address.
I was thinking you where talking about reflection fees, but I think your talking about tick spacing for the concentrated liquidity.
Mar 1, 2022, 5:00 PM
Which contract are you referring to because unless I'm mistaken the fee value is in the token pool contract and I don't know the poll contract address beforehand?
Correct
Mar 1, 2022, 5:03 PM
The issue your going to run into is v3 allows pools to be made with same token pairs but different fees for trading. Even if you get a pool address, another pool may be out there with a lower fee. Let's me see if any of my other friends had to deal with this yet
Mar 1, 2022, 5:12 PM
Yes, I've just noticed that too. Many thanks for you help in this matter.
Mar 1, 2022, 5:13 PM
Are you trying to make an adaptive web page that takes in contract addresses and pulls data, or a contract that finds pairs before a trade?
First you call hasMulitplePools, it will return a bool if more then one is out there, then you call decodeFirstPool, this will return the 2 addresses and the fee. Or you can call getFirstPool and it will return the data needed already packed.
Mar 1, 2022, 5:35 PM

© 2024 Draquery.com All rights reserved.