| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Shelley.PoolRank
Synopsis
- desirability ∷ NonNegativeInterval → NonZero Word16 → Coin → StakePoolParams → PerformanceEstimate → Coin → Double
- newtype PerformanceEstimate = PerformanceEstimate {}
- data NonMyopic = NonMyopic {
- likelihoodsNM ∷ !(Map (KeyHash 'StakePool) Likelihood)
- rewardPotNM ∷ !Coin
- getTopRankedPools ∷ EraPParams era ⇒ Coin → Coin → PParams era → Map (KeyHash 'StakePool) StakePoolParams → Map (KeyHash 'StakePool) PerformanceEstimate → Set (KeyHash 'StakePool)
- getTopRankedPoolsVMap ∷ EraPParams era ⇒ Coin → Coin → PParams era → VMap VB VB (KeyHash 'StakePool) StakePoolParams → Map (KeyHash 'StakePool) PerformanceEstimate → Set (KeyHash 'StakePool)
- nonMyopicStake ∷ EraPParams era ⇒ PParams era → StakeShare → StakeShare → StakeShare → KeyHash 'StakePool → Set (KeyHash 'StakePool) → StakeShare
- nonMyopicMemberRew ∷ EraPParams era ⇒ PParams era → Coin → StakePoolParams → StakeShare → StakeShare → StakeShare → Set (KeyHash 'StakePool) → PerformanceEstimate → Coin
- percentile' ∷ Likelihood → PerformanceEstimate
- newtype Histogram = Histogram {}
- newtype LogWeight = LogWeight {}
- likelihood ∷ Natural → Double → EpochSize → Likelihood
- applyDecay ∷ Float → Likelihood → Likelihood
- newtype Likelihood = Likelihood {}
- leaderProbability ∷ ActiveSlotCoeff → Rational → UnitInterval → Double
Documentation
desirability ∷ NonNegativeInterval → NonZero Word16 → Coin → StakePoolParams → PerformanceEstimate → Coin → Double 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.
Constructors
| PerformanceEstimate | |
Fields | |
Instances
Constructors
| NonMyopic | |
Fields
| |
Instances
| ToJSON NonMyopic Source # | |||||
| DecShareCBOR NonMyopic Source # | |||||
| EncCBOR NonMyopic Source # | |||||
| ToKeyValuePairs NonMyopic Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Methods toKeyValuePairs ∷ KeyValue e kv ⇒ NonMyopic → [kv] Source # | |||||
| Default NonMyopic Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| NFData NonMyopic Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| Generic NonMyopic Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Associated Types
| |||||
| Show NonMyopic Source # | |||||
| Eq NonMyopic Source # | |||||
| NoThunks NonMyopic Source # | |||||
| type Share NonMyopic Source # | |||||
| type Rep NonMyopic Source # | |||||
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))) | |||||
getTopRankedPools ∷ EraPParams era ⇒ Coin → Coin → PParams era → Map (KeyHash 'StakePool) StakePoolParams → Map (KeyHash 'StakePool) PerformanceEstimate → Set (KeyHash 'StakePool) Source #
Computes the top ranked stake pools corresponding to section 5.6.1 of "Design Specification for Delegation and Incentives in Cardano"
getTopRankedPoolsVMap ∷ EraPParams era ⇒ Coin → Coin → PParams era → VMap VB VB (KeyHash 'StakePool) StakePoolParams → Map (KeyHash 'StakePool) PerformanceEstimate → Set (KeyHash 'StakePool) Source #
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.
nonMyopicMemberRew ∷ EraPParams era ⇒ PParams era → Coin → StakePoolParams → StakeShare → StakeShare → StakeShare → Set (KeyHash 'StakePool) → PerformanceEstimate → Coin 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.
Constructors
| Histogram | |
Fields | |
Constructors
| LogWeight | |
Fields | |
Instances
| FromJSON LogWeight Source # | |||||
| ToJSON LogWeight Source # | |||||
| DecCBOR LogWeight Source # | |||||
| EncCBOR LogWeight Source # | |||||
| NFData LogWeight Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| Generic LogWeight Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Associated Types
| |||||
| Num LogWeight Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| Show LogWeight Source # | |||||
| Eq LogWeight Source # | |||||
| Ord LogWeight Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| NoThunks LogWeight Source # | |||||
| type Rep LogWeight Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
likelihood ∷ Natural → Double → EpochSize → Likelihood Source #
applyDecay ∷ Float → Likelihood → Likelihood Source #
Decay previous likelihood
newtype Likelihood Source #
Constructors
| Likelihood | |
Fields | |
Instances
| ToJSON Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Methods toJSON ∷ Likelihood → Value Source # toEncoding ∷ Likelihood → Encoding Source # toJSONList ∷ [Likelihood] → Value Source # toEncodingList ∷ [Likelihood] → Encoding Source # omitField ∷ Likelihood → Bool Source # | |||||
| DecCBOR Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| EncCBOR Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Methods encCBOR ∷ Likelihood → Encoding Source # | |||||
| NFData Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Methods rnf ∷ Likelihood → () # | |||||
| Monoid Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| Semigroup Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Methods (<>) ∷ Likelihood → Likelihood → Likelihood # sconcat ∷ NonEmpty Likelihood → Likelihood # stimes ∷ Integral b ⇒ b → Likelihood → Likelihood # | |||||
| Generic Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Associated Types
| |||||
| Show Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Methods showsPrec ∷ Int → Likelihood → ShowS # show ∷ Likelihood → String # showList ∷ [Likelihood] → ShowS # | |||||
| Eq Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| Ord Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank Methods compare ∷ Likelihood → Likelihood → Ordering # (<) ∷ Likelihood → Likelihood → Bool # (<=) ∷ Likelihood → Likelihood → Bool # (>) ∷ Likelihood → Likelihood → Bool # (>=) ∷ Likelihood → Likelihood → Bool # max ∷ Likelihood → Likelihood → Likelihood # min ∷ Likelihood → Likelihood → Likelihood # | |||||
| NoThunks Likelihood Source # | |||||
Defined in Cardano.Ledger.Shelley.PoolRank | |||||
| type Rep Likelihood Source # | |||||
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)))) | |||||