shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.Rewards

Synopsis

Documentation

desirabilityPParams era → CoinPoolParams era → PerformanceEstimateCoinDouble Source #

Desirability calculation for non-myopic utily, corresponding to f^~ in section 5.6.1 of "Design Specification for Delegation and Incentives in Cardano"

newtype PerformanceEstimate Source #

This is a estimate of the proportion of allowed blocks a pool will make in the future. It is used for ranking pools in delegation.

Instances

Instances details
Eq PerformanceEstimate Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Show PerformanceEstimate Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Generic PerformanceEstimate Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Associated Types

type Rep PerformanceEstimateTypeType #

ToCBOR PerformanceEstimate Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

FromCBOR PerformanceEstimate Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

NoThunks PerformanceEstimate Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

noThunks ∷ Context → PerformanceEstimateIO (Maybe ThunkInfo)

wNoThunks ∷ Context → PerformanceEstimateIO (Maybe ThunkInfo)

showTypeOfProxy PerformanceEstimateString

type Rep PerformanceEstimate Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

type Rep PerformanceEstimate = D1 ('MetaData "PerformanceEstimate" "Shelley.Spec.Ledger.Rewards" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "PerformanceEstimate" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerformanceEstimate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))

data NonMyopic era Source #

Constructors

NonMyopic 

Instances

Instances details
Eq (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

(==)NonMyopic era → NonMyopic era → Bool #

(/=)NonMyopic era → NonMyopic era → Bool #

Show (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

showsPrecIntNonMyopic era → ShowS #

showNonMyopic era → String #

showList ∷ [NonMyopic era] → ShowS #

Generic (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Associated Types

type Rep (NonMyopic era) ∷ TypeType #

Methods

fromNonMyopic era → Rep (NonMyopic era) x #

toRep (NonMyopic era) x → NonMyopic era #

NFData (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

rnfNonMyopic era → () #

Era era ⇒ ToCBOR (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

toCBORNonMyopic era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (NonMyopic era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [NonMyopic era] → Size Source #

Era era ⇒ FromCBOR (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

fromCBORDecoder s (NonMyopic era) Source #

labelProxy (NonMyopic era) → Text Source #

NoThunks (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

noThunks ∷ Context → NonMyopic era → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → NonMyopic era → IO (Maybe ThunkInfo)

showTypeOfProxy (NonMyopic era) → String

type Rep (NonMyopic era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

type Rep (NonMyopic era) = D1 ('MetaData "NonMyopic" "Shelley.Spec.Ledger.Rewards" "shelley-spec-ledger-0.1.0.0-inplace" 'False) (C1 ('MetaCons "NonMyopic" 'PrefixI 'True) (S1 ('MetaSel ('Just "likelihoodsNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool (Crypto era)) Likelihood)) :*: S1 ('MetaSel ('Just "rewardPotNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

getTopRankedPoolsCoinCoinPParams era → Map (KeyHash 'StakePool (Crypto era)) (PoolParams era) → Map (KeyHash 'StakePool (Crypto era)) PerformanceEstimateSet (KeyHash 'StakePool (Crypto era)) Source #

Computes the top ranked stake pools corresponding to section 5.6.1 of "Design Specification for Delegation and Incentives in Cardano"

newtype StakeShare Source #

StakeShare type

Constructors

StakeShare 

Instances

Instances details
Eq StakeShare Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

(==)StakeShareStakeShareBool #

(/=)StakeShareStakeShareBool #

Ord StakeShare Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Show StakeShare Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Generic StakeShare Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Associated Types

type Rep StakeShareTypeType #

NoThunks StakeShare Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

noThunks ∷ Context → StakeShareIO (Maybe ThunkInfo)

wNoThunks ∷ Context → StakeShareIO (Maybe ThunkInfo)

showTypeOfProxy StakeShareString

type Rep StakeShare Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

type Rep StakeShare = D1 ('MetaData "StakeShare" "Shelley.Spec.Ledger.Rewards" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "StakeShare" 'PrefixI 'True) (S1 ('MetaSel ('Just "unStakeShare") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))

mkApparentPerformanceUnitIntervalRationalNaturalNaturalRational Source #

Calculate pool reward

nonMyopicStakePParams era → StakeShareStakeShareStakeShareKeyHash 'StakePool (Crypto era) → Set (KeyHash 'StakePool (Crypto era)) → StakeShare Source #

Compute the Non-Myopic Pool Stake

This function implements non-myopic stake calculation in section 5.6.2 of "Design Specification for Delegation and Incentives in Cardano". Note that the protocol parameters are implicit in the design document. Additionally, instead of passing a rank r to compare with k, we pass the top k desirable pools and check for membership.

nonMyopicMemberRewPParams era → CoinPoolParams era → StakeShareStakeShareStakeShareSet (KeyHash 'StakePool (Crypto era)) → PerformanceEstimateCoin Source #

Compute the Non-Myopic Pool Member Reward

This function implements equation (3) in section 5.6.4 of "Design Specification for Delegation and Incentives in Cardano". Note that the protocol parameters and the reward pot are implicit in the design document. Additionally, instead of passing a rank r to compare with k, we pass the top k desirable pools and check for membership.

newtype Histogram Source #

Constructors

Histogram 

Instances

Instances details
Eq Histogram Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

(==)HistogramHistogramBool #

(/=)HistogramHistogramBool #

Show Histogram Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

showsPrecIntHistogramShowS #

showHistogramString #

showList ∷ [Histogram] → ShowS #

Generic Histogram Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Associated Types

type Rep HistogramTypeType #

Methods

fromHistogramRep Histogram x #

toRep Histogram x → Histogram #

type Rep Histogram Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

type Rep Histogram = D1 ('MetaData "Histogram" "Shelley.Spec.Ledger.Rewards" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "Histogram" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHistogram") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictSeq LogWeight))))

newtype LogWeight Source #

Constructors

LogWeight 

Fields

Instances

Instances details
Eq LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

(==)LogWeightLogWeightBool #

(/=)LogWeightLogWeightBool #

Num LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Ord LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Show LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

showsPrecIntLogWeightShowS #

showLogWeightString #

showList ∷ [LogWeight] → ShowS #

Generic LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Associated Types

type Rep LogWeightTypeType #

Methods

fromLogWeightRep LogWeight x #

toRep LogWeight x → LogWeight #

NFData LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

rnfLogWeight → () #

ToCBOR LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

toCBORLogWeightEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy LogWeightSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [LogWeight] → Size Source #

FromCBOR LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

NoThunks LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

noThunks ∷ Context → LogWeightIO (Maybe ThunkInfo)

wNoThunks ∷ Context → LogWeightIO (Maybe ThunkInfo)

showTypeOfProxy LogWeightString

type Rep LogWeight Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

type Rep LogWeight = D1 ('MetaData "LogWeight" "Shelley.Spec.Ledger.Rewards" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "LogWeight" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLogWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)))

applyDecayFloatLikelihoodLikelihood Source #

Decay previous likelihood

newtype Likelihood Source #

Constructors

Likelihood 

Instances

Instances details
Eq Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

(==)LikelihoodLikelihoodBool #

(/=)LikelihoodLikelihoodBool #

Show Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Generic Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Associated Types

type Rep LikelihoodTypeType #

Semigroup Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Monoid Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

NFData Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

rnfLikelihood → () #

ToCBOR Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

toCBORLikelihoodEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy LikelihoodSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Likelihood] → Size Source #

FromCBOR Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

NoThunks Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

Methods

noThunks ∷ Context → LikelihoodIO (Maybe ThunkInfo)

wNoThunks ∷ Context → LikelihoodIO (Maybe ThunkInfo)

showTypeOfProxy LikelihoodString

type Rep Likelihood Source # 
Instance details

Defined in Shelley.Spec.Ledger.Rewards

type Rep Likelihood = D1 ('MetaData "Likelihood" "Shelley.Spec.Ledger.Rewards" "shelley-spec-ledger-0.1.0.0-inplace" 'True) (C1 ('MetaCons "Likelihood" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLikelihood") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictSeq LogWeight))))