Search Apps Documentation Source Content File Folder Download Copy Actions Download

staker package

Overview

Package staker manages liquidity mining rewards for GnoSwap positions. The staker distributes GNS emissions and external incentives to liquidity providers based on their position size, price range, and staking duration. It supports both internal GNS rewards and external token incentives. Rewards are calculated per-tick and accumulate over time, with automatic compounding and fee collection integration.

Functions

AddToken

func AddToken(cur realm, tokenPath string)

AddToken adds a token to the reward token whitelist.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "AddToken" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "AddToken" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

ChangePoolTier

func ChangePoolTier(cur realm, poolPath string, tier uint64)

ChangePoolTier changes the reward tier of a pool.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "ChangePoolTier" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "ChangePoolTier" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

CollectReward

func CollectReward(cur realm, positionId uint64, unwrapResult bool) (string, string, map[string]int64, map[string]int64)

CollectReward collects accumulated rewards from a staked position. Parameters: - positionId: ID of the staked position - unwrapResult: whether to unwrap WGNOT to GNOT Returns: - string: pool path - string: staking details - map\[string]int64: internal rewards - map\[string]int64: external rewards

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "CollectReward" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "CollectReward" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

CollectableEmissionReward

func CollectableEmissionReward(positionId uint64) int64

CollectableEmissionReward returns the claimable internal reward amount.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.CollectableEmissionReward()"

Result

CollectableExternalIncentiveReward

func CollectableExternalIncentiveReward(positionId uint64, incentiveId string) int64

CollectableExternalIncentiveReward returns the claimable external reward amount.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.CollectableExternalIncentiveReward(,)"

Result

CreateExternalIncentive

func CreateExternalIncentive( cur realm, targetPoolPath string, rewardToken string, rewardAmount int64, startTimestamp int64, endTimestamp int64, )

CreateExternalIncentive creates an external reward incentive for a pool. Parameters: - targetPoolPath: pool to incentivize - rewardToken: token to use as reward - rewardAmount: total reward amount - startTimestamp: incentive start time - endTimestamp: incentive end time

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "CreateExternalIncentive" -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "CreateExternalIncentive" -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

DecodeInt64

func DecodeInt64(s string) int64

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.DecodeInt64()"

Result

DecodeUint

func DecodeUint(s string) uint64

DecodeUint converts a zero-padded string back into a uint64 number. Parameters: - s (string): The zero-padded string. Returns: - uint64: The decoded number. Panics: - If the string cannot be parsed into a uint64. Example: Input: "00000000000000012345" Output: 12345

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.DecodeUint()"

Result

EncodeInt

func EncodeInt(num int32) string

EncodeInt takes an int32 and returns a zero-padded decimal string with up to 10 digits for the absolute value. If the number is negative, the '-' sign comes first, followed by zeros, then digits.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.EncodeInt()"

Result

EncodeInt64

func EncodeInt64(num int64) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.EncodeInt64()"

Result

EncodeUint

func EncodeUint(num uint64) string

EncodeUint converts a uint64 number into a zero-padded 20-character string. Parameters: - num (uint64): The number to encode. Returns: - string: A zero-padded string representation of the number. Example: Input: 12345 Output: "00000000000000012345"

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.EncodeUint()"

Result

EndExternalIncentive

func EndExternalIncentive(cur realm, targetPoolPath, incentiveId string)

EndExternalIncentive terminates an external incentive early.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "EndExternalIncentive" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "EndExternalIncentive" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

GetAllowedTokens

func GetAllowedTokens() []string

GetAllowedTokens returns the allowed external incentive tokens.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetAllowedTokens()"

Result

GetCreatedHeightOfIncentive

func GetCreatedHeightOfIncentive(poolPath string, incentiveId string) int64

GetCreatedHeightOfIncentive returns the block height when an incentive was created.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetCreatedHeightOfIncentive(,)"

Result

GetDepositCollectedExternalReward

func GetDepositCollectedExternalReward(lpTokenId uint64, incentiveId string) int64

GetDepositCollectedExternalReward returns the collected external reward amount of a position.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositCollectedExternalReward(,)"

Result

GetDepositCollectedInternalReward

func GetDepositCollectedInternalReward(lpTokenId uint64) int64

GetDepositCollectedInternalReward returns the collected internal reward amount of a position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositCollectedInternalReward()"

Result

GetDepositExternalIncentiveIdList

func GetDepositExternalIncentiveIdList(lpTokenId uint64) []string

GetDepositExternalIncentiveIdList returns external incentive IDs for a deposit.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositExternalIncentiveIdList()"

Result

GetDepositExternalRewardLastCollectTimestamp

func GetDepositExternalRewardLastCollectTimestamp(lpTokenId uint64, incentiveId string) int64

GetDepositExternalRewardLastCollectTimestamp returns the last external reward collection time for a position.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositExternalRewardLastCollectTimestamp(,)"

Result

GetDepositGnsAmount

func GetDepositGnsAmount() int64

GetDepositGnsAmount returns the required GNS deposit amount for staking.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositGnsAmount()"

Result

GetDepositInternalRewardLastCollectTimestamp

func GetDepositInternalRewardLastCollectTimestamp(lpTokenId uint64) int64

GetDepositInternalRewardLastCollectTimestamp returns the last internal reward collection time for a position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositInternalRewardLastCollectTimestamp()"

Result

GetDepositLiquidity

func GetDepositLiquidity(lpTokenId uint64) *u256.Uint

GetDepositLiquidity returns the liquidity amount of a staked position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositLiquidity()"

Result

GetDepositLiquidityAsString

func GetDepositLiquidityAsString(lpTokenId uint64) string

GetDepositLiquidityAsString returns the liquidity amount of a staked position as string.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositLiquidityAsString()"

Result

GetDepositStakeTime

func GetDepositStakeTime(lpTokenId uint64) int64

GetDepositStakeTime returns the staking duration of a position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositStakeTime()"

Result

GetDepositTargetPoolPath

func GetDepositTargetPoolPath(lpTokenId uint64) string

GetDepositTargetPoolPath returns the pool path of a staked position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositTargetPoolPath()"

Result

GetDepositTickLower

func GetDepositTickLower(lpTokenId uint64) int32

GetDepositTickLower returns the lower tick of a staked position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositTickLower()"

Result

GetDepositTickUpper

func GetDepositTickUpper(lpTokenId uint64) int32

GetDepositTickUpper returns the upper tick of a staked position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositTickUpper()"

Result

GetImplementationPackagePath

func GetImplementationPackagePath() string

GetImplementationPackagePath returns the package path of the currently active implementation.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetImplementationPackagePath()"

Result

GetIncentiveCreatedTimestamp

func GetIncentiveCreatedTimestamp(poolPath string, incentiveId string) int64

GetIncentiveCreatedTimestamp returns the creation timestamp of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveCreatedTimestamp(,)"

Result

GetIncentiveDepositGnsAmount

func GetIncentiveDepositGnsAmount(poolPath string, incentiveId string) int64

GetIncentiveDepositGnsAmount returns the deposited GNS amount of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveDepositGnsAmount(,)"

Result

GetIncentiveDistributedRewardAmount

func GetIncentiveDistributedRewardAmount(poolPath string, incentiveId string) int64

GetIncentiveDistributedRewardAmount returns the distributed reward amount of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveDistributedRewardAmount(,)"

Result

GetIncentiveEndTimestamp

func GetIncentiveEndTimestamp(poolPath string, incentiveId string) int64

GetIncentiveEndTimestamp returns the end timestamp of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveEndTimestamp(,)"

Result

GetIncentiveRefunded

func GetIncentiveRefunded(poolPath string, incentiveId string) bool

GetIncentiveRefunded returns whether an incentive has been refunded.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveRefunded(,)"

Result

GetIncentiveRemainingRewardAmount

func GetIncentiveRemainingRewardAmount(poolPath string, incentiveId string) int64

GetIncentiveRemainingRewardAmount returns the remaining reward amount of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveRemainingRewardAmount(,)"

Result

GetIncentiveRewardAmount

func GetIncentiveRewardAmount(poolPath string, incentiveId string) *u256.Uint

GetIncentiveRewardAmount returns the total reward amount of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveRewardAmount(,)"

Result

GetIncentiveRewardAmountAsString

func GetIncentiveRewardAmountAsString(poolPath string, incentiveId string) string

GetIncentiveRewardAmountAsString returns the total reward amount of an incentive as string.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveRewardAmountAsString(,)"

Result

GetIncentiveRewardPerSecond

func GetIncentiveRewardPerSecond(poolPath string, incentiveId string) int64

GetIncentiveRewardPerSecond returns the reward rate per second of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveRewardPerSecond(,)"

Result

GetIncentiveRewardToken

func GetIncentiveRewardToken(poolPath string, incentiveId string) string

GetIncentiveRewardToken returns the reward token of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveRewardToken(,)"

Result

GetIncentiveStartTimestamp

func GetIncentiveStartTimestamp(poolPath string, incentiveId string) int64

GetIncentiveStartTimestamp returns the start timestamp of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveStartTimestamp(,)"

Result

GetIncentiveTotalRewardAmount

func GetIncentiveTotalRewardAmount(poolPath string, incentiveId string) int64

GetIncentiveTotalRewardAmount returns the total reward amount of an incentive.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentiveTotalRewardAmount(,)"

Result

GetMinimumRewardAmount

func GetMinimumRewardAmount() int64

GetMinimumRewardAmount returns the minimum reward amount to distribute.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetMinimumRewardAmount()"

Result

GetMinimumRewardAmountForToken

func GetMinimumRewardAmountForToken(tokenPath string) int64

GetMinimumRewardAmountForToken returns the minimum reward amount for a specific token.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetMinimumRewardAmountForToken()"

Result

GetPoolGlobalRewardRatioAccumulation

func GetPoolGlobalRewardRatioAccumulation(poolPath string, timestamp uint64) *u256.Uint

GetPoolGlobalRewardRatioAccumulation returns the global reward ratio accumulation at a specific timestamp for a pool.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolGlobalRewardRatioAccumulation(,)"

Result

GetPoolGlobalRewardRatioAccumulationCount

func GetPoolGlobalRewardRatioAccumulationCount(poolPath string) uint64

GetPoolGlobalRewardRatioAccumulationCount returns the number of global reward ratio accumulation entries for a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolGlobalRewardRatioAccumulationCount()"

Result

GetPoolGlobalRewardRatioAccumulationIDs

func GetPoolGlobalRewardRatioAccumulationIDs(poolPath string, offset, count int) []uint64

GetPoolGlobalRewardRatioAccumulationIDs returns a paginated list of timestamps for global reward ratio accumulation entries.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolGlobalRewardRatioAccumulationIDs(,,)"

Result

GetPoolHistoricalTick

func GetPoolHistoricalTick(poolPath string, tick uint64) int32

GetPoolHistoricalTick returns the historical tick at a specific timestamp for a pool.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolHistoricalTick(,)"

Result

GetPoolHistoricalTickCount

func GetPoolHistoricalTickCount(poolPath string) uint64

GetPoolHistoricalTickCount returns the number of historical tick entries for a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolHistoricalTickCount()"

Result

GetPoolHistoricalTickIDs

func GetPoolHistoricalTickIDs(poolPath string, offset, count int) []int32

GetPoolHistoricalTickIDs returns a paginated list of historical tick values for a pool.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolHistoricalTickIDs(,,)"

Result

GetPoolIncentiveCount

func GetPoolIncentiveCount(poolPath string) uint64

GetPoolIncentiveCount returns the number of incentives for a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolIncentiveCount()"

Result

GetPoolIncentiveIDs

func GetPoolIncentiveIDs(poolPath string, offset, count int) []string

GetPoolIncentiveIDs returns a paginated list of incentive IDs for a pool.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolIncentiveIDs(,,)"

Result

GetPoolIncentiveIdList

func GetPoolIncentiveIdList(poolPath string) []string

GetPoolIncentiveIdList returns all incentive IDs for a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolIncentiveIdList()"

Result

GetPoolReward

func GetPoolReward(tier uint64) int64

GetPoolReward returns the reward amount for a tier.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolReward()"

Result

GetPoolRewardCache

func GetPoolRewardCache(poolPath string, timestamp uint64) int64

GetPoolRewardCache returns the reward cache value at a specific timestamp for a pool.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolRewardCache(,)"

Result

GetPoolRewardCacheCount

func GetPoolRewardCacheCount(poolPath string) uint64

GetPoolRewardCacheCount returns the number of reward cache entries for a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolRewardCacheCount()"

Result

GetPoolRewardCacheIDs

func GetPoolRewardCacheIDs(poolPath string, offset, count int) []int64

GetPoolRewardCacheIDs returns a paginated list of reward cache timestamps for a pool.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolRewardCacheIDs(,,)"

Result

GetPoolStakedLiquidity

func GetPoolStakedLiquidity(poolPath string) string

GetPoolStakedLiquidity returns the current total staked liquidity of a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolStakedLiquidity()"

Result

GetPoolTier

func GetPoolTier(poolPath string) uint64

GetPoolTier returns the tier of a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolTier()"

Result

GetPoolTierCount

func GetPoolTierCount(tier uint64) uint64

GetPoolTierCount returns the number of pools in a tier.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolTierCount()"

Result

GetPoolTierRatio

func GetPoolTierRatio(poolPath string) uint64

GetPoolTierRatio returns the reward ratio of a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolTierRatio()"

Result

GetPoolsByTier

func GetPoolsByTier(tier uint64) []string

GetPoolsByTier returns the pool list for a tier.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPoolsByTier()"

Result

GetSpecificTokenMinimumRewardAmount

func GetSpecificTokenMinimumRewardAmount(tokenPath string) (int64, bool)

GetSpecificTokenMinimumRewardAmount returns the minimum reward amount for a specific token.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetSpecificTokenMinimumRewardAmount()"

Result

GetStakedPositionsByUser

func GetStakedPositionsByUser(owner address, offset, count int) []uint64

GetStakedPositionsByUser returns staked position IDs for a user with pagination.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetStakedPositionsByUser(,,)"

Result

GetTargetPoolPathByIncentiveId

func GetTargetPoolPathByIncentiveId(poolPath string, incentiveId string) string

GetTargetPoolPathByIncentiveId returns the pool path for an incentive ID.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetTargetPoolPathByIncentiveId(,)"

Result

GetTotalEmissionSent

func GetTotalEmissionSent() int64

GetTotalEmissionSent returns the total GNS emission sent.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetTotalEmissionSent()"

Result

GetTotalStakedUserCount

func GetTotalStakedUserCount() uint64

GetTotalStakedUserCount returns the total number of staked users.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetTotalStakedUserCount()"

Result

GetTotalStakedUserPositionCount

func GetTotalStakedUserPositionCount(user address) uint64

GetTotalStakedUserPositionCount returns the staked position count for a user.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetTotalStakedUserPositionCount()"

Result

GetUnstakingFee

func GetUnstakingFee() int64

GetUnstakingFee returns the unstaking fee percentage.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetUnstakingFee()"

Result

IsIncentiveActive

func IsIncentiveActive(poolPath string, incentiveId string) bool

IsIncentiveActive returns whether an incentive is active.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.IsIncentiveActive(,)"

Result

IsStaked

func IsStaked(positionId uint64) bool

IsStaked returns whether a position is staked.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.IsStaked()"

Result

MintAndStake

func MintAndStake( cur realm, token0 string, token1 string, fee uint32, tickLower int32, tickUpper int32, amount0Desired string, amount1Desired string, amount0Min string, amount1Min string, deadline int64, referrer string, ) (uint64, string, string, string, string)

MintAndStake creates a new position and immediately stakes it. 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 - referrer: referrer address for reward tracking Returns: - uint64: position ID - string: liquidity amount - string: amount of token0 added - string: amount of token1 added - string: staking details

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "MintAndStake" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "MintAndStake" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

RegisterInitializer

func RegisterInitializer(cur realm, initializer func(stakerStore IStakerStore, poolAccessor PoolAccessor, emissionAccessor EmissionAccessor, nftAccessor NFTAccessor) IStaker)

RegisterInitializer registers a new staker 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 stakerStore interface. Security: Only contracts within the domain path can register initializers. Each package path can only register once to prevent duplicate registrations.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "RegisterInitializer" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "RegisterInitializer" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

RemovePoolTier

func RemovePoolTier(cur realm, poolPath string)

RemovePoolTier removes a pool from the tier system.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "RemovePoolTier" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "RemovePoolTier" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

RemoveToken

func RemoveToken(cur realm, tokenPath string)

RemoveToken removes a token from the reward token whitelist.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "RemoveToken" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "RemoveToken" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetDepositGnsAmount

func SetDepositGnsAmount(cur realm, amount int64)

SetDepositGnsAmount sets the required GNS deposit amount for staking.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetDepositGnsAmount" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetDepositGnsAmount" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetMinimumRewardAmount

func SetMinimumRewardAmount(cur realm, amount int64)

SetMinimumRewardAmount sets the minimum reward amount to distribute.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetMinimumRewardAmount" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetMinimumRewardAmount" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetPoolTier

func SetPoolTier(cur realm, poolPath string, tier uint64)

SetPoolTier sets the reward tier for a pool.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetPoolTier" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetPoolTier" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetTokenMinimumRewardAmount

func SetTokenMinimumRewardAmount(cur realm, paramsStr string)

SetTokenMinimumRewardAmount sets minimum reward amounts per token.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetTokenMinimumRewardAmount" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetTokenMinimumRewardAmount" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetUnStakingFee

func SetUnStakingFee(cur realm, fee int64)

SetUnStakingFee sets the unstaking fee percentage.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetUnStakingFee" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetUnStakingFee" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

SetWarmUp

func SetWarmUp(cur realm, pct, timeDuration int64)

SetWarmUp sets the warm-up period parameters for staking.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetWarmUp" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "SetWarmUp" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

StakeToken

func StakeToken(cur realm, positionId uint64, referrer string) string

StakeToken stakes a position NFT to earn rewards. Parameters: - positionId: ID of the position to stake - referrer: referrer address for reward tracking Returns: - string: deposit ID

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "StakeToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "StakeToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

UnStakeToken

func UnStakeToken(cur realm, positionId uint64, unwrapResult bool) string

UnStakeToken unstakes a position NFT and collects rewards. Parameters: - positionId: ID of the position to unstake - unwrapResult: whether to unwrap WGNOT to GNOT Returns: - string: collected reward details

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "UnStakeToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "UnStakeToken" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

UpgradeImpl

func UpgradeImpl(cur realm, packagePath string)

UpgradeImpl switches the active staker 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.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "UpgradeImpl" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" -broadcast -chainid "test11" -remote "https://rpc.test11.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test11.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gnoswap/staker" -func "UpgradeImpl" -args $'' -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test11" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test11.testnets.gno.land" call.tx
  

NewCounter

func NewCounter() *Counter

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewCounter()"

Result

GetDeposit

func GetDeposit(lpTokenId uint64) *Deposit

GetDeposit returns a copy of the deposit for the given position ID.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDeposit()"

Result

NewDeposit

func NewDeposit( owner address, targetPoolPath string, liquidity *u256.Uint, currentTime int64, tickLower, tickUpper int32, warmups []Warmup, ) *Deposit

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewDeposit(,,,,,,)"

Result

GetExternalIncentiveByPoolPath

func GetExternalIncentiveByPoolPath(poolPath string) []ExternalIncentive

GetExternalIncentiveByPoolPath returns all external incentives for a pool.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetExternalIncentiveByPoolPath()"

Result

GetIncentive

func GetIncentive(poolPath string, incentiveId string) *ExternalIncentive

GetIncentive returns a copy of the incentive for the given pool and ID.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetIncentive(,)"

Result

NewExternalIncentive

func NewExternalIncentive( incentiveId string, targetPoolPath string, rewardToken string, rewardAmount int64, startTimestamp int64, endTimestamp int64, refundee address, depositGnsAmount int64, createdHeight int64, currentTime int64, isRequestUnwrap bool, ) *ExternalIncentive

NewExternalIncentive creates a new external incentive

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewExternalIncentive(,,,,,,,,,,)"

Result

NewStakerStore

func NewStakerStore(kvStore store.KVStore) IStakerStore

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

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewStakerStore()"

Result

NewIncentives

func NewIncentives(targetPoolPath string) *Incentives

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewIncentives()"

Result

GetPool

func GetPool(poolPath string) *Pool

GetPool returns a copy of the pool for the given path.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetPool()"

Result

NewPool

func NewPool(poolPath string, currentTime int64) *Pool

NewPool creates a new pool with the given poolPath and currentHeight.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewPool(,)"

Result

NewSwapBatchProcessor

func NewSwapBatchProcessor(poolPath string, pool *Pool, timestamp int64) *SwapBatchProcessor

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewSwapBatchProcessor(,,)"

Result

NewSwapTickCross

func NewSwapTickCross(tickID int32, zeroForOne bool, delta *i256.Int) *SwapTickCross

Params

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewSwapTickCross(,,)"

Result

NewTick

func NewTick(tickId int32) *Tick

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewTick()"

Result

NewTicks

func NewTicks() Ticks

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewTicks()"

Result

NewUintTree

func NewUintTree() *UintTree

NewUintTree creates a new UintTree instance.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.NewUintTree()"

Result

DefaultWarmupTemplate

func DefaultWarmupTemplate() []Warmup

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.DefaultWarmupTemplate()"

Result

GetDepositWarmUp

func GetDepositWarmUp(lpTokenId uint64) []Warmup

GetDepositWarmUp returns the warmup records of a staked position.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetDepositWarmUp()"

Result

GetWarmupTemplate

func GetWarmupTemplate() []Warmup

GetWarmupTemplate returns the current warmup template.

Command

gnokey query vm/qeval -remote "https://rpc.test11.testnets.gno.land" -data "gno.land/r/gnoswap/staker.GetWarmupTemplate()"

Result