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

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.

Reward calculations combine elapsed-time rates with tick/range accumulation, and collection flows are integrated into the staking lifecycle.

Function

NewUnstakedPosition

func NewUnstakedPosition( deposit *Deposit, exitTime int64, exitTick int32, lowerTick *Tick, upperTick *Tick, lowerOutsideAcc string, upperOutsideAcc string, tier uint64, tierRatio uint64, tierCount uint64, unstakingFee uint64, pendingIncentiveIds []string, ) *UnstakedPosition

NewUnstakedPosition creates an exit checkpoint owing every reward source of the deposit.

Parameters:

  • deposit: Deposit state captured when the position leaves the pool.
  • exitTime: Unix timestamp when staking ended and this checkpoint's reward window stopped.
  • exitTick: Pool tick observed at exitTime for reconstructing in-range rewards.
  • lowerTick: Snapshot of the position's lower boundary tick, retained if the live pool prunes it.
  • upperTick: Snapshot of the position's upper boundary tick, retained if the live pool prunes it.
  • lowerOutsideAcc: Decimal-encoded outside reward-ratio accumulation of the lower tick at exitTime.
  • upperOutsideAcc: Decimal-encoded outside reward-ratio accumulation of the upper tick at exitTime.
  • tier: Pool emission tier at exitTime; zero denotes that the pool was not tiered.
  • tierRatio: Tier reward-share ratio, in its stored scaled form, at exitTime.
  • tierCount: Number of pools sharing the tier at exitTime for dividing tier rewards.
  • unstakingFee: Staking-reward fee rate in basis points at exitTime (0-1,000; 100 = 1%).
  • pendingIncentiveIds: External incentive IDs whose rewards are still owed by the position.

Returns:

  • position: New exit checkpoint retaining the deposit and exit-time reward context; emission is initially uncollected and every supplied incentive is pending.

Params

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/gnoswap/staker.NewUnstakedPosition(,,,,,,,,,,,)"

Result