position.gno
Adds or removes liquidity from pools. Includes minting and burning of positions.
Mint
Adds liquidity to a pool. Internally calls the mint
function of the pool contract.
Parameters
Name | Type | Description |
---|---|---|
| string | The path of the token0 of the desired pool. |
| string | The path of the token1 of the desired pool. |
| uint32 | The fee tier of the pool. |
| int32 | The lower tick of the price range of the position. |
| int32 | The upper tick of the price range of the position. |
| string | The maximum amount of token0 to add. |
| string | The maximum amount of token1 to add. |
| string | The minimum amount of token0 to add. |
| string | The minimum amount of token1 to add. |
| int64 | The deadline at which the transaction will expire. |
| string | The address to receive the minted position. |
Return Values
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position that was minted. |
| string | The amount of liquidity added to the pool. |
| string | The amount of token0 added to the pool. |
| string | The amount of token1 added to the pool. |
IncreaseLiquidity
Adds additional liquidity to an existing position. Calling this function on a closed position will reopen it.
Parameters
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position NFT in which to increase liquidity. |
| string | The maximum amount of token0 to increase. |
| string | The maximum amount of token1 to increase. |
| string | The minimum amount of token0 to increase. |
| string | The minimum amount of token1 to increase. |
| int64 | The deadline at which the transaction will expire. |
Return Values
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position that the liquidity was increased. |
| string | The amount of liquidity added to the position. |
| string | The amount of token0 added to the position. |
| string | The amount of token1 added to the position. |
| string | The path of the pool from which the position exists. |
DecreaseLiquidity
Decreases liquidity of an existing position.
Parameters
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position to decrease liquidity from. |
| string | The amount of liquidity to decrease. |
| string | The minimum amount of token0 to decrease. |
| string | The minimum amount of token1 to decrease. |
| int64 | The deadline at which the transaction will expire. |
| bool | Whether or not to receive tokens in native |
Return Values
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position that the liquidity was decreased. |
| string | The amount of liquidity decreased from the position. |
| string | The amount of token0 fees collected. |
| string | The amount of token1 fees collected. |
| string | The amount of token0 decreased from the position. |
| string | The amount of token1 decreased from the position. |
| string | The path of the pool in which the position exists. |
CollectFee
Collects fee accrued to a position.
Parameters
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position. |
Return Values
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position. |
| string | The amount of token0 that was collected. |
| string | The amount of token1 that was collected. |
| string | The path of the pool from which the position exists. |
Reposition
Modifies the price range of a closed position while maintaining the LpTokenId
.
Parameters
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position. |
| int32 | The lower tick of the price range of the position. |
| int32 | The upper tick of the price range of the position. |
| string | The maximum amount of token0 to add. |
| string | The maximum amount of token1 to add. |
Return Values
Name | Type | Description |
---|---|---|
| uint64 | The ID of the position. |
| string | The new liquidity amount. |
| int32 | The modified lower tick. |
| int32 | The modified upper tick. |
| string | The amount of token0 added to the position. |
| string | The amount of token1 added to the position. |
Last updated