deposit.gno
DefaultAllowedTokens
func DefaultAllowedTokens() []stringDefaultAllowedTokens returns the token paths accepted by the staker's default configuration.
Return Values
tokenPaths
[]string
Slice containing the GNS and wrapped-GNOT token paths.
Types
Deposit
Methods
AddExternalIncentiveId
AddExternalIncentiveId adds an external incentive id to the deposit.
Parameters
incentiveId
string
External incentive ID to add to the deposit's index.
Clone
Clone returns a deep copy of the deposit.
Return Values
deposit
*Deposit
Deep copy of the deposit, or nil when the receiver is nil.
CollectedExternalRewards
CollectedExternalRewards returns cumulative external rewards keyed by incentive ID.
Return Values
collectedExternalRewards
map[string]int64
Map from incentive ID to the amount collected for that incentive.
CollectedInternalReward
CollectedInternalReward returns the cumulative internal reward recorded for the deposit.
Return Values
collectedInternalReward
int64
Accumulated internal reward amount in the reward token's smallest units.
ExternalIncentiveIds
ExternalIncentiveIds returns the deposit's indexed external incentive IDs.
Return Values
externalIncentiveIds
map[string]bool
Map from each indexed incentive ID to its membership flag.
ExternalRewardLastCollectTimes
ExternalRewardLastCollectTimes returns per-incentive external collection cursors.
Return Values
externalRewardLastCollectTimes
map[string]int64
Map from incentive ID to its last collection time in Unix seconds.
GetCollectedExternalReward
GetCollectedExternalReward returns the collected external reward for the given incentive ID. Returns 0 if the incentive ID does not exist.
Parameters
incentiveID
string
External incentive ID whose collected amount should be looked up.
Return Values
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.
GetExternalIncentiveIdList
GetExternalIncentiveIdList returns a list of external incentive ids for the deposit.
Return Values
incentiveIds
[]string
Slice containing the incentive IDs currently indexed on the deposit; order follows map iteration and is not guaranteed.
GetExternalRewardLastCollectTime
GetExternalRewardLastCollectTime returns the last collect time for the given incentive ID. Returns 0 if the incentive ID does not exist.
Parameters
incentiveID
string
External incentive ID whose collection cursor should be looked up.
Return Values
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.
HasExternalIncentiveId
HasExternalIncentiveId checks if the deposit has the given external incentive id.
Parameters
incentiveId
string
External incentive ID whose membership should be checked.
Return Values
hasIncentive
bool
True when incentiveId is indexed on the deposit; false otherwise.
InternalRewardLastCollectTime
InternalRewardLastCollectTime returns the internal-reward collection cursor.
Return Values
internalRewardLastCollectTime
int64
Last internal reward collection time in Unix seconds.
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
fn
func(string) bool
Callback invoked with each indexed incentive ID; return true to stop iteration early or false to continue.
LastExternalIncentiveUpdatedAt
LastExternalIncentiveUpdatedAt returns the timestamp of the last external-incentive index refresh.
Return Values
timestamp
int64
Last refresh time in Unix seconds.
Liquidity
Liquidity returns the LP liquidity recorded for the deposit.
Return Values
liquidity
*u256.Uint
Liquidity amount represented by the staked position.
Owner
Owner returns the address that owns the staked position.
Return Values
owner
address
Address recorded as the deposit owner.
RemoveExternalIncentiveId
RemoveExternalIncentiveId removes an external incentive id from the deposit.
Parameters
incentiveId
string
External incentive ID to remove from the deposit's index.
SetCollectedExternalReward
SetCollectedExternalReward records the cumulative amount collected for one incentive.
Parameters
incentiveID
string
External incentive ID whose collected amount should be set.
reward
int64
Cumulative collected amount for incentiveID.
SetCollectedExternalRewards
SetCollectedExternalRewards replaces the cumulative external-reward map.
Parameters
collectedExternalRewards
map[string]int64
Map from incentive ID to its collected reward amount.
SetCollectedInternalReward
SetCollectedInternalReward replaces the cumulative internal reward recorded for the deposit.
Parameters
collectedInternalReward
int64
Cumulative internal reward amount in the reward token's smallest units.
SetExternalIncentiveIds
SetExternalIncentiveIds replaces the deposit's indexed external incentive IDs.
Parameters
externalIncentiveIds
map[string]bool
Map of incentive IDs to their membership flags.
SetExternalRewardLastCollectTime
SetExternalRewardLastCollectTime records the collection cursor for one incentive.
Parameters
incentiveID
string
External incentive ID whose cursor should be set.
currentTime
int64
New collection time for incentiveID in Unix seconds.
SetExternalRewardLastCollectTimes
SetExternalRewardLastCollectTimes replaces the per-incentive external collection cursors.
Parameters
externalRewardLastCollectTimes
map[string]int64
Map from incentive ID to its last collection time in Unix seconds.
SetInternalRewardLastCollectTime
SetInternalRewardLastCollectTime updates the internal-reward collection cursor.
Parameters
internalRewardLastCollectTime
int64
New last internal reward collection time in Unix seconds.
SetLastExternalIncentiveUpdatedAt
SetLastExternalIncentiveUpdatedAt updates the external-incentive index refresh timestamp.
Parameters
timestamp
int64
Refresh time to record in Unix seconds.
SetLiquidity
SetLiquidity replaces the LP liquidity recorded for the deposit.
Parameters
liquidity
*u256.Uint
New liquidity amount; the setter copies this value into the deposit.
SetOwner
SetOwner updates the address recorded as the deposit owner.
Parameters
owner
address
Address that should own the deposit.
SetStakeTime
SetStakeTime updates the Unix timestamp at which the position was staked.
Parameters
stakeTime
int64
Stake start time in Unix seconds.
SetTargetPoolPath
SetTargetPoolPath updates the pool path associated with the staked position.
Parameters
targetPoolPath
string
Pool identifier to associate with the deposit.
SetTickLower
SetTickLower updates the lower signed tick boundary of the staked position.
Parameters
tickLower
int32
Lower tick boundary to store for the position's price range.
SetTickUpper
SetTickUpper updates the upper signed tick boundary of the staked position.
Parameters
tickUpper
int32
Upper tick boundary to store for the position's price range.
SetWarmups
SetWarmups replaces the deposit's warmup schedule with a copied slice.
Parameters
warmups
[]Warmup
Warmup tiers to use for subsequent reward calculations.
StakeTime
StakeTime returns the Unix timestamp at which the position was staked.
Return Values
stakeTime
int64
Stake start time in Unix seconds.
TargetPoolPath
TargetPoolPath returns the pool path associated with the staked position.
Return Values
targetPoolPath
string
Pool identifier used to resolve the position's pool.
TickLower
TickLower returns the lower signed tick boundary of the staked position.
Return Values
tickLower
int32
Lower tick boundary used by the position's price range.
TickUpper
TickUpper returns the upper signed tick boundary of the staked position.
Return Values
tickUpper
int32
Upper tick boundary used by the position's price range.
Warmups
Warmups returns a copy of the deposit's warmup schedule.
Return Values
warmups
[]Warmup
Warmup tiers applied to rewards for this deposit, or nil when no schedule is stored.
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
Fields
Methods
SetNextWarmupTime
SetNextWarmupTime updates the Unix timestamp at which this warmup tier ends.
Parameters
nextWarmupTime
int64
Tier end time in Unix seconds.
SetTimeDuration
SetTimeDuration updates the duration of this warmup tier.
Parameters
timeDuration
int64
Tier duration in seconds.
SetWarmupRatio
SetWarmupRatio updates the percentage of calculated reward credited to the position.
Parameters
warmupRatio
uint64
Reward percentage for this tier, expressed from 0 to 100.
Constructors
Last updated