v1 source realm
package v1 manages liquidity positions as NFTs in GnoSwap pools.
package v1 manages liquidity positions as NFTs in GnoSwap pools.
Each position is represented as a non-transferable GRC721 NFT with concentrated liquidity within a specific tick range. The package handles position lifecycle including minting, liquidity adjustments, fee collection, and repositioning.
1
1
func NewPositionV1
Action9
type AddLiquidityParams
struct 1type AddLiquidityParams struct {
2 poolKey string // poolPath of the pool which has the position
3 tickLower int32 // lower end of the tick range for the position
4 tickUpper int32 // upper end of the tick range for the position
5 amount0Desired *u256.Uint // desired amount of token0 to be minted
6 amount1Desired *u256.Uint // desired amount of token1 to be minted
7 amount0Min *u256.Uint // minimum amount of token0 to be minted
8 amount1Min *u256.Uint // minimum amount of token1 to be minted
9 caller address // address to call the function
10}type DecreaseLiquidityParams
struct1type DecreaseLiquidityParams struct {
2 positionId uint64 // positionId of the position to decrease liquidity
3 liquidity string // amount of liquidity to decrease
4 amount0Min *u256.Uint // minimum amount of token0 to be minted
5 amount1Min *u256.Uint // minimum amount of token1 to be minted
6 deadline int64 // time by which the transaction must be included to effect the change
7 caller address // address to call the function
8}type FeeGrowthInside
structFeeGrowthInside represents fee growth inside ticks
type IncreaseLiquidityParams
struct1type IncreaseLiquidityParams struct {
2 positionId uint64 // positionId of the position to increase liquidity
3 amount0Desired *u256.Uint // desired amount of token0 to be minted
4 amount1Desired *u256.Uint // desired amount of token1 to be minted
5 amount0Min *u256.Uint // minimum amount of token0 to be minted
6 amount1Min *u256.Uint // minimum amount of token1 to be minted
7 deadline int64 // time by which the transaction must be included to effect the change
8 caller address // address to call the function
9}type MintInput
structtype MintParams
struct 1type MintParams struct {
2 token0 string // token0 path for a specific pool
3 token1 string // token1 path for a specific pool
4 fee uint32 // fee for a specific pool
5 tickLower int32 // lower end of the tick range for the position
6 tickUpper int32 // upper end of the tick range for the position
7 amount0Desired *u256.Uint // desired amount of token0 to be minted
8 amount1Desired *u256.Uint // desired amount of token1 to be minted
9 amount0Min *u256.Uint // minimum amount of token0 to be minted
10 amount1Min *u256.Uint // minimum amount of token1 to be minted
11 deadline int64 // time by which the transaction must be included to effect the change
12 mintTo address // address to mint lpToken
13 caller address // address to call the function
14}type NFTAccessor
interface1type NFTAccessor interface {
2 Approve(_ int, rlm realm, approved address, tid grc721.TokenID) error
3 Mint(_ int, rlm realm, to address, tid grc721.TokenID) grc721.TokenID
4 Burn(_ int, rlm realm, tid grc721.TokenID)
5 TotalSupply() int64
6 Exists(tid grc721.TokenID) bool
7 OwnerOf(tid grc721.TokenID) (address, error)
8}type ProcessedMintInput
structtype TokenPair
struct21
- chain stdlib
- errors stdlib
- gno.land/p/gnoswap/consts package
- gno.land/p/gnoswap/deps/tokens/grc721 package
- gno.land/p/gnoswap/gnsmath package
- gno.land/p/gnoswap/rbac package
- gno.land/p/gnoswap/uint256 package
- gno.land/p/gnoswap/utils package
- gno.land/p/nt/ufmt/v0 package
- gno.land/r/gnoswap/access realm
- gno.land/r/gnoswap/common realm
- gno.land/r/gnoswap/emission realm
- gno.land/r/gnoswap/gnft realm
- gno.land/r/gnoswap/halt realm
- gno.land/r/gnoswap/pool realm
- gno.land/r/gnoswap/position realm
- gno.land/r/gnoswap/referral realm
- gno.land/r/gnoswap/staker realm
- strconv stdlib
- strings stdlib
- time stdlib