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

NewExternalIncentive

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

NewExternalIncentive creates a new external incentive

Parameters:

  • incentiveId: Unique identifier assigned to the external incentive.
  • targetPoolPath: Pool path whose staked positions may receive this incentive.
  • rewardToken: Token path of the asset deposited for distribution.
  • rewardAmount: Total reward amount, also used as the initial remaining reward balance.
  • startTimestamp: Unix timestamp in seconds when reward distribution starts.
  • endTimestamp: Unix timestamp in seconds when reward distribution ends; duration is endTimestamp-startTimestamp and must be nonzero for the rate calculation.
  • creator: Address that funds the incentive and receives refunds at finalization.
  • depositGnsAmount: GNS amount deposited as the incentive's required collateral.
  • createdHeight: Block height to record for incentive creation.
  • currentTime: Unix timestamp in seconds recorded as the incentive creation time.

Returns:

  • incentive: New incentive with a Q128-scaled per-second rate and zeroed distribution, penalty, and unclaimable counters.

Params

Command

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

Result