Skip to main content

IUniswapV3Factory

Git Source

Title: The interface for the Uniswap V3 Factory

Author: Uniswap Labs

The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees

Functions

getPool

Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist

tokenA and tokenB may be passed in either order

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

Parameters

NameTypeDescription
tokenAaddressThe contract address of either token0 or token1
tokenBaddressThe contract address of the other token
feeuint24The fee collected upon every swap in the pool, denominated in hundredths of a bip

Returns

NameTypeDescription
pooladdressThe pool address

createPool

Creates a pool for the given two tokens and fee

tokenA and tokenB may be passed in either order. tickSpacing is retrieved from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments are invalid.

function createPool(address tokenA, address tokenB, uint24 fee) external returns (address pool);

Parameters

NameTypeDescription
tokenAaddressOne of the two tokens in the desired pool
tokenBaddressThe other of the two tokens in the desired pool
feeuint24The desired fee for the pool

Returns

NameTypeDescription
pooladdressThe address of the newly created pool