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

Cardano.Ledger.Shelley.RewardProvenance

Synopsis

Documentation

data RewardProvenance c 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 c)

    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 c) (RewardProvenancePool c))

    Individual stake pool provenance.

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

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

Instances

Instances details
Crypto c ⇒ FromJSON (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Crypto c ⇒ ToJSON (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Generic (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Associated Types

type Rep (RewardProvenance c) ∷ TypeType Source #

Show (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Crypto c ⇒ DecCBOR (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Crypto c ⇒ EncCBOR (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Default (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NFData (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Methods

rnfRewardProvenance c → () Source #

Eq (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NoThunks (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep (RewardProvenance c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep (RewardProvenance c) = D1 ('MetaData "RewardProvenance" "Cardano.Ledger.Shelley.RewardProvenance" "cardano-ledger-shelley-1.15.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 c))) :*: (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 c) (RewardProvenancePool c))) :*: S1 ('MetaSel ('Just "desirabilities") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool c) Desirability)))))))

data RewardProvenancePool c Source #

Provenance for an individual stake pool's reward calculation.

Constructors

RewardProvenancePool 

Fields

Instances

Instances details
Crypto c ⇒ FromJSON (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Crypto c ⇒ ToJSON (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Generic (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Associated Types

type Rep (RewardProvenancePool c) ∷ TypeType Source #

Show (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Crypto c ⇒ DecCBOR (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Crypto c ⇒ EncCBOR (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Crypto c ⇒ Default (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NFData (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

Methods

rnfRewardProvenancePool c → () Source #

Eq (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

NoThunks (RewardProvenancePool c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.RewardProvenance

type Rep (RewardProvenancePool c) 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.15.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)))