unstaked_position.gno
Types
UnstakedPosition
UnstakedPosition is the exit checkpoint of a position that left the pool before collecting.
It pins the pool state a later collect must reproduce the exit-time reward from: the tick observed at the exit, the two boundary ticks (which the unstake may prune from the pool), and the tier context (which a later tier change would otherwise re-rate the window with). Collection is per source, so the checkpoint tracks what is left and is dropped when nothing is.
Methods
Deposit
Deposit returns the deposit snapshot captured when this position was unstaked.
Return Values
deposit
*Deposit
Stored deposit state, including its owner, pool, liquidity, ticks, warmups, and collected reward fields.
EmissionCollected
EmissionCollected reports whether the emission reward has been collected.
Return Values
collected
bool
True after MarkEmissionCollected has been called; false while the internal reward remains pending.
ExitTick
ExitTick returns the pool tick observed at ExitTime.
Return Values
exitTick
int32
Tick value used to determine the position's in-range status at the exit checkpoint.
ExitTime
ExitTime returns the timestamp at which the position stopped accruing rewards.
Return Values
exitTime
int64
Unix timestamp pinned as the end of this position's reward-accrual window.
FullyCollected
FullyCollected reports whether every reward source has been collected.
Return Values
collected
bool
True only when the internal emission flag is set and no external incentive IDs remain pending.
HasPendingIncentiveId
HasPendingIncentiveId reports whether the incentive is still to be collected.
Parameters
incentiveId
string
External incentive identifier to look up in this checkpoint's pending set.
Return Values
pending
bool
True when incentiveId is currently pending; false when it is absent or the pending set is nil.
HasPendingIncentives
HasPendingIncentives reports whether any incentive is still to be collected.
Return Values
pending
bool
True when at least one external incentive ID remains pending; false otherwise.
LowerOutsideAcc
LowerOutsideAcc returns the lower boundary tick's outside accumulation at ExitTime.
Return Values
lowerOutsideAcc
string
Decimal-encoded reward-ratio accumulation outside the lower boundary at exit.
LowerTick
LowerTick returns the position's lower boundary tick snapshot.
Return Values
lowerTick
*Tick
Stored lower boundary tick used when calculating rewards for this exit checkpoint.
MarkEmissionCollected
MarkEmissionCollected records that the emission reward has been collected.
MarkIncentiveCollected
MarkIncentiveCollected records that the incentive has been collected.
Parameters
incentiveId
string
External incentive identifier to remove from the pending set.
PendingIncentiveCount
PendingIncentiveCount returns how many incentives are still to be collected.
Return Values
count
int
Number of external incentive IDs currently pending in the checkpoint.
PendingIncentiveIdList
PendingIncentiveIdList returns the incentives still to be collected.
Return Values
incentiveIds
[]string
IDs currently present in the pending set; iteration order is unspecified.
Tier
Tier returns the pool's emission tier at ExitTime, or 0 when it was not tiered.
Return Values
tier
uint64
Tier identifier pinned at exit; zero means no emission tier applied.
TierCount
TierCount returns how many pools shared the tier at ExitTime.
Return Values
tierCount
uint64
Number of pools in the pinned tier when the position exited.
TierRatio
TierRatio returns the tier's emission ratio at ExitTime.
Return Values
tierRatio
uint64
Stored scaled reward-share ratio for the pinned tier at exit.
UnstakingFee
UnstakingFee returns the staking-reward fee rate in force at ExitTime.
Return Values
unstakingFee
uint64
Fee rate pinned for this exit in basis points (0-1,000; 100 = 1%).
UpperOutsideAcc
UpperOutsideAcc returns the upper boundary tick's outside accumulation at ExitTime.
Return Values
upperOutsideAcc
string
Decimal-encoded reward-ratio accumulation outside the upper boundary at exit.
UpperTick
UpperTick returns the position's upper boundary tick snapshot.
Return Values
upperTick
*Tick
Stored upper boundary tick used when calculating rewards for this exit checkpoint.
Constructors
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(source)
Last updated