> For the complete documentation index, see [llms.txt](https://pangeaswap.gitbook.io/pangeaswap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pangeaswap.gitbook.io/pangeaswap/en/developers/contracts/core-contracts/concentratedliquiditypoolfactory.md).

# ConcentratedLiquidityPoolFactory

{% embed url="<https://github.com/pangea-protocol/pangea-core/blob/main/contracts/pool/ConcentratedLiquidityPoolFactory.sol>" %}

#### Updates

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

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

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

## Overview

![](/files/Fj5XpddUWht77xrRl4Mb)

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(swapFee \* 0.02)
$$

There are currently 4 possible combinations of swapFee and tickSpacing.

<table><thead><tr><th width="313">swapFee</th><th>tickSpacing</th></tr></thead><tbody><tr><td>1%</td><td>100</td></tr><tr><td>0.2%</td><td>20</td></tr><tr><td>0.06%</td><td>2</td></tr><tr><td>0.01%</td><td>2</td></tr></tbody></table>

## Methods

### configAddress

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

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

**Parameters**

<table data-header-hidden><thead><tr><th width="150"></th><th width="150"></th><th></th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>data</td><td>bytes32</td><td>abi.encode(address tokenA, address tokenB, uint24 swapFee, uint24 tickSpacing);</td></tr></tbody></table>

### deployPool

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

Creates and deploys a pool. if exists, revert.

**Parameters**

<table data-header-hidden><thead><tr><th width="150"></th><th width="150"></th><th></th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>deployData</td><td>bytes</td><td>abi.encode(address tokenA, address tokenB, uint24 swapFee, uint160 price, uint24 tickSpacing, address callback)</td></tr></tbody></table>

### getPools

```solidity
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

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

Returns whether the pool is created by the factory&#x20;

### poolsCount

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

Returns the number of pools composed of two tokens
