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

NewBPTreeN

func NewBPTreeN(fanout int) *bptree.BPTree

NewBPTreeN allocates a raw BP-tree under /r/gnoswap/staker's realm context (the realm that declares Pool/Deposit/ExternalIncentive). The tree's PkgID is therefore /r/gnoswap/staker, matching the domain values it stores, so tree.Set leaf-slot writes clear the readonly-taint gate regardless of which realm (staker/v1, mock) calls Set (borrow rule #2 borrows m.Realm to the tree's owning realm). Implementations and mocks must allocate trees that hold /r/gnoswap/staker-declared values through here rather than calling bptree.NewBPTreeN directly in their own realm.

Parameters:

  • fanout: Number of child pointers per B+ tree node; controls the tree's branching factor.

Returns:

  • tree: Mutable raw B+ tree allocated in the staker realm context.

Param

Command

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

Result