Safe Haskell | None |
---|---|
Language | Haskell98 |
Shelley.Spec.Ledger.Rewards
Synopsis
- desirability ∷ PParams era → Coin → PoolParams era → PerformanceEstimate → Coin → Double
- newtype PerformanceEstimate = PerformanceEstimate {}
- data NonMyopic era = NonMyopic {
- likelihoodsNM ∷ !(Map (KeyHash 'StakePool (Crypto era)) Likelihood)
- rewardPotNM ∷ !Coin
- emptyNonMyopic ∷ NonMyopic era
- getTopRankedPools ∷ Coin → Coin → PParams era → Map (KeyHash 'StakePool (Crypto era)) (PoolParams era) → Map (KeyHash 'StakePool (Crypto era)) PerformanceEstimate → Set (KeyHash 'StakePool (Crypto era))
- newtype StakeShare = StakeShare {}
- mkApparentPerformance ∷ UnitInterval → Rational → Natural → Natural → Rational
- reward ∷ PParams era → BlocksMade era → Coin → Set (Credential 'Staking era) → Map (KeyHash 'StakePool (Crypto era)) (PoolParams era) → Stake era → Map (Credential 'Staking era) (KeyHash 'StakePool (Crypto era)) → Coin → ActiveSlotCoeff → EpochSize → (Map (Credential 'Staking era) Coin, Map (KeyHash 'StakePool (Crypto era)) Likelihood)
- nonMyopicStake ∷ PParams era → StakeShare → StakeShare → StakeShare → KeyHash 'StakePool (Crypto era) → Set (KeyHash 'StakePool (Crypto era)) → StakeShare
- nonMyopicMemberRew ∷ PParams era → Coin → PoolParams era → StakeShare → StakeShare → StakeShare → Set (KeyHash 'StakePool (Crypto era)) → 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 ∷ PParams era → Coin → PoolParams era → PerformanceEstimate → Coin → Double Source #
Desirability calculation for non-myopic utily, 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
Eq (NonMyopic era) Source # | |
Show (NonMyopic era) Source # | |
Generic (NonMyopic era) Source # | |
NFData (NonMyopic era) Source # | |
Defined in Shelley.Spec.Ledger.Rewards | |
Era era ⇒ ToCBOR (NonMyopic era) Source # | |
Era era ⇒ FromCBOR (NonMyopic era) Source # | |
NoThunks (NonMyopic era) Source # | |
type Rep (NonMyopic era) Source # | |
Defined in Shelley.Spec.Ledger.Rewards type Rep (NonMyopic era) = D1 ('MetaData "NonMyopic" "Shelley.Spec.Ledger.Rewards" "shelley-spec-ledger-0.1.0.0-inplace" 'False) (C1 ('MetaCons "NonMyopic" 'PrefixI 'True) (S1 ('MetaSel ('Just "likelihoodsNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool (Crypto era)) Likelihood)) :*: S1 ('MetaSel ('Just "rewardPotNM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) |
emptyNonMyopic ∷ NonMyopic era Source #
getTopRankedPools ∷ Coin → Coin → PParams era → Map (KeyHash 'StakePool (Crypto era)) (PoolParams era) → Map (KeyHash 'StakePool (Crypto era)) PerformanceEstimate → Set (KeyHash 'StakePool (Crypto era)) Source #
Computes the top ranked stake pools corresponding to section 5.6.1 of "Design Specification for Delegation and Incentives in Cardano"
mkApparentPerformance ∷ UnitInterval → Rational → Natural → Natural → Rational Source #
Calculate pool reward
reward ∷ PParams era → BlocksMade era → Coin → Set (Credential 'Staking era) → Map (KeyHash 'StakePool (Crypto era)) (PoolParams era) → Stake era → Map (Credential 'Staking era) (KeyHash 'StakePool (Crypto era)) → Coin → ActiveSlotCoeff → EpochSize → (Map (Credential 'Staking era) Coin, Map (KeyHash 'StakePool (Crypto era)) Likelihood) Source #
nonMyopicStake ∷ PParams era → StakeShare → StakeShare → StakeShare → KeyHash 'StakePool (Crypto era) → Set (KeyHash 'StakePool (Crypto era)) → 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 ∷ PParams era → Coin → PoolParams era → StakeShare → StakeShare → StakeShare → Set (KeyHash 'StakePool (Crypto era)) → 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
Eq LogWeight Source # | |
Num LogWeight Source # | |
Ord LogWeight Source # | |
Defined in Shelley.Spec.Ledger.Rewards | |
Show LogWeight Source # | |
Generic LogWeight Source # | |
NFData LogWeight Source # | |
Defined in Shelley.Spec.Ledger.Rewards | |
ToCBOR LogWeight Source # | |
FromCBOR LogWeight Source # | |
NoThunks LogWeight Source # | |
type Rep LogWeight Source # | |
Defined in Shelley.Spec.Ledger.Rewards |
likelihood ∷ Natural → Double → EpochSize → Likelihood Source #
applyDecay ∷ Float → Likelihood → Likelihood Source #
Decay previous likelihood
newtype Likelihood Source #
Constructors
Likelihood | |
Fields |