> 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/developers/contracts/core-contracts/concentratedliquiditypoolmanager.md).

# ConcentratedLiquidityPoolManager

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

## Overview

![](/files/BKmDdWLwOje3PahbXKUE)

Pool의 포지션을 ERC721(NFT) 포맷으로 Wrap한 컨트랙트로,

* 포지션 생성
* 포지션에 유동성 추가 공급
* 포지션 소각 후 자산 출금
* 스왑 수수료 수취

기능을 포함하고 있습니다. 하나의 풀에 유저는 복수개의 포지션을 생성할 수 있으며, 포지션 자체를 다른 계정으로 보내는 등의 작업을 수행할 수 있습니다.&#x20;

## Methods

### approve

```solidity
function approve(address to, uint256 positionId) external nonpayable
```

*Gives permission to `to` to transfer `positionId` token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - `positionId` must exist. Emits an {Approval} event.*

### balanceOf

```solidity
function balanceOf(address owner) external view returns (uint256 balance)
```

*Returns the number of position NFTs in `owner`'s account.*

### burn

```solidity
function burn(uint256 positionId, uint128 amount, address recipient, uint256 minimumOut0, uint256 minimumOut1, bool unwrap) external nonpayable returns (uint256 token0Amount, uint256 token1Amount)
```

burn liquidity ( if burn all liquidity, delete position Id )

**Parameters**

| Name        | Type    | Description                                                                    |
| ----------- | ------- | ------------------------------------------------------------------------------ |
| positionId  | uint256 | The ID of the NFT                                                              |
| amount      | uint128 | the amount by which liquidity will be burned                                   |
| recipient   | address | The account that should receive the tokens                                     |
| minimumOut0 | uint256 | The minimum amount of token0 that should be accounted for the burned liquidity |
| minimumOut1 | uint256 | The minimum amount of token1 that should be accounted for the burned liquidity |
| unwrap      | bool    | unwrap or not if native token exists                                           |

### collect

```solidity
function collect(uint256 positionId, address recipient, bool unwrap) external nonpayable returns (uint256 token0amount, uint256 token1amount)
```

Collects up to a maximum amount of fees owed to a specific position to the recipient

### getApproved

```solidity
function getApproved(uint256 positionId) external view returns (address operator)
```

*Returns the account approved for `positionId` token. Requirements: - `positionId` must exist.*

### isApprovedForAll

```solidity
function isApprovedForAll(address owner, address operator) external view returns (bool)
```

*Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}*

### mint

```solidity
function mint(address pool, int24 lowerOld, int24 lower, int24 upperOld, int24 upper, uint128 amount0Desired, uint128 amount1Desired, uint256 minLiquidity, uint256 positionId) external nonpayable returns (uint256)
```

*Create or add additional Liquidity to a given position of ERC20-ERC20 pair pool*

**Parameters**

| Name           | Type    | Description                                                    |
| -------------- | ------- | -------------------------------------------------------------- |
| pool           | address | target pool                                                    |
| lowerOld       | int24   | previous lower tick                                            |
| lower          | int24   | The lower end of the tick range for the position               |
| upperOld       | int24   | previous upper tick                                            |
| upper          | int24   | The upper end of the tick range for the position               |
| amount0Desired | uint128 | The amount of token0                                           |
| amount1Desired | uint128 | The amount of token1                                           |
| minLiquidity   | uint256 | minimum liquidity to create                                    |
| positionId     | uint256 | create position if position = 0, else add additional liquidity |

### mintNative

```solidity
function mintNative(address pool, int24 lowerOld, int24 lower, int24 upperOld, int24 upper, uint128 amountDesired, uint256 minLiquidity, uint256 positionId) external payable returns (uint256)
```

Create or add additional Liquidity to a given position of ERC20-NATIVE pair pool

**Parameters**

| Name          | Type    | Description                                                    |
| ------------- | ------- | -------------------------------------------------------------- |
| pool          | address | target pool                                                    |
| lowerOld      | int24   | previous lower tick                                            |
| lower         | int24   | The lower end of the tick range for the position               |
| upperOld      | int24   | previous upper tick                                            |
| upper         | int24   | The upper end of the tick range for the position               |
| amountDesired | uint128 | The amount of token                                            |
| minLiquidity  | uint256 | minimum liquidity to create (slippage)                         |
| positionId    | uint256 | create position if position = 0, else add additional liquidity |

### ownerOf

```solidity
function ownerOf(uint256 positionId) external view returns (address owner)
```

*Returns the owner of the `positionId` token. Requirements: - `positionId` must exist.*

### positionFees

```solidity
function positionFees(uint256 positionId) external view returns (uint256 token0amount, uint256 token1amount, uint256 feeGrowthInside0, uint256 feeGrowthInside1)
```

Returns the claimable fees and the fee growth accumulators of a given position

### positions

```solidity
function positions(uint256 positionId) external view returns (struct IConcentratedLiquidityPoolManagerStruct.Position)
```

*return the position information associated with a given token ID.*

### safeTransferFrom

```solidity
function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable
```

*Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.*

### safeTransferFrom

```solidity
function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) external nonpayable
```

*Safely transfers `tokenId` token from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.*

### setApprovalForAll

```solidity
function setApprovalForAll(address operator, bool _approved) external nonpayable
```

*Approve or remove `operator` as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The `operator` cannot be the caller. Emits an {ApprovalForAll} event.*

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

*Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding* [*https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified*](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)*\[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.*

### tokenByIndex

```solidity
function tokenByIndex(uint256 index) external view returns (uint256)
```

*Returns a token ID at a given `index` of all the tokens stored by the contract. Use along with {totalSupply} to enumerate all tokens.*

### tokenOfOwnerByIndex

```solidity
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256)
```

*Returns a token ID owned by `owner` at a given `index` of its token list. Use along with {balanceOf} to enumerate all of `owner`'s tokens.*

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*Returns the total amount of tokens stored by the contract.*

### transferFrom

```solidity
function transferFrom(address from, address to, uint256 tokenId) external nonpayable
```

*Transfers `tokenId` token from `from` to `to`. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event.*

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)
```

### ApprovalForAll

```solidity
event ApprovalForAll(address indexed owner, address indexed operator, bool approved)
```

### CollectFee

```solidity
event CollectFee(address indexed pool, address indexed recipient, uint256 indexed positionId, uint256 token0, uint256 token1)
```

### DecreaseLiquidity

```solidity
event DecreaseLiquidity(address indexed pool, address indexed owner, uint256 indexed positionId, uint256 amount0, uint256 amount1, uint128 liquidity);
```

### IncreaseLiquidity

```solidity
event IncreaseLiquidity(address indexed pool, address indexed owner, uint256 indexed positionId, uint256 amount0, uint256 amount1, uint128 liquidity);
```

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
```

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/concentratedliquiditypoolmanager.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.
