Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- desirability ∷ (NonNegativeInterval, Word16) → Coin → PoolParams → 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) PoolParams → Map (KeyHash 'StakePool) PerformanceEstimate → Set (KeyHash 'StakePool)
- getTopRankedPoolsVMap ∷ EraPParams era ⇒ Coin → Coin → PParams era → VMap VB VB (KeyHash 'StakePool) PoolParams → 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 → PoolParams → 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, Word16) → Coin → PoolParams → 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.
Instances
NonMyopic | |
|
Instances
ToJSON NonMyopic Source # | |
Generic NonMyopic Source # | |
Show NonMyopic Source # | |
DecShareCBOR NonMyopic Source # | |
EncCBOR NonMyopic Source # | |
Default NonMyopic Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank | |
NFData NonMyopic Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank | |
Eq NonMyopic Source # | |
NoThunks 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.16.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))) | |
type Share NonMyopic Source # | |
getTopRankedPools ∷ EraPParams era ⇒ Coin → Coin → PParams era → Map (KeyHash 'StakePool) PoolParams → 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) PoolParams → 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 → PoolParams → 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.
Instances
FromJSON LogWeight Source # | |
ToJSON LogWeight Source # | |
Generic LogWeight Source # | |
Num LogWeight Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank | |
Show LogWeight Source # | |
DecCBOR LogWeight Source # | |
EncCBOR LogWeight Source # | |
NFData LogWeight Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank | |
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 #