cardano-ledger-shelley-1.16.0.0: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.RewardProvenance

Synopsis

Documentation

data RewardProvenance Source #

RewardProvenenace captures some of the intermediate calculations when computing the staking reward distribution. Most of these fields are simple scalar values, computed from the current State, and are fixed before we start to compute the distribution. Two of them are aggregates computed when we compute the distribution (pools and desirabilities).

For more background, see "Figure 48: The Reward Calculation" and "Figure 51: Reward Update Creation" of the the formal specification. The variable names here align with those in the specification. See also Section 5 of the https://github.com/intersectmbo/cardano-ledger/releases/latest/download/shelley-delegation.pdf

Constructors

RewardProvenance 

Fields

  • spe ∷ !Word64

    The number of slots per epoch.

  • blocks ∷ !BlocksMade

    A map from pool ID (the key hash of the stake pool operator's verification key) to the number of blocks made in the given epoch.

  • maxLL ∷ !Coin

    The maximum Lovelace supply. On mainnet, this value is equal to 45 * 10^15 (45 billion ADA).

  • deltaR1 ∷ !Coin

    The maximum amount of Lovelace which can be removed from the reserves to be given out as rewards for the given epoch.

  • deltaR2 ∷ !Coin

    The difference between the total Lovelace that could have been distributed as rewards this epoch (which is r) and what was actually distributed.

  • r ∷ !Coin

    The total Lovelace available for rewards for the given epoch, equal to rPot less deltaT1.

  • totalStake ∷ !Coin

    The maximum Lovelace supply (maxLL) less the current value of the reserves.

  • blocksCount ∷ !Integer

    The total number of blocks produced during the given epoch.

  • d ∷ !Rational

    The decentralization parameter.

  • expBlocks ∷ !Integer

    The number of blocks expected to be produced during the given epoch.

  • eta ∷ !Rational

    The ratio of the number of blocks actually made versus the number of blocks that were expected.

  • rPot ∷ !Coin

    The reward pot for the given epoch, equal to deltaR1 plus the fee pot.

  • deltaT1 ∷ !Coin

    The amount of Lovelace taken from the treasury for the given epoch.

  • activeStake ∷ !Coin

    The amount of Lovelace that is delegated during the given epoch.

  • pools ∷ !(Map (KeyHash 'StakePool) RewardProvenancePool)

    Individual stake pool provenance.

  • desirabilities ∷ !(Map (KeyHash 'StakePool) Desirability)

    A map from pool ID to the desirability score. See the stake pool ranking document.

Instances

Instances details
FromJSON RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

ToJSON RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Generic RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Associated Types

type Rep RewardProvenanceTypeType Source #

Show RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

DecCBOR RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

EncCBOR RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Default RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NFData RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Methods

rnfRewardProvenance → () Source #

Eq RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NoThunks RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep RewardProvenance Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep RewardProvenance = D1 ('MetaData "RewardProvenance" "Cardano.Ledger.Shelley.RewardProvenance" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "RewardProvenance" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "spe") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "blocks") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlocksMade)) :*: (S1 ('MetaSel ('Just "maxLL") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "deltaR1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) :*: ((S1 ('MetaSel ('Just "deltaR2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "r") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "totalStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "blocksCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer)))) :*: (((S1 ('MetaSel ('Just "d") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rational) :*: S1 ('MetaSel ('Just "expBlocks") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer)) :*: (S1 ('MetaSel ('Just "eta") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rational) :*: S1 ('MetaSel ('Just "rPot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) :*: ((S1 ('MetaSel ('Just "deltaT1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "activeStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "pools") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) RewardProvenancePool)) :*: S1 ('MetaSel ('Just "desirabilities") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) Desirability)))))))

data RewardProvenancePool Source #

Provenance for an individual stake pool's reward calculation.

Constructors

RewardProvenancePool 

Fields

Instances

Instances details
FromJSON RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

ToJSON RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Generic RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Associated Types

type Rep RewardProvenancePoolTypeType Source #

Show RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

DecCBOR RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

EncCBOR RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Default RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NFData RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Methods

rnfRewardProvenancePool → () Source #

Eq RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NoThunks RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep RewardProvenancePool Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

data Desirability Source #

The desirability score of a stake pool, as described in "Reward Sharing Schemes for Stake Pools". Additionally, the hit rate estimation described in the stake pool ranking document is included.

Instances

Instances details
FromJSON Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

ToJSON Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Generic Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Associated Types

type Rep DesirabilityTypeType Source #

Show Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

DecCBOR Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

EncCBOR Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NFData Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Methods

rnfDesirability → () Source #

Eq Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NoThunks Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep Desirability Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep Desirability = D1 ('MetaData "Desirability" "Cardano.Ledger.Shelley.RewardProvenance" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "Desirability" 'PrefixI 'True) (S1 ('MetaSel ('Just "desirabilityScore") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "hitRateEstimate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))