rewards

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Ctx    = decimal.Context128
	One    = decimal.WithContext(Ctx).SetUint64(1)
	LogTwo = Ctx.Log(decimal.WithContext(Ctx), decimal.WithContext(Ctx).SetUint64(2))

	// TenYears contains one extra layer to account for the effective genesis (zero) layer.
	TenYears          = decimal.WithContext(Ctx).SetUint64(10*constants.OneYear + 1)
	IssuanceNum       = decimal.WithContext(Ctx).SetUint64(constants.TenYearTarget - constants.TotalVaulted)
	IssuanceDenom     = decimal.WithContext(Ctx).SetUint64(constants.TotalSubsidy)
	IssuanceFrac      = Ctx.Sub(decimal.WithContext(Ctx), One, Ctx.Quo(decimal.WithContext(Ctx), IssuanceNum, IssuanceDenom))
	HalfLife          = Ctx.Mul(decimal.WithContext(Ctx), decimal.WithContext(Ctx).Neg(TenYears), Ctx.Quo(decimal.WithContext(Ctx), LogTwo, Ctx.Log(decimal.WithContext(Ctx), IssuanceFrac)))
	Lambda            = Ctx.Quo(decimal.WithContext(Ctx), LogTwo, HalfLife)
	NegLambda         = decimal.WithContext(Ctx).Neg(Lambda)
	TotalSubsidy      = decimal.WithContext(Ctx).SetUint64(constants.TotalSubsidy)
	FinalIssuanceFrac = Ctx.Quo(decimal.WithContext(Ctx), Ctx.Sub(decimal.WithContext(Ctx), TotalSubsidy, One), TotalSubsidy)
	FinalLayer        = Ctx.Quo(decimal.WithContext(Ctx), Ctx.Log(decimal.WithContext(Ctx), Ctx.Sub(decimal.WithContext(Ctx), One, FinalIssuanceFrac)), NegLambda)
)

Functions

func TotalAccumulatedSubsidyAtLayer

func TotalAccumulatedSubsidyAtLayer(layersAfterEffectiveGenesis uint32) uint64

TotalAccumulatedSubsidyAtLayer returns the total accumulated block subsidy paid by the protocol as of the given layer, denominated in smidge.

func TotalSubsidyAtLayer

func TotalSubsidyAtLayer(layersAfterEffectiveGenesis uint32) uint64

TotalSubsidyAtLayer returns the total subsidy issued in the layer

Types

This section is empty.

Jump to

Keyboard shortcuts

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