I want to get pool with ETH (ETH/UNI, ETH/USDC, ...).
I tried to call getPool() function of uniswap factory contract with 0x0000000000000000000000000000000000000000, but it returns 0x0, which means there is no pool.
There are no pools with ETH in Uniswap v3 (or Uniswap v2 for that matter), only pools with WETH (ERC-20 wrapped ETH). The address of the WETH token depends on the network. For the Ethereum mainnet the WETH address is 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2. Use this address as an argument for the getPool
function.
For instance, to get the UNI/WETH 0.3% pool (UNI token address is 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984
on the mainnet), call:
getPool('0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984',
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
3000)
Something to note: the pool addresses are deterministic and can be computed off-chain. See here for example code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With