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

position state

Back to all declarations

ErrSpoofedRealm

untyped string

Value

"rlm does not match the current crossing frame"

GetPositionCount

func() int

GetPositionCount returns the total number of positions.

Open
OID
076232…53a6:3
GetPositionCount details

Inspect func

GetPositionIDs

func(offset int, count int) []uint64

GetPositionIDs returns a paginated list of position IDs.

Open
OID
076232…53a6:5
GetPositionIDs details

Inspect func

GetPosition

func(positionId uint64) (position.Position, .uverse.error)

GetPosition returns the position data for a given position ID.

Open
OID
076232…53a6:6
GetPosition details

Inspect func

IsBurned

func(positionId uint64) bool

IsBurned returns whether a position has been burned.

Open
OID
076232…53a6:7
IsBurned details

Inspect func

IsInRange

func(positionId uint64) bool

IsInRange returns whether a position's ticks are within the current price range.

Open
OID
076232…53a6:8
IsInRange details

Inspect func

GetPositionTokenBalances

func(positionId uint64) (int64, int64)

GetPositionTokenBalances returns the token0 balance of a position.

Open
OID
076232…53a6:9
GetPositionTokenBalances details

Inspect func

GetPositionToken0Balance

func(positionId uint64) int64
Open
OID
076232…53a6:10
GetPositionToken0Balance details

Inspect func

GetPositionToken1Balance

func(positionId uint64) int64
Open
OID
076232…53a6:11
GetPositionToken1Balance details

Inspect func

GetPositionFeeGrowthInside0LastX128

func(positionId uint64) string

GetPositionFeeGrowthInside0LastX128 returns the last recorded fee growth inside for token0.

Open
OID
076232…53a6:12
GetPositionFeeGrowthInside0LastX128 details

Inspect func

GetPositionFeeGrowthInside1LastX128

func(positionId uint64) string

GetPositionFeeGrowthInside1LastX128 returns the last recorded fee growth inside for token1.

Open
OID
076232…53a6:13
GetPositionFeeGrowthInside1LastX128 details

Inspect func

GetPositionFeeGrowthInsideLastX128

func(positionId uint64) (string, string)

GetPositionFeeGrowthInsideLastX128 returns the last recorded fee growth inside for both tokens.

Open
OID
076232…53a6:14
GetPositionFeeGrowthInsideLastX128 details

Inspect func

GetPositionLiquidity

func(positionId uint64) string

GetPositionLiquidity returns the liquidity amount of a position.

Open
OID
076232…53a6:15
GetPositionLiquidity details

Inspect func

GetPositionOperator

func(positionId uint64) .uverse.address
Open
OID
076232…53a6:16
GetPositionOperator details

Inspect func

GetPositionPoolKey

func(positionId uint64) string

GetPositionPoolKey returns the pool key of a position.

Open
OID
076232…53a6:17
GetPositionPoolKey details

Inspect func

GetPositionTickLower

func(positionId uint64) int32

GetPositionTickLower returns the lower tick of a position.

Open
OID
076232…53a6:18
GetPositionTickLower details

Inspect func

GetPositionTickUpper

func(positionId uint64) int32

GetPositionTickUpper returns the upper tick of a position.

Open
OID
076232…53a6:19
GetPositionTickUpper details

Inspect func

GetPositionTicks

func(positionId uint64) (int32, int32)

GetPositionTicks returns the lower and upper ticks of a position.

Open
OID
076232…53a6:20
GetPositionTicks details

Inspect func

GetPositionTokensOwed0

func(positionId uint64) int64

GetPositionTokensOwed0 returns the amount of token0 owed to a position.

Open
OID
076232…53a6:21
GetPositionTokensOwed0 details

Inspect func

GetPositionTokensOwed1

func(positionId uint64) int64

GetPositionTokensOwed1 returns the amount of token1 owed to a position.

Open
OID
076232…53a6:22
GetPositionTokensOwed1 details

Inspect func

GetPositionTokensOwed

func(positionId uint64) (int64, int64)

GetPositionTokensOwed returns the amount of tokens owed to a position.

Open
OID
076232…53a6:23
GetPositionTokensOwed details

Inspect func

GetUnclaimedFee

func(positionId uint64) (string, string)

GetUnclaimedFee returns the unclaimed fees for both tokens of a position.

Open
OID
076232…53a6:24
GetUnclaimedFee details

Inspect func

GetPositionOwner

func(positionId uint64) .uverse.address
Open
OID
076232…53a6:25
GetPositionOwner details

Inspect func

clonePosition

func(position position.Position) position.Position
Open
OID
076232…53a6:26
clonePosition details

Inspect func

cloneUint64Slice

func(src []uint64) []uint64
Open
OID
076232…53a6:28
cloneUint64Slice details

Inspect func

Position

type

Position represents a liquidity position in a pool. Each position tracks the amount of liquidity, fee growth, and tokens owed to the position owner. All uint256 fields are stored as decimal strings to reduce realm object overhead.

Value

position.Position

NewPosition

func(poolKey string, tickLower int32, tickUpper int32, liquidity string, feeGrowthInside0LastX128 string, feeGrowthInside1LastX128 string, tokensOwed0 int64, tokensOwed1 int64, burned bool, operator .uverse.address) *position.Position
Open
OID
076232…53a6:31
NewPosition details

Inspect func

NewPositionsTree

func() *v0.BPTree

NewPositionsTree allocates the positions BP-tree under /r/gnoswap/position's realm context (the realm that declares Position).

Open
OID
076232…53a6:32
NewPositionsTree details

Inspect func

Mint

func(token0 string, token1 string, fee uint32, tickLower int32, tickUpper int32, amount0Desired string, amount1Desired string, amount0Min string, amount1Min string, deadline int64, mintTo .uverse.address, referrer string) (uint64, string, string, string)

Mint creates a new liquidity position NFT. Parameters: - token0: path of the first token - token1: path of the second token - fee: pool fee tier - tickLower: lower tick boundary - tickUpper: upper tick boundary - amount0Desired: desired amount of token0 - amount1Desired: desired amount of token1 - amount0Min: minimum amount of token0 - amount1Min: minimum amount of token1 - deadline: transaction deadline - mintTo: recipient of the position NFT - referrer: referrer address for reward tracking Returns: - uint64: position ID - string: liquidity amount - string: amount of token0 added - string: amount of token1 added

Open
OID
076232…53a6:33
Mint details

Inspect func

IncreaseLiquidity

func(positionId uint64, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, string, string, string)

IncreaseLiquidity adds liquidity to an existing position. Parameters: - positionId: ID of the position - amount0DesiredStr: desired amount of token0 - amount1DesiredStr: desired amount of token1 - amount0MinStr: minimum amount of token0 - amount1MinStr: minimum amount of token1 - deadline: transaction deadline Returns: - uint64: position ID - string: new liquidity amount - string: amount of token0 added - string: amount of token1 added - string: pool path

Open
OID
076232…53a6:35
IncreaseLiquidity details

Inspect func

DecreaseLiquidity

func(positionId uint64, liquidityStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, string, string, string, string, string)

DecreaseLiquidity removes liquidity from a position. Parameters: - positionId: ID of the position - liquidityStr: amount of liquidity to remove - amount0MinStr: minimum amount of token0 - amount1MinStr: minimum amount of token1 - deadline: transaction deadline Returns: - uint64: position ID - string: removed liquidity amount - string: amount of token0 removed - string: amount of token1 removed - string: pool path - string: net amount of token0 after fees - string: net amount of token1 after fees

Open
OID
076232…53a6:36
DecreaseLiquidity details

Inspect func

Reposition

func(positionId uint64, tickLower int32, tickUpper int32, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, int32, int32, string, string)

Reposition changes the tick range of a position. Parameters: - positionId: ID of the position - tickLower: new lower tick boundary - tickUpper: new upper tick boundary - amount0DesiredStr: desired amount of token0 - amount1DesiredStr: desired amount of token1 - amount0MinStr: minimum amount of token0 - amount1MinStr: minimum amount of token1 - deadline: transaction deadline Returns: - uint64: position ID - string: new liquidity amount - int32: new lower tick - int32: new upper tick - string: amount of token0 used - string: amount of token1 used

Open
OID
076232…53a6:37
Reposition details

Inspect func

CollectFee

func(positionId uint64) (uint64, string, string, string, string, string)

CollectFee collects accumulated fees from a position. Parameters: - positionId: ID of the position Returns: - uint64: position ID - string: amount of token0 collected - string: amount of token1 collected - string: pool path - string: token0 path - string: token1 path

Open
OID
076232…53a6:38
CollectFee details

Inspect func

SetPositionOperator

func(positionId uint64, operator .uverse.address)

SetPositionOperator sets an operator for a position. Parameters: - positionId: ID of the position - operator: address of the operator

Open
OID
076232…53a6:39
SetPositionOperator details

Inspect func

domainPath

string

Value

"gno.land/r/gnoswap/position"

versionManager

*version_manager.versionManager
Open
OID
076232…53a6:61
versionManager details

Inspect pointer

initializeDomainStore

func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...}
Open
OID
076232…53a6:46
initializeDomainStore details

Inspect func

getImplementation

func() position.IPosition
Open
OID
076232…53a6:47
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
076232…53a6:48
updateImplementation details

Inspect func

StoreKey

type

Value

position.StoreKey

StoreKeyPositions

position.StoreKey

// Positions

Value

<gnolang.StringValue>

StoreKeyPositionNextID

position.StoreKey

// Position next ID

Value

<gnolang.StringValue>

positionStore

type

Value

position.positionStore

NewPositionStore

func(kvStore store.KVStore) position.IPositionStore

NewPositionStore creates a new protocol fee store instance with the provided KV store. This function is used by the upgrade system to create storage instances for each implementation.

Open
OID
076232…53a6:49
NewPositionStore details

Inspect func

IPosition

type

Value

position.IPosition

IPositionManager

type

Value

position.IPositionManager

IPositionGetter

type

Value

position.IPositionGetter

IPositionStore

type

Value

position.IPositionStore

RegisterInitializer

func(initializer func(...))

RegisterInitializer registers a new position implementation version. This function is called by each version (v1, v2, etc.) during initialization to register their implementation with the proxy system. The initializer function creates a new instance of the implementation using the provided positionStore interface. Security: Only contracts within the domain path can register initializers. Each package path can only register once to prevent duplicate registrations.

Open
OID
076232…53a6:51
RegisterInitializer details

Inspect func

UpgradeImpl

func(packagePath string)

UpgradeImpl switches the active position implementation to a different version. This function allows seamless upgrades from one version to another without data migration or downtime. Security: Only admin or governance can perform upgrades. The new implementation must have been previously registered via RegisterInitializer.

Open
OID
076232…53a6:53
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation.

Open
OID
076232…53a6:54
GetImplementationPackagePath details

Inspect func
ErrSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
GetPositionCount : func() int Inspect
GetPositionIDs : func(offset int, count int) []uint64 Inspect
GetPosition : func(positionId uint64) (position.Position, .uverse.error) Inspect
IsBurned : func(positionId uint64) bool Inspect
IsInRange : func(positionId uint64) bool Inspect
GetPositionTokenBalances : func(positionId uint64) (int64, int64) Inspect
GetPositionToken0Balance : func(positionId uint64) int64 Inspect
GetPositionToken1Balance : func(positionId uint64) int64 Inspect
GetPositionFeeGrowthInside0LastX128 : func(positionId uint64) string Inspect
GetPositionFeeGrowthInside1LastX128 : func(positionId uint64) string Inspect
GetPositionFeeGrowthInsideLastX128 : func(positionId uint64) (string, string) Inspect
GetPositionLiquidity : func(positionId uint64) string Inspect
GetPositionOperator : func(positionId uint64) .uverse.address Inspect
GetPositionPoolKey : func(positionId uint64) string Inspect
GetPositionTickLower : func(positionId uint64) int32 Inspect
GetPositionTickUpper : func(positionId uint64) int32 Inspect
GetPositionTicks : func(positionId uint64) (int32, int32) Inspect
GetPositionTokensOwed0 : func(positionId uint64) int64 Inspect
GetPositionTokensOwed1 : func(positionId uint64) int64 Inspect
GetPositionTokensOwed : func(positionId uint64) (int64, int64) Inspect
GetUnclaimedFee : func(positionId uint64) (string, string) Inspect
GetPositionOwner : func(positionId uint64) .uverse.address Inspect
clonePosition : func(position position.Position) position.Position Inspect
cloneUint64Slice : func(src []uint64) []uint64 Inspect
Position : type =position.Position
isZeroStr : func(s string) bool Inspect
NewPosition : func(poolKey string, tickLower int32, tickUpper int32, liquidity string, feeGrowthInside0LastX128 string, feeGrowthInside1LastX128 string, tokensOwed0 int64, tokensOwed1 int64, burned bool, operator .uverse.address) *position.Position Inspect
NewPositionsTree : func() *v0.BPTree Inspect
Mint : func(token0 string, token1 string, fee uint32, tickLower int32, tickUpper int32, amount0Desired string, amount1Desired string, amount0Min string, amount1Min string, deadline int64, mintTo .uverse.address, referrer string) (uint64, string, string, string) Inspect
IncreaseLiquidity : func(positionId uint64, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, string, string, string) Inspect
DecreaseLiquidity : func(positionId uint64, liquidityStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, string, string, string, string, string) Inspect
Reposition : func(positionId uint64, tickLower int32, tickUpper int32, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, int32, int32, string, string) Inspect
CollectFee : func(positionId uint64) (uint64, string, string, string, string, string) Inspect
SetPositionOperator : func(positionId uint64, operator .uverse.address) Inspect
domainPath : string ="gno.land/r/gnoswap/position"
kvStore : *store.kvStore Inspect
versionManager : *version_manager.versionManager Inspect
implementation : *v1.positionV1 Inspect
init.39 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...} Inspect
getImplementation : func() position.IPosition Inspect
updateImplementation : func() .uverse.error Inspect
StoreKey : type =position.StoreKey
StoreKeyPositions : position.StoreKey =<gnolang.StringValue>
StoreKeyPositionNextID : position.StoreKey =<gnolang.StringValue>
positionStore : type =position.positionStore
NewPositionStore : func(kvStore store.KVStore) position.IPositionStore Inspect
IPosition : type =position.IPosition
IPositionManager : type =position.IPositionManager
IPositionGetter : type =position.IPositionGetter
IPositionStore : type =position.IPositionStore
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(packagePath string) Inspect
GetImplementationPackagePath : func() string Inspect