pool.gno

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

Mint

func Mint(
	token0Path string,
	token1Path string,
	fee uint32,
	recipient string,
	tickLower int32,
	tickUpper int32,
	_liquidityAmount string,
) (string, string)

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

Parameters

Return Values

Burn

func Burn(
	token0Path string,
	token1Path string,
	fee uint32,
	tickLower int32,
	tickUpper int32,
	_liquidityAmount string,
) (string, string)

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

Parameters

Return Values

Collect

func Collect(
	token0Path string,
	token1Path string,
	fee uint32,
	recipient string,
	tickLower int32,
	tickUpper int32,
	amount0Requested string,
	amount1Requested string,
) (string, string)

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

Return Values

Swap

func Swap(
	token0Path string,
	token1Path string,
	fee uint32,
	recipient string,
	zeroForOne bool,
	amountSpecified string,
	sqrtPriceLimitX96 string,
	payer string, // router
) (string, string)

Swaps tokens from a pool from token0 to token1, or vice versa. This function can only be called by the Router contract, not by users.

Parameters

Return Values

SetFeeProtocol

func SetFeeProtocol(
	feeProtocol0 uint8,
	feeProtocol1 uint8,
)

Sets the Protocol Fee that is applied to all swaps.

Parameters

CollectProtocol

func CollectProtocol(
	token0Path string,
	token1Path string,
	fee uint32,
	recipient string,
	amount0Requested string,
	amount1Requested string,
) (string, string)

Collects the Protocol Fee claimable from a pool.

Parameters

Return Values

Last updated