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

Cardano.Ledger.Shelley.PoolRank

Synopsis

Documentation

desirability ∷ NonNegativeInterval → NonZero Word16 → Coin → StakePoolParams era → PerformanceEstimate → Coin → Double Source #

Deprecated: In favor of calcStakePoolDesirability

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.21.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.21.0.0-inplace" 'True) (C1 ('MetaCons "PerformanceEstimate" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPerformanceEstimate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))

data NonMyopic Source #

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

toKeyValuePairs ∷ KeyValue e kv ⇒ NonMyopic → [kv] Source #

Default NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

def ∷ NonMyopic Source #

NFData NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

rnf ∷ NonMyopic → () #

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.21.0.0-inplace" 'False) (C1 ('MetaCons "NonMyopic" 'PrefixI 'True) (S1 ('MetaSel ('Just "likelihoodsNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (KeyHash 'StakePool) Likelihood)) :*: S1 ('MetaSel ('Just "rewardPotNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

Methods

from ∷ NonMyopic → Rep NonMyopic x #

to ∷ Rep NonMyopic x → NonMyopic #

Show NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

showsPrec ∷ Int → NonMyopic → ShowS #

show ∷ NonMyopic → String #

showList ∷ [NonMyopic] → ShowS #

Eq NonMyopic Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

(==) ∷ NonMyopic → NonMyopic → Bool #

(/=) ∷ NonMyopic → NonMyopic → Bool #

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.21.0.0-inplace" 'False) (C1 ('MetaCons "NonMyopic" 'PrefixI 'True) (S1 ('MetaSel ('Just "likelihoodsNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VMap VB VB (KeyHash 'StakePool) Likelihood)) :*: S1 ('MetaSel ('Just "rewardPotNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

nonMyopicStake ∷ EraPParams era ⇒ PParams era → StakeShare → StakeShare → StakeShare → KeyHash 'StakePool → Set (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.

calcNonMyopicMemberReward Source #

Arguments

∷ EraPParams era 
⇒ PParams era 
→ Coin 
→ KeyHash 'StakePool

Stake pool id

→ Coin

Stake pool cost

→ UnitInterval

Stake pool margin

→ StakeShare 
→ StakeShare 
→ StakeShare 
→ Set (KeyHash 'StakePool) 
→ PerformanceEstimate 
→ Coin 

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.21.0.0-inplace" 'True) (C1 ('MetaCons "Histogram" 'PrefixI 'True) (S1 ('MetaSel ('Just "unHistogram") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictSeq LogWeight))))

Methods

from ∷ Histogram → Rep Histogram x #

to ∷ Rep Histogram x → Histogram #

Show Histogram Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

showsPrec ∷ Int → Histogram → ShowS #

show ∷ Histogram → String #

showList ∷ [Histogram] → ShowS #

Eq Histogram Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

(==) ∷ Histogram → Histogram → Bool #

(/=) ∷ Histogram → Histogram → Bool #

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.21.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

rnf ∷ LogWeight → () #

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.21.0.0-inplace" 'True) (C1 ('MetaCons "LogWeight" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLogWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)))

Methods

from ∷ LogWeight → Rep LogWeight x #

to ∷ Rep 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

showsPrec ∷ Int → LogWeight → ShowS #

show ∷ LogWeight → String #

showList ∷ [LogWeight] → ShowS #

Eq LogWeight Source # 
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

(==) ∷ LogWeight → LogWeight → Bool #

(/=) ∷ LogWeight → LogWeight → Bool #

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.21.0.0-inplace" 'True) (C1 ('MetaCons "LogWeight" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLogWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Float)))

applyDecay ∷ Float → Likelihood → Likelihood 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

rnf ∷ Likelihood → () #

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.21.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

(==) ∷ Likelihood → Likelihood → Bool #

(/=) ∷ Likelihood → Likelihood → Bool #

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.21.0.0-inplace" 'True) (C1 ('MetaCons "Likelihood" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLikelihood") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StrictSeq LogWeight))))