# ConcentratedLiquidityPoolFactory

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

#### 변경 내용

* 2022년 9월 16일\~ : (swapFee, tickSpacing) 조합 변경

  -변경 전: (600,6) , (100,1)

  -변경 후: (600,2) , (100,2)

## Overview

![](/files/TRmCNFjWY13sS19y6NCt)

Concentrated Liquidity Pool Factory는 Deployer를 통해 Concentrated Liquidity Pool을 생성하는 데 사용됩니다. 현재는 하나의 팩토리만 존재하지만, 이후에 다양한 프로토콜의 협업에 따라 팩토리 컨트랙트는 늘어날 예정입니다. 두 토큰에 대한 풀은 swapFee, tickSpacing, callbackAddress에 따라 여러 풀을 생성할 수 있습니다.

기본적으로 swapFee와 tickSpacing은 아래의 공식에 따라 만들기를 권장합니다. volatility가 높은 페어일수록 tick spacing과 swap Fee는 높을수록 유리하고, volatility가 낮은 페어일수록 tick spacing과 swap Fee는 낮을수록 유리합니다. Pangea에서는 volatile pair의 경우에는 (swapFee, tickSpacing) = (2000, 20), stable pair의 경우에는 (swapFee, tickSpacing) = (600, 2)을 default로 세팅하고 있습니다. (22년 9월 16일, 신규 stable pair의 tickSpacing 2로 변경)

$$
tickSpacing = Math.round(swapFee \* 0.01)
$$

현재 가능한 swapFee와 tickSpacing 조합은 총 4가지 입니다.

<table><thead><tr><th width="405.3820662768031">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>keccak256(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)</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

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pangeaswap.gitbook.io/pangeaswap/developers/contracts/core-contracts/concentratedliquiditypoolfactory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
