Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- desirability ∷ (NonNegativeInterval, Natural) → Coin → PoolParams c → PerformanceEstimate → Coin → Double
- newtype PerformanceEstimate = PerformanceEstimate {}
- data NonMyopic c = NonMyopic {
- likelihoodsNM ∷ !(Map (KeyHash 'StakePool c) Likelihood)
- rewardPotNM ∷ !Coin
- getTopRankedPools ∷ EraPParams era ⇒ Coin → Coin → PParams era → Map (KeyHash 'StakePool c) (PoolParams c) → Map (KeyHash 'StakePool c) PerformanceEstimate → Set (KeyHash 'StakePool c)
- getTopRankedPoolsVMap ∷ EraPParams era ⇒ Coin → Coin → PParams era → VMap VB VB (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)) → Map (KeyHash 'StakePool (EraCrypto era)) PerformanceEstimate → Set (KeyHash 'StakePool (EraCrypto era))
- nonMyopicStake ∷ EraPParams era ⇒ PParams era → StakeShare → StakeShare → StakeShare → KeyHash 'StakePool c → Set (KeyHash 'StakePool c) → StakeShare
- nonMyopicMemberRew ∷ EraPParams era ⇒ PParams era → Coin → PoolParams c → StakeShare → StakeShare → StakeShare → Set (KeyHash 'StakePool c) → 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, Natural) → Coin → PoolParams c → 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
Crypto crypto ⇒ ToJSON (NonMyopic crypto) Source # | |
Generic (NonMyopic c) Source # | |
Show (NonMyopic c) Source # | |
Crypto c ⇒ DecShareCBOR (NonMyopic c) Source # | |
Crypto c ⇒ EncCBOR (NonMyopic c) Source # | |
Default (NonMyopic c) Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank | |
NFData (NonMyopic c) Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank | |
Eq (NonMyopic c) Source # | |
NoThunks (NonMyopic c) Source # | |
type Rep (NonMyopic c) Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank type Rep (NonMyopic c) = D1 ('MetaData "NonMyopic" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-1.15.0.0-inplace" 'False) (C1 ('MetaCons "NonMyopic" 'PrefixI 'True) (S1 ('MetaSel ('Just "likelihoodsNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool c) Likelihood)) :*: S1 ('MetaSel ('Just "rewardPotNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) | |
type Share (NonMyopic c) Source # | |
getTopRankedPools ∷ EraPParams era ⇒ Coin → Coin → PParams era → Map (KeyHash 'StakePool c) (PoolParams c) → Map (KeyHash 'StakePool c) PerformanceEstimate → Set (KeyHash 'StakePool c) 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 (EraCrypto era)) (PoolParams (EraCrypto era)) → Map (KeyHash 'StakePool (EraCrypto era)) PerformanceEstimate → Set (KeyHash 'StakePool (EraCrypto era)) Source #
nonMyopicStake ∷ EraPParams era ⇒ PParams era → StakeShare → StakeShare → StakeShare → KeyHash 'StakePool c → Set (KeyHash 'StakePool c) → 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 c → StakeShare → StakeShare → StakeShare → Set (KeyHash 'StakePool c) → 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 #