pool.gno

Defines the basic functionality of a liquidity pool such as adding and removing liquidity or performing swaps.

Mint

Mint adds liquidity to a pool. This function can only be called by the Position contract, not by users.

Parameters

Name
Type
Description

cur

realm

Pass cross as argument.

token0Path

string

The path of token0 of the desired pool.

token1Path

string

The path of token1 of the desired pool.

fee

uint32

The fee tier of the desired pool.

tickLower

int32

The lower tick of the price range of the position.

tickUpper

int32

The upper tick of the price range of the position.

liquidityAmount

string

The amount of liquidity to add. This value is calculated by the Position contract based on the amounts of token0 & token1, and the price.

positionCaller

address

The caller address from the position contract.

Return Values

Name
Type
Description

amount0

string

The amount of token0 that added to the liquidity pool to mint the position.

amount1

string

The amount of token1 that added to the liquidity pool to mint the position.

Burn

Burn removes liquidity from a pool. This function can only be called by the Position contract, not by users.

Parameters

Name
Type
Description

cur

realm

Pass cross as argument.

token0Path

string

The path of token0 of the desired pool.

token1Path

string

The path of token1 of the desired pool.

fee

uint32

The fee tier of the desired pool.

tickLower

int32

The lower tick of the price range of the position.

tickUpper

int32

The upper tick of the price range of the position.

liquidityAmount

string

The amount of liquidity to remove.

positionCaller

address

The caller address from the position contract.

Return Values

Name
Type
Description

amount0

string

The amount of token0 that was removed from the pool by burning the position.

amount1

string

The amount of token1 that was removed from the pool by burning the position.

Collect

Collect collects swap fees in token0 and token1 accrued to a position. This function can only be called by the Position contract, not by users.

Parameters

Name
Type
Description

cur

realm

Pass cross as argument.

token0Path

string

The path of token0 of the desired pool.

token1Path

string

The path of token1 of the desired pool.

fee

uint32

The fee tier of the desired pool.

recipient

address

The address that will receive the collected fees.

tickLower

int32

The lower tick of the price range of the position.

tickUpper

int32

The upper tick of the price range of the position.

amount0Requested

string

The maximum amount of token0 to collect from the pool.

amount1Requested

string

The maximum amount of token1 to collect from the pool.

Return Values

Name
Type
Description

amount0

string

The amount of token0 that was collected from the position.

amount1

string

The amount of token1 that was collected from the position.

CollectProtocol

CollectProtocol collects the Protocol Fee claimable from a pool.

Parameters

Name
Type
Description

cur

realm

Pass cross as argument.

token0Path

string

The path of token0 of the desired pool.

token1Path

string

The path of token1 of the desired pool.

fee

uint32

The fee tier of the desired pool.

recipient

address

The address that will receive the collected Protocol Fee.

amount0Requested

string

The maximum amount of token0 to collect from the pool.

amount1Requested

string

The maximum amount of token1 to collect from the pool.

Return Values

Name
Type
Description

amount0

string

The amount of token0 that was collected from the pool.

amount1

string

The amount of token1 that was collected from the pool.

Last updated