cardano-ledger-shelley-1.18.0.0: Shelley Ledger Executable Model
Safe HaskellNone
LanguageHaskell2010

Cardano.Ledger.Shelley.PoolRank

Synopsis

Documentation

desirabilityNonNegativeIntervalNonZero Word16CoinStakePoolParamsPerformanceEstimateCoinDouble Source #

Desirability calculation for non-myopic utility, 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
DecCBOR PerformanceEstimate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

EncCBOR PerformanceEstimate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Generic PerformanceEstimate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Rep PerformanceEstimate 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep PerformanceEstimate = D1 ('MetaData "PerformanceEstimate" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'True) (C1 ('MetaCons "PerformanceEstimate" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerformanceEstimate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))
Show PerformanceEstimate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Eq PerformanceEstimate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NoThunks PerformanceEstimate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep PerformanceEstimate Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep PerformanceEstimate = D1 ('MetaData "PerformanceEstimate" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'True) (C1 ('MetaCons "PerformanceEstimate" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerformanceEstimate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))

data NonMyopic Source #

Constructors

NonMyopic 

Instances

Instances details
ToJSON NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

DecShareCBOR NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Share NonMyopic 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

EncCBOR NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

ToKeyValuePairs NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

toKeyValuePairsKeyValue e kv ⇒ NonMyopic → [kv] Source #

Default NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

defNonMyopic Source #

NFData NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

rnfNonMyopic → () #

Generic NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Rep NonMyopic 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep NonMyopic = D1 ('MetaData "NonMyopic" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'False) (C1 ('MetaCons "NonMyopic" 'PrefixI 'True) (S1 ('MetaSel ('Just "likelihoodsNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) Likelihood)) :*: S1 ('MetaSel ('Just "rewardPotNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

Methods

fromNonMyopicRep NonMyopic x #

toRep NonMyopic x → NonMyopic #

Show NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

showsPrecIntNonMyopicShowS #

showNonMyopicString #

showList ∷ [NonMyopic] → ShowS #

Eq NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

(==)NonMyopicNonMyopicBool #

(/=)NonMyopicNonMyopicBool #

NoThunks NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Share NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep NonMyopic = D1 ('MetaData "NonMyopic" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'False) (C1 ('MetaCons "NonMyopic" 'PrefixI 'True) (S1 ('MetaSel ('Just "likelihoodsNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) Likelihood)) :*: S1 ('MetaSel ('Just "rewardPotNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

getTopRankedPoolsEraPParams era ⇒ CoinCoinPParams era → Map (KeyHash 'StakePool) StakePoolParamsMap (KeyHash 'StakePool) PerformanceEstimateSet (KeyHash 'StakePool) Source #

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

nonMyopicStakeEraPParams era ⇒ PParams era → StakeShareStakeShareStakeShareKeyHash 'StakePoolSet (KeyHash 'StakePool) → 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.

nonMyopicMemberRewEraPParams era ⇒ PParams era → CoinStakePoolParamsStakeShareStakeShareStakeShareSet (KeyHash 'StakePool) → 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
Generic Histogram Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Rep Histogram 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep Histogram = D1 ('MetaData "Histogram" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'True) (C1 ('MetaCons "Histogram" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHistogram") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictSeq LogWeight))))

Methods

fromHistogramRep Histogram x #

toRep Histogram x → Histogram #

Show Histogram Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

showsPrecIntHistogramShowS #

showHistogramString #

showList ∷ [Histogram] → ShowS #

Eq Histogram Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

(==)HistogramHistogramBool #

(/=)HistogramHistogramBool #

type Rep Histogram Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep Histogram = D1 ('MetaData "Histogram" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.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
FromJSON LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

ToJSON LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

DecCBOR LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

EncCBOR LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NFData LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

rnfLogWeight → () #

Generic LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Rep LogWeight 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep LogWeight = D1 ('MetaData "LogWeight" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'True) (C1 ('MetaCons "LogWeight" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLogWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)))

Methods

fromLogWeightRep LogWeight x #

toRep LogWeight x → LogWeight #

Num LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Show LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

showsPrecIntLogWeightShowS #

showLogWeightString #

showList ∷ [LogWeight] → ShowS #

Eq LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

(==)LogWeightLogWeightBool #

(/=)LogWeightLogWeightBool #

Ord LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NoThunks LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep LogWeight = D1 ('MetaData "LogWeight" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.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
ToJSON Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

DecCBOR Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

EncCBOR Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NFData Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

rnfLikelihood → () #

Monoid Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Semigroup Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Generic Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Rep Likelihood 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep Likelihood = D1 ('MetaData "Likelihood" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'True) (C1 ('MetaCons "Likelihood" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLikelihood") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictSeq LogWeight))))
Show Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Eq Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

(==)LikelihoodLikelihoodBool #

(/=)LikelihoodLikelihoodBool #

Ord Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NoThunks Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep Likelihood Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep Likelihood = D1 ('MetaData "Likelihood" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.18.0.0-inplace" 'True) (C1 ('MetaCons "Likelihood" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLikelihood") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictSeq LogWeight))))