Skip to main content
Helpful?

PoolAddress

Functions

getPoolKey

  function getPoolKey(
address tokenA,
address tokenB,
uint24 fee
) internal returns (struct PoolAddress.PoolKey)

Returns PoolKey: the ordered tokens with the matched fee levels

Parameters:

NameTypeDescription
tokenAaddressThe first token of a pool, unsorted
tokenBaddressThe second token of a pool, unsorted
feeuint24The fee level of the pool

Return Values:

NameTypeDescription
PoolkeyPoolAddress.PoolKeyThe pool details with ordered token0 and token1 assignments

computeAddress

  function computeAddress(
address factory,
struct PoolAddress.PoolKey key
) internal returns (address pool)

Deterministically computes the pool address given the factory and PoolKey

Parameters:

NameTypeDescription
factoryaddressThe Uniswap V3 factory contract address
keystruct PoolAddress.PoolKeyThe PoolKey

Return Values:

NameTypeDescription
pooladdressThe contract address of the V3 pool
Helpful?