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"

GetPositions

func() *v0.ReadOnlyTree

GetPositions loads the stored tree containing all positions. Returns: - positions: mutable positions tree keyed by decimal position ID; panics when the key is missing or has an unexpected type

Open
OID
076232…53a6:3
GetPositions details

Inspect func

IsBurned

func(positionId uint64) (bool, .uverse.error)

IsBurned reports whether the position's empty-position marker is set. Parameters: - positionId: position NFT token ID Returns: - burned: whether the position's empty-position marker is set - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:5
IsBurned details

Inspect func

IsInRange

func(positionId uint64) (bool, .uverse.error)

IsInRange reports whether a position's ticks contain the current pool tick. Parameters: - positionId: position NFT token ID Returns: - inRange: whether the position is currently in range - err: non-nil when positionId cannot be resolved or the associated pool tick cannot be read

Open
OID
076232…53a6:6
IsInRange details

Inspect func

GetPositionTokenBalances

func(positionId uint64) (int64, int64, .uverse.error)

GetPositionTokenBalances calculates the current token0/token1 balances for a position from its liquidity, tick range, and pool price. These are derived balances, not permanently stored token amounts. Parameters: - positionId: position NFT token ID Returns: - balance0: current token0 balance - balance1: current token1 balance - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:7
GetPositionTokenBalances details

Inspect func

GetPositionToken0Balance

func(positionId uint64) (int64, .uverse.error)

GetPositionToken0Balance returns the token0 balance associated with a position. Parameters: - positionId: position NFT token ID Returns: - balance: token0 balance - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:8
GetPositionToken0Balance details

Inspect func

GetPositionToken1Balance

func(positionId uint64) (int64, .uverse.error)

GetPositionToken1Balance returns the token1 balance associated with a position. Parameters: - positionId: position NFT token ID Returns: - balance: token1 balance - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:9
GetPositionToken1Balance details

Inspect func

GetPositionFeeGrowthInside0LastX128

func(positionId uint64) (string, .uverse.error)

GetPositionFeeGrowthInside0LastX128 returns the last fee-growth checkpoint inside the position's range for token0. Parameters: - positionId: position NFT token ID whose token0 fee-growth checkpoint is queried Returns: - feeGrowthInside0LastX128: token0 fee-growth checkpoint, represented as a decimal string - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:10
GetPositionFeeGrowthInside0LastX128 details

Inspect func

GetPositionFeeGrowthInside1LastX128

func(positionId uint64) (string, .uverse.error)

GetPositionFeeGrowthInside1LastX128 returns the last fee-growth checkpoint inside the position's range for token1. Parameters: - positionId: position NFT token ID whose token1 fee-growth checkpoint is queried Returns: - feeGrowthInside1LastX128: token1 fee-growth checkpoint, represented as a decimal string - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:11
GetPositionFeeGrowthInside1LastX128 details

Inspect func

GetPositionFeeGrowthInsideLastX128

func(positionId uint64) (string, string, .uverse.error)

GetPositionFeeGrowthInsideLastX128 returns the last fee-growth checkpoints inside the position's range for both tokens. Parameters: - positionId: position NFT token ID whose fee-growth checkpoints are queried Returns: - feeGrowthInside0LastX128: token0 fee-growth checkpoint, represented as a decimal string - feeGrowthInside1LastX128: token1 fee-growth checkpoint, represented as a decimal string - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:12
GetPositionFeeGrowthInsideLastX128 details

Inspect func

GetPositionLiquidity

func(positionId uint64) (string, .uverse.error)

GetPositionLiquidity returns the stored liquidity amount of a position. Parameters: - positionId: position NFT token ID whose liquidity is queried Returns: - liquidity: position liquidity, represented as a decimal string - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:13
GetPositionLiquidity details

Inspect func

GetPositionOperator

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

Inspect func

GetPositionPoolKey

func(positionId uint64) (string, .uverse.error)

GetPositionPoolKey returns the pool key associated with a position. Parameters: - positionId: position NFT token ID whose pool association is queried Returns: - poolKey: canonical pool key used by the position - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:15
GetPositionPoolKey details

Inspect func

GetPositionTickLower

func(positionId uint64) (int32, .uverse.error)

GetPositionTickLower returns the lower tick boundary of a position. Parameters: - positionId: position NFT token ID whose lower tick is queried Returns: - tickLower: lower tick boundary of the position's price range - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:16
GetPositionTickLower details

Inspect func

GetPositionTickUpper

func(positionId uint64) (int32, .uverse.error)

GetPositionTickUpper returns the upper tick boundary of a position. Parameters: - positionId: position NFT token ID whose upper tick is queried Returns: - tickUpper: upper tick boundary of the position's price range - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:17
GetPositionTickUpper details

Inspect func

GetPositionTicks

func(positionId uint64) (int32, int32, .uverse.error)

GetPositionTicks returns the lower and upper tick boundaries of a position. Parameters: - positionId: position NFT token ID whose tick range is queried Returns: - tickLower: lower tick boundary of the position's price range - tickUpper: upper tick boundary of the position's price range - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:18
GetPositionTicks details

Inspect func

GetPositionTokensOwed0

func(positionId uint64) (int64, .uverse.error)

GetPositionTokensOwed0 returns the token0 amount accrued and owed to a position. Parameters: - positionId: position NFT token ID whose token0 debt is queried Returns: - tokensOwed0: token0 amount currently owed to the position - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:19
GetPositionTokensOwed0 details

Inspect func

GetPositionTokensOwed1

func(positionId uint64) (int64, .uverse.error)

GetPositionTokensOwed1 returns the token1 amount accrued and owed to a position. Parameters: - positionId: position NFT token ID whose token1 debt is queried Returns: - tokensOwed1: token1 amount currently owed to the position - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:20
GetPositionTokensOwed1 details

Inspect func

GetPositionTokensOwed

func(positionId uint64) (int64, int64, .uverse.error)

GetPositionTokensOwed returns the token0 and token1 amounts accrued and owed to a position. Parameters: - positionId: position NFT token ID whose accrued token debt is queried Returns: - tokensOwed0: token0 amount currently owed to the position - tokensOwed1: token1 amount currently owed to the position - err: non-nil when positionId cannot be resolved

Open
OID
076232…53a6:21
GetPositionTokensOwed details

Inspect func

GetUnclaimedFee

func(positionId uint64) (string, string, .uverse.error)

GetUnclaimedFee returns the unclaimed fees for both tokens of a position as decimal strings. Parameters: - positionId: position NFT token ID whose unclaimed fees are queried Returns: - fee0: unclaimed token0 fee amount, represented as a decimal string - fee1: unclaimed token1 fee amount, represented as a decimal string - err: non-nil when positionId or the associated pool fee-growth data cannot be resolved

Open
OID
076232…53a6:22
GetUnclaimedFee details

Inspect func

GetPositionOwner

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

Inspect func

Position

type

Position represents a liquidity position in a pool. Each position tracks liquidity, fee-growth checkpoints, tokens owed, and a burned marker for the position NFT. 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

NewPosition constructs a position from its persisted pool, range, liquidity, fee-growth, owed-token, marker, and operator values. Parameters: - poolKey: pool key encoding the position's token pair and fee tier - tickLower: lower tick boundary of the position's range - tickUpper: upper tick boundary of the position's range - liquidity: decimal string representing the position's liquidity - feeGrowthInside0LastX128: decimal-encoded Q128 token0 fee-growth checkpoint - feeGrowthInside1LastX128: decimal-encoded Q128 token1 fee-growth checkpoint - tokensOwed0: accrued token0 amount awaiting collection, in token units - tokensOwed1: accrued token1 amount awaiting collection, in token units - burned: empty-position marker to store - operator: approved operator address; the empty address means no operator Returns: - position: pointer to a position initialized with all supplied values

Open
OID
076232…53a6:26
NewPosition details

Inspect func

NewPositionsTree

func() *v0.BPTree

NewPositionsTree allocates an empty BP-tree for position entries under the position realm context. Returns: - positionsTree: empty position BP-tree allocated with fanout 16

Open
OID
076232…53a6:27
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: - cur: current realm context; callers use cross(cur) when crossing into this realm - token0: path of the first token in the pool - token1: path of the second token in the pool - fee: pool fee tier used to identify the pool - tickLower: lower tick boundary of the position's price range - tickUpper: upper tick boundary of the position's price range - amount0Desired: desired amount of token0 to provide - amount1Desired: desired amount of token1 to provide - amount0Min: minimum acceptable amount of token0 after price/slippage calculation - amount1Min: minimum acceptable amount of token1 after price/slippage calculation - deadline: transaction expiration timestamp - mintTo: recipient address of the position NFT - referrer: referrer identifier used for reward tracking Returns: - positionId: newly minted position NFT token ID - liquidity: liquidity minted into the position, represented as a decimal string - amount0: actual amount of token0 added to the position, represented as a decimal string - amount1: actual amount of token1 added to the position, represented as a decimal string Halt check: reverts while the Position halt scope is active.

Open
OID
076232…53a6:28
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: - cur: current realm context; callers use cross(cur) when crossing into this realm - positionId: position NFT token ID to increase - amount0DesiredStr: desired token0 amount, represented as a decimal string - amount1DesiredStr: desired token1 amount, represented as a decimal string - amount0MinStr: minimum acceptable token0 amount for slippage protection - amount1MinStr: minimum acceptable token1 amount for slippage protection - deadline: transaction expiration timestamp Returns: - positionId: position NFT token ID that received the liquidity - liquidity: liquidity amount added to the position (the delta), represented as a decimal string - amount0: actual token0 amount added, represented as a decimal string - amount1: actual token1 amount added, represented as a decimal string - poolKey: canonical pool key for the position Halt check: reverts while the Position halt scope is active.

Open
OID
076232…53a6:30
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: - cur: current realm context; callers use cross(cur) when crossing into this realm - positionId: position NFT token ID to decrease - liquidityStr: liquidity amount to remove, represented as a decimal string - amount0MinStr: minimum acceptable token0 amount for slippage protection - amount1MinStr: minimum acceptable token1 amount for slippage protection - deadline: transaction expiration timestamp The accrued swap fees are collected first, so the returned fee amounts are net of the withdrawal fee while the returned principal is not subject to it. Returns: - positionId: position NFT token ID that had liquidity removed - liquidity: removed liquidity amount, represented as a decimal string - fee0: token0 fees collected, net of the withdrawal fee - fee1: token1 fees collected, net of the withdrawal fee - amount0: principal amount of token0 returned to the caller - amount1: principal amount of token1 returned to the caller - poolKey: canonical pool key for the position Halt check: reverts while the Withdraw halt scope is active.

Open
OID
076232…53a6:31
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: - cur: current realm context; callers use cross(cur) when crossing into this realm - positionId: position NFT token ID to reposition - tickLower: new lower tick boundary of the position's price range - tickUpper: new upper tick boundary of the position's price range - amount0DesiredStr: desired token0 amount for the new range, represented as a decimal string - amount1DesiredStr: desired token1 amount for the new range, represented as a decimal string - amount0MinStr: minimum acceptable token0 amount for slippage protection - amount1MinStr: minimum acceptable token1 amount for slippage protection - deadline: transaction expiration timestamp Returns: - positionId: position NFT token ID that was repositioned - liquidity: new liquidity amount, represented as a decimal string - tickLower: new lower tick boundary - tickUpper: new upper tick boundary - amount0: actual token0 amount added to the new range, represented as a decimal string - amount1: actual token1 amount added to the new range, represented as a decimal string Halt check: reverts while the Position halt scope is active.

Open
OID
076232…53a6:32
Reposition details

Inspect func

CollectFee

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

CollectFee collects accumulated fees from a position. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - positionId: position NFT token ID whose fees are collected Returns: - positionId: position NFT token ID whose fees were collected - tokensCollected0: token0 fees paid out to the caller, net of the withdrawal fee - tokensCollected1: token1 fees paid out to the caller, net of the withdrawal fee - poolKey: canonical pool key for the position - totalAmount0: token0 fees collected before the withdrawal fee - totalAmount1: token1 fees collected before the withdrawal fee Halt check: reverts while the Withdraw halt scope is active.

Open
OID
076232…53a6:33
CollectFee details

Inspect func

SetPositionOperator

func(positionId uint64, operator .uverse.address)

SetPositionOperator sets an operator for a position. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - positionId: position NFT token ID whose operator is changed - operator: operator address to approve; the zero address removes the operator

Open
OID
076232…53a6:34
SetPositionOperator details

Inspect func

Render

func(path string) string

Render delegates web rendering to the active implementation.

Open
OID
076232…53a6:35
Render details

Inspect func

domainPath

string

Value

"gno.land/r/gnoswap/position"

initializeDomainStore

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

Inspect func

getImplementation

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

Inspect func

updateImplementation

func() .uverse.error
Open
OID
076232…53a6:45
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 v1.KVStore) position.IPositionStore

NewPositionStore creates a position store backed by the provided KV store. The upgrade system uses it to construct storage instances for each implementation. Parameters: - kvStore: Domain-owned KV store shared by position implementations. Returns: - IPositionStore: Position storage wrapper backed by the supplied store.

Open
OID
076232…53a6:46
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. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - initializer: callback that receives the implementation realm context and position store, then returns that version's IPosition implementation 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:48
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. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - packagePath: fully qualified package path of a previously registered replacement implementation Security: Only admin or governance can perform upgrades. The new implementation must have been previously registered via RegisterInitializer.

Open
OID
076232…53a6:50
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation

Open
OID
076232…53a6:51
GetImplementationPackagePath details

Inspect func
ErrSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
GetPositions : func() *v0.ReadOnlyTree Inspect
IsBurned : func(positionId uint64) (bool, .uverse.error) Inspect
IsInRange : func(positionId uint64) (bool, .uverse.error) Inspect
GetPositionTokenBalances : func(positionId uint64) (int64, int64, .uverse.error) Inspect
GetPositionToken0Balance : func(positionId uint64) (int64, .uverse.error) Inspect
GetPositionToken1Balance : func(positionId uint64) (int64, .uverse.error) Inspect
GetPositionFeeGrowthInside0LastX128 : func(positionId uint64) (string, .uverse.error) Inspect
GetPositionFeeGrowthInside1LastX128 : func(positionId uint64) (string, .uverse.error) Inspect
GetPositionFeeGrowthInsideLastX128 : func(positionId uint64) (string, string, .uverse.error) Inspect
GetPositionLiquidity : func(positionId uint64) (string, .uverse.error) Inspect
GetPositionOperator : func(positionId uint64) (.uverse.address, .uverse.error) Inspect
GetPositionPoolKey : func(positionId uint64) (string, .uverse.error) Inspect
GetPositionTickLower : func(positionId uint64) (int32, .uverse.error) Inspect
GetPositionTickUpper : func(positionId uint64) (int32, .uverse.error) Inspect
GetPositionTicks : func(positionId uint64) (int32, int32, .uverse.error) Inspect
GetPositionTokensOwed0 : func(positionId uint64) (int64, .uverse.error) Inspect
GetPositionTokensOwed1 : func(positionId uint64) (int64, .uverse.error) Inspect
GetPositionTokensOwed : func(positionId uint64) (int64, int64, .uverse.error) Inspect
GetUnclaimedFee : func(positionId uint64) (string, string, .uverse.error) Inspect
GetPositionOwner : func(positionId uint64) (.uverse.address, .uverse.error) 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
Render : func(path string) string Inspect
domainPath : string ="gno.land/r/gnoswap/position"
kvStore : *v1.kvStore Inspect
versionManager : *v1.versionManager Inspect
implementation : *v1.positionV1 Inspect
init.36 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore v1.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 v1.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