Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 source realm

package v1 manages liquidity positions as NFTs in GnoSwap pools.

Overview

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.

Constants 1

const MAX_UINT256

1const MAX_UINT256 string = "115792089237316195423570985008687907853269984665640564039457584007913129639935"
source

Functions 1

Types 9

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}
source

type DecreaseLiquidityParams

struct
1type 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}
source

type FeeGrowthInside

struct
1type FeeGrowthInside struct {
2	feeGrowthInside0LastX128 *u256.Uint
3	feeGrowthInside1LastX128 *u256.Uint
4}
source

FeeGrowthInside represents fee growth inside ticks

type IncreaseLiquidityParams

struct
1type 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}
source

type MintInput

struct
 1type MintInput struct {
 2	token0         string
 3	token1         string
 4	fee            uint32
 5	tickLower      int32
 6	tickUpper      int32
 7	amount0Desired string
 8	amount1Desired string
 9	amount0Min     string
10	amount1Min     string
11	deadline       int64
12	mintTo         address
13	caller         address
14}
source

type 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}
source

type NFTAccessor

interface
1type 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}
source

type ProcessedMintInput

struct
 1type ProcessedMintInput struct {
 2	tokenPair      TokenPair
 3	amount0Desired *u256.Uint
 4	amount1Desired *u256.Uint
 5	amount0Min     *u256.Uint
 6	amount1Min     *u256.Uint
 7	tickLower      int32
 8	tickUpper      int32
 9	poolPath       string
10}
source

type TokenPair

struct
1type TokenPair struct {
2	token0 string
3	token1 string
4}
source

Imports 21

Source Files 15