pool.gno
Last updated
Last updated
Defines the basic functionality of a liquidity pool such as adding and removing liquidity or performing swaps.
Adds liquidity to a pool. This function can only be called by the Position contract, not by users.
Removes liquidity from a pool. This function can only be called by the Position contract, not by users.
Collects swap fees in token0 and token1 accrued to a position. This function can only be called by the Position contract, not by users.
Return Values
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.
Return Values
Sets the Protocol Fee that is applied to all swaps.
Collects the Protocol Fee claimable from a pool.
Return Values
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
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
string
The address that will receive the minted position.
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.
caller
std.Address
The caller address from the position contract
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.
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.
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.
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
string
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 tokens0 to collect from the pool.
amount1Requested
string
The maximum amount of tokens1 to collect from the pool.
amount0
string
The amount of token0 that was collected from the position.
amount1
string
The amount of token1 that was collected from the position.
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
string
The address that will receive the output of the swap.
zeroForOne
bool
The direction of the swap. Set to true for swapping token0 to token1, and false for vice versa.
amountSpecified
string
The amount of tokens to swap. Set to a positive value for an exact input, and a negative value for an exact output.
sqrtPriceLimitX96
string
The maximum price to accept for the swap.
payer
string
The address from which to send the output tokens. (Relates to the Router contract)
amount0
string
The change in the amount of token0 as the result of the swap.
amount1
string
The change in the amount of token1 as the result of the swap.
feeProtocol0
uint8
The Protocol Fee for token0 of the desired pool.
feeProtocol1
uint8
The Protocol Fee for token1 of the desired pool.
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
string
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 tokens1 to collect from the pool.
amount0
string
The amount of token0 that was collected from the pool.
amount1
string
The amount of token1 that was collected from the pool.