accumulators

package
v0.0.0-...-ff1fc56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProportionalRewardsPerSecond

func GetProportionalRewardsPerSecond(
	rewardPeriod types.MultiRewardPeriod,
	totalBfurySupply sdk.Int,
	singleBfurySupply sdk.Int,
) sdk.DecCoins

Types

type BasicAccumulator

type BasicAccumulator struct {
	// contains filtered or unexported fields
}

BasicAccumulator is a default implementation of the RewardAccumulator interface. This applies to all claim types except for those with custom accumulator logic e.g. Earn.

func NewBasicAccumulator

func NewBasicAccumulator(
	store store.IncentiveStore,
	adapters adapters.SourceAdapters,
) BasicAccumulator

NewBasicAccumulator returns a new BasicAccumulator.

func (BasicAccumulator) AccumulateRewards

func (k BasicAccumulator) AccumulateRewards(
	ctx sdk.Context,
	claimType types.ClaimType,
	rewardPeriod types.MultiRewardPeriod,
) error

AccumulateRewards calculates new rewards to distribute this block and updates the global indexes to reflect this. The provided rewardPeriod must be valid to avoid panics in calculating time durations.

type EarnAccumulator

type EarnAccumulator struct {
	// contains filtered or unexported fields
}

EarnAccumulator is an accumulator for Earn claim types. This includes claiming staking rewards and reward distribution for liquid fury.

func NewEarnAccumulator

func NewEarnAccumulator(
	store store.IncentiveStore,
	liquidKeeper types.LiquidKeeper,
	earnKeeper types.EarnKeeper,
	adapters adapters.SourceAdapters,
) EarnAccumulator

NewEarnAccumulator returns a new EarnAccumulator.

func (EarnAccumulator) AccumulateRewards

func (a EarnAccumulator) AccumulateRewards(
	ctx sdk.Context,
	claimType types.ClaimType,
	rewardPeriod types.MultiRewardPeriod,
) error

AccumulateRewards calculates new rewards to distribute this block and updates the global indexes to reflect this. The provided rewardPeriod must be valid to avoid panics in calculating time durations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL