ConcentratedLiquidityPoolFactory

Factory contract responsible for creating Concentrated Liquidity Pool

Updates

  • 2022. 9. 16: The (swapFee, tickSpacing) combination was changed

    Before: (600, 6), (100,1)

    After: (600,2), (100,2)

Overview

Concentrated Liquidity Pool Factory is used to create Concentrated Liquidity Pool via Deployer. Currently, there is only one factory, but in the future, the number of factory contracts will increase in accordance with the collaboration with various protocols. Multiple pools for a token pair can be created based on swapFee, tickSpacing, and callbackAddress.

It is recommended to set swapFee and tickSpacing according to the formula below. A pair with high volatility is advantageous when tick spacing and swap fee are high, and a pair with low volatility is advantageous when tick spacing and swap fee are low. In Pangea, by default, (swapFee, tickSpacing) are set (2000, 40) for a volatile pair and (600, 2) for a stable pair. (On Sep 16, 2022, the default tickSpacing of a stable pair was changed to 2)

tickSpacing=Math.round(swapFee0.02)tickSpacing = Math.round(swapFee * 0.02)

There are currently 4 possible combinations of swapFee and tickSpacing.

swapFee
tickSpacing

1%

100

0.2%

20

0.06%

2

0.01%

2

Methods

configAddress

function configAddress(bytes32 data) external nonpayable returns (address pool)

Returns the address of the pool created with the given config data

Parameters

Name

Type

Description

data

bytes32

abi.encode(address tokenA, address tokenB, uint24 swapFee, uint24 tickSpacing);

deployPool

function deployPool(bytes deployData) external nonpayable returns (address pool)

Creates and deploys a pool. if exists, revert.

Parameters

Name

Type

Description

deployData

bytes

abi.encode(address tokenA, address tokenB, uint24 swapFee, uint160 price, uint24 tickSpacing, address callback)

getPools

function getPools(address token0, address token1, uint256 startIndex, uint256 count) external view returns (address[] pairPools)

Returns the list of pools composed of two tokens

isPool

function isPool(address pool) external nonpayable returns (bool ok)

Returns whether the pool is created by the factory

poolsCount

function poolsCount(address token0, address token1) external view returns (uint256 count)

Returns the number of pools composed of two tokens

Last updated