For the complete documentation index, see llms.txt. This page is also available as Markdown.

deposit.gno

DefaultAllowedTokens

func DefaultAllowedTokens() []string

DefaultAllowedTokens returns the token paths accepted by the staker's default configuration.

Return Values

Name
Type
Description

tokenPaths

[]string

Slice containing the GNS and wrapped-GNOT token paths.

source

Types

Deposit

source

Methods

AddExternalIncentiveId

AddExternalIncentiveId adds an external incentive id to the deposit.

Parameters

Name
Type
Description

incentiveId

string

External incentive ID to add to the deposit's index.

source

Clone

Clone returns a deep copy of the deposit.

Return Values

Name
Type
Description

deposit

*Deposit

Deep copy of the deposit, or nil when the receiver is nil.

source

CollectedExternalRewards

CollectedExternalRewards returns cumulative external rewards keyed by incentive ID.

Return Values

Name
Type
Description

collectedExternalRewards

map[string]int64

Map from incentive ID to the amount collected for that incentive.

source

CollectedInternalReward

CollectedInternalReward returns the cumulative internal reward recorded for the deposit.

Return Values

Name
Type
Description

collectedInternalReward

int64

Accumulated internal reward amount in the reward token's smallest units.

source

ExternalIncentiveIds

ExternalIncentiveIds returns the deposit's indexed external incentive IDs.

Return Values

Name
Type
Description

externalIncentiveIds

map[string]bool

Map from each indexed incentive ID to its membership flag.

source

ExternalRewardLastCollectTimes

ExternalRewardLastCollectTimes returns per-incentive external collection cursors.

Return Values

Name
Type
Description

externalRewardLastCollectTimes

map[string]int64

Map from incentive ID to its last collection time in Unix seconds.

source

GetCollectedExternalReward

GetCollectedExternalReward returns the collected external reward for the given incentive ID. Returns 0 if the incentive ID does not exist.

Parameters

Name
Type
Description

incentiveID

string

External incentive ID whose collected amount should be looked up.

Return Values

Name
Type
Description

reward

int64

Collected amount for the incentive, or 0 when the ID is absent.

exists

bool

True when the map contains incentiveID; false when it is absent.

source

GetExternalIncentiveIdList

GetExternalIncentiveIdList returns a list of external incentive ids for the deposit.

Return Values

Name
Type
Description

incentiveIds

[]string

Slice containing the incentive IDs currently indexed on the deposit; order follows map iteration and is not guaranteed.

source

GetExternalRewardLastCollectTime

GetExternalRewardLastCollectTime returns the last collect time for the given incentive ID. Returns 0 if the incentive ID does not exist.

Parameters

Name
Type
Description

incentiveID

string

External incentive ID whose collection cursor should be looked up.

Return Values

Name
Type
Description

time

int64

Last collection time for the incentive in Unix seconds, or 0 when the ID is absent.

exists

bool

True when the map contains incentiveID; false when it is absent.

source

HasExternalIncentiveId

HasExternalIncentiveId checks if the deposit has the given external incentive id.

Parameters

Name
Type
Description

incentiveId

string

External incentive ID whose membership should be checked.

Return Values

Name
Type
Description

hasIncentive

bool

True when incentiveId is indexed on the deposit; false otherwise.

source

InternalRewardLastCollectTime

InternalRewardLastCollectTime returns the internal-reward collection cursor.

Return Values

Name
Type
Description

internalRewardLastCollectTime

int64

Last internal reward collection time in Unix seconds.

source

IterateExternalIncentiveIds

IterateExternalIncentiveIds iterates over external incentive IDs without allocating a slice. The callback function receives each incentive ID and should return false to continue iteration, or true to stop early. This method is more memory-efficient than GetExternalIncentiveIdList for cases where you only need to process IDs sequentially.

Parameters

Name
Type
Description

fn

func(string) bool

Callback invoked with each indexed incentive ID; return true to stop iteration early or false to continue.

source

LastExternalIncentiveUpdatedAt

LastExternalIncentiveUpdatedAt returns the timestamp of the last external-incentive index refresh.

Return Values

Name
Type
Description

timestamp

int64

Last refresh time in Unix seconds.

source

Liquidity

Liquidity returns the LP liquidity recorded for the deposit.

Return Values

Name
Type
Description

liquidity

*u256.Uint

Liquidity amount represented by the staked position.

source

Owner

Owner returns the address that owns the staked position.

Return Values

Name
Type
Description

owner

address

Address recorded as the deposit owner.

source

RemoveExternalIncentiveId

RemoveExternalIncentiveId removes an external incentive id from the deposit.

Parameters

Name
Type
Description

incentiveId

string

External incentive ID to remove from the deposit's index.

source

SetCollectedExternalReward

SetCollectedExternalReward records the cumulative amount collected for one incentive.

Parameters

Name
Type
Description

incentiveID

string

External incentive ID whose collected amount should be set.

reward

int64

Cumulative collected amount for incentiveID.

source

SetCollectedExternalRewards

SetCollectedExternalRewards replaces the cumulative external-reward map.

Parameters

Name
Type
Description

collectedExternalRewards

map[string]int64

Map from incentive ID to its collected reward amount.

source

SetCollectedInternalReward

SetCollectedInternalReward replaces the cumulative internal reward recorded for the deposit.

Parameters

Name
Type
Description

collectedInternalReward

int64

Cumulative internal reward amount in the reward token's smallest units.

source

SetExternalIncentiveIds

SetExternalIncentiveIds replaces the deposit's indexed external incentive IDs.

Parameters

Name
Type
Description

externalIncentiveIds

map[string]bool

Map of incentive IDs to their membership flags.

source

SetExternalRewardLastCollectTime

SetExternalRewardLastCollectTime records the collection cursor for one incentive.

Parameters

Name
Type
Description

incentiveID

string

External incentive ID whose cursor should be set.

currentTime

int64

New collection time for incentiveID in Unix seconds.

source

SetExternalRewardLastCollectTimes

SetExternalRewardLastCollectTimes replaces the per-incentive external collection cursors.

Parameters

Name
Type
Description

externalRewardLastCollectTimes

map[string]int64

Map from incentive ID to its last collection time in Unix seconds.

source

SetInternalRewardLastCollectTime

SetInternalRewardLastCollectTime updates the internal-reward collection cursor.

Parameters

Name
Type
Description

internalRewardLastCollectTime

int64

New last internal reward collection time in Unix seconds.

source

SetLastExternalIncentiveUpdatedAt

SetLastExternalIncentiveUpdatedAt updates the external-incentive index refresh timestamp.

Parameters

Name
Type
Description

timestamp

int64

Refresh time to record in Unix seconds.

source

SetLiquidity

SetLiquidity replaces the LP liquidity recorded for the deposit.

Parameters

Name
Type
Description

liquidity

*u256.Uint

New liquidity amount; the setter copies this value into the deposit.

source

SetOwner

SetOwner updates the address recorded as the deposit owner.

Parameters

Name
Type
Description

owner

address

Address that should own the deposit.

source

SetStakeTime

SetStakeTime updates the Unix timestamp at which the position was staked.

Parameters

Name
Type
Description

stakeTime

int64

Stake start time in Unix seconds.

source

SetTargetPoolPath

SetTargetPoolPath updates the pool path associated with the staked position.

Parameters

Name
Type
Description

targetPoolPath

string

Pool identifier to associate with the deposit.

source

SetTickLower

SetTickLower updates the lower signed tick boundary of the staked position.

Parameters

Name
Type
Description

tickLower

int32

Lower tick boundary to store for the position's price range.

source

SetTickUpper

SetTickUpper updates the upper signed tick boundary of the staked position.

Parameters

Name
Type
Description

tickUpper

int32

Upper tick boundary to store for the position's price range.

source

SetWarmups

SetWarmups replaces the deposit's warmup schedule with a copied slice.

Parameters

Name
Type
Description

warmups

[]Warmup

Warmup tiers to use for subsequent reward calculations.

source

StakeTime

StakeTime returns the Unix timestamp at which the position was staked.

Return Values

Name
Type
Description

stakeTime

int64

Stake start time in Unix seconds.

source

TargetPoolPath

TargetPoolPath returns the pool path associated with the staked position.

Return Values

Name
Type
Description

targetPoolPath

string

Pool identifier used to resolve the position's pool.

source

TickLower

TickLower returns the lower signed tick boundary of the staked position.

Return Values

Name
Type
Description

tickLower

int32

Lower tick boundary used by the position's price range.

source

TickUpper

TickUpper returns the upper signed tick boundary of the staked position.

Return Values

Name
Type
Description

tickUpper

int32

Upper tick boundary used by the position's price range.

source

Warmups

Warmups returns a copy of the deposit's warmup schedule.

Return Values

Name
Type
Description

warmups

[]Warmup

Warmup tiers applied to rewards for this deposit, or nil when no schedule is stored.

source

Constructors

  • func GetDeposit(lpTokenId uint64) (*Deposit, error) (source)

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

Warmup

source

Fields

Methods

SetNextWarmupTime

SetNextWarmupTime updates the Unix timestamp at which this warmup tier ends.

Parameters

Name
Type
Description

nextWarmupTime

int64

Tier end time in Unix seconds.

source

SetTimeDuration

SetTimeDuration updates the duration of this warmup tier.

Parameters

Name
Type
Description

timeDuration

int64

Tier duration in seconds.

source

SetWarmupRatio

SetWarmupRatio updates the percentage of calculated reward credited to the position.

Parameters

Name
Type
Description

warmupRatio

uint64

Reward percentage for this tier, expressed from 0 to 100.

source

Constructors

  • func DefaultWarmupTemplate() []Warmup (source)

  • func GetDepositWarmUp(lpTokenId uint64) ([]Warmup, error) (source)

  • func GetWarmupTemplate() []Warmup (source)

  • func NewWarmup(timeDuration int64, nextWarmupTime int64, warmupRatio uint64) Warmup (source)

Last updated