ConcentratedLiquidityPoolManager

Contract that creates and burns liquidity positions in the concentrated liquidity pool, and manages the pool's fee collection.

Overview

It is a contract that wraps the pool position in ERC721(NFT) format and includes the following functions :

  • mint position

  • add liquidity to existing position

  • burn position liquidity and withdraw

  • swap fee collection

A user can mint multiple position in a single pool and also transfer the position to other accounts.

Methods

approve

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

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

burn

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

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

getApproved

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

isApprovedForAll

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

mint

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

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

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

positionFees

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

positions

return the position information associated with a given token ID.

safeTransferFrom

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

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

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

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[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.

tokenByIndex

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

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

Returns the total amount of tokens stored by the contract.

transferFrom

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

ApprovalForAll

CollectFee

DecreaseLiquidity

IncreaseLiquidity

Transfer

Last updated