API reference v2.0
Introduction
core
periphery
PoolInitializer

PoolInitializer

PoolInitializer

Creates and initializes Algebra Pools

Developer note: Credit to Uniswap Labs under GPL-2.0-or-later license: https://github.com/Uniswap/v3-periphery

Functions

createAndInitializePoolIfNecessary

function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) external payable returns (address pool) payable external

Creates a new pool if it does not exist, then initializes if not initialized Developer note: This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool

NameTypeDescription
token0addressThe contract address of token0 of the pool
token1addressThe contract address of token1 of the pool
sqrtPriceX96uint160The initial square root price of the pool as a Q64.96 value

Returns:

NameTypeDescription
pooladdressReturns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary