ErrSpoofedRealm
untyped stringValue
"rlm does not match the current crossing frame"
GetPositions
func() *v0.ReadOnlyTreeGetPositions 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
- OID
- 076232…53a6:3
GetPositions details
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
- OID
- 076232…53a6:5
IsBurned details
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
- OID
- 076232…53a6:6
IsInRange details
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
- OID
- 076232…53a6:7
GetPositionTokenBalances details
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
- OID
- 076232…53a6:8
GetPositionToken0Balance details
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
- OID
- 076232…53a6:9
GetPositionToken1Balance details
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
- OID
- 076232…53a6:10
GetPositionFeeGrowthInside0LastX128 details
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
- OID
- 076232…53a6:11
GetPositionFeeGrowthInside1LastX128 details
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
- OID
- 076232…53a6:12
GetPositionFeeGrowthInsideLastX128 details
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
- OID
- 076232…53a6:13
GetPositionLiquidity details
GetPositionOperator
func(positionId uint64) (.uverse.address, .uverse.error)- OID
- 076232…53a6:14
GetPositionOperator details
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
- OID
- 076232…53a6:15
GetPositionPoolKey details
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
- OID
- 076232…53a6:16
GetPositionTickLower details
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
- OID
- 076232…53a6:17
GetPositionTickUpper details
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
- OID
- 076232…53a6:18
GetPositionTicks details
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
- OID
- 076232…53a6:19
GetPositionTokensOwed0 details
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
- OID
- 076232…53a6:20
GetPositionTokensOwed1 details
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
- OID
- 076232…53a6:21
GetPositionTokensOwed details
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
- OID
- 076232…53a6:22
GetUnclaimedFee details
GetPositionOwner
func(positionId uint64) (.uverse.address, .uverse.error)- OID
- 076232…53a6:23
GetPositionOwner details
Position
typePosition 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
isZeroStr
func(s string) bool- OID
- 076232…53a6:24
isZeroStr details
NewPosition
func(poolKey string, tickLower int32, tickUpper int32, liquidity string, feeGrowthInside0LastX128 string, feeGrowthInside1LastX128 string, tokensOwed0 int64, tokensOwed1 int64, burned bool, operator .uverse.address) *position.PositionNewPosition 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
- OID
- 076232…53a6:26
NewPosition details
NewPositionsTree
func() *v0.BPTreeNewPositionsTree allocates an empty BP-tree for position entries under the position realm context. Returns: - positionsTree: empty position BP-tree allocated with fanout 16
- OID
- 076232…53a6:27
NewPositionsTree details
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.
- OID
- 076232…53a6:28
Mint details
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.
- OID
- 076232…53a6:30
IncreaseLiquidity details
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.
- OID
- 076232…53a6:31
DecreaseLiquidity details
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.
- OID
- 076232…53a6:32
Reposition details
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.
- OID
- 076232…53a6:33
CollectFee details
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
- OID
- 076232…53a6:34
SetPositionOperator details
Render
func(path string) stringRender delegates web rendering to the active implementation.
- OID
- 076232…53a6:35
Render details
domainPath
stringValue
"gno.land/r/gnoswap/position"
kvStore
*v1.kvStore- OID
- 076232…53a6:55
kvStore details
versionManager
*v1.versionManager- OID
- 076232…53a6:59
versionManager details
implementation
*v1.positionV1- OID
- 07aca3…f308:51
implementation details
init.36
func()- OID
- 076232…53a6:41
init.36 details
initializeDomainStore
func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}- OID
- 076232…53a6:43
initializeDomainStore details
getImplementation
func() position.IPosition- OID
- 076232…53a6:44
getImplementation details
updateImplementation
func() .uverse.error- OID
- 076232…53a6:45
updateImplementation details
StoreKey
typeValue
position.StoreKey
StoreKeyPositions
position.StoreKey// Positions
Value
<gnolang.StringValue>
StoreKeyPositionNextID
position.StoreKey// Position next ID
Value
<gnolang.StringValue>
positionStore
typeValue
position.positionStore
NewPositionStore
func(kvStore v1.KVStore) position.IPositionStoreNewPositionStore 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.
- OID
- 076232…53a6:46
NewPositionStore details
IPosition
typeValue
position.IPosition
IPositionManager
typeValue
position.IPositionManager
IPositionGetter
typeValue
position.IPositionGetter
IPositionStore
typeValue
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.
- OID
- 076232…53a6:48
RegisterInitializer details
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.
- OID
- 076232…53a6:50
UpgradeImpl details
GetImplementationPackagePath
func() stringGetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation
- OID
- 076232…53a6:51