accumulators

package
v0.1.0-mage.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 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,
	totalBmageSupply sdk.Int,
	singleBmageSupply 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 mage.

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