Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- desirability :: ( NonNegativeInterval , Natural ) -> Coin -> PoolParams c -> PerformanceEstimate -> Coin -> Double
- newtype PerformanceEstimate = PerformanceEstimate { }
-
data
NonMyopic
crypto =
NonMyopic
{
- likelihoodsNM :: !( Map ( KeyHash ' StakePool crypto) Likelihood )
- rewardPotNM :: ! Coin
- getTopRankedPools :: ( HasField "_a0" pp NonNegativeInterval , HasField "_nOpt" pp Natural ) => Coin -> Coin -> pp -> Map ( KeyHash ' StakePool crypto) ( PoolParams crypto) -> Map ( KeyHash ' StakePool crypto) PerformanceEstimate -> Set ( KeyHash ' StakePool crypto)
- getTopRankedPoolsVMap :: ( HasField "_a0" pp NonNegativeInterval , HasField "_nOpt" pp Natural ) => Coin -> Coin -> pp -> VMap VB VB ( KeyHash ' StakePool crypto) ( PoolParams crypto) -> Map ( KeyHash ' StakePool crypto) PerformanceEstimate -> Set ( KeyHash ' StakePool crypto)
- nonMyopicStake :: HasField "_nOpt" pp Natural => pp -> StakeShare -> StakeShare -> StakeShare -> KeyHash ' StakePool c -> Set ( KeyHash ' StakePool c) -> StakeShare
- nonMyopicMemberRew :: ( HasField "_a0" pp NonNegativeInterval , HasField "_nOpt" pp Natural ) => pp -> Coin -> PoolParams c -> StakeShare -> StakeShare -> StakeShare -> Set ( KeyHash ' StakePool c) -> PerformanceEstimate -> Coin
- percentile' :: Likelihood -> PerformanceEstimate
- newtype Histogram = Histogram { }
-
newtype
LogWeight
=
LogWeight
{
- unLogWeight :: Float
- 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
data NonMyopic crypto Source #
NonMyopic | |
|
Instances
getTopRankedPools :: ( HasField "_a0" pp NonNegativeInterval , HasField "_nOpt" pp Natural ) => Coin -> Coin -> pp -> Map ( KeyHash ' StakePool crypto) ( PoolParams crypto) -> Map ( KeyHash ' StakePool crypto) PerformanceEstimate -> Set ( KeyHash ' StakePool crypto) Source #
Computes the top ranked stake pools corresponding to section 5.6.1 of "Design Specification for Delegation and Incentives in Cardano"
getTopRankedPoolsVMap :: ( HasField "_a0" pp NonNegativeInterval , HasField "_nOpt" pp Natural ) => Coin -> Coin -> pp -> VMap VB VB ( KeyHash ' StakePool crypto) ( PoolParams crypto) -> Map ( KeyHash ' StakePool crypto) PerformanceEstimate -> Set ( KeyHash ' StakePool crypto) Source #
nonMyopicStake :: HasField "_nOpt" pp Natural => pp -> 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 :: ( HasField "_a0" pp NonNegativeInterval , HasField "_nOpt" pp Natural ) => pp -> 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
Eq Histogram Source # | |
Show Histogram Source # | |
Generic Histogram Source # | |
type Rep Histogram Source # | |
Defined in Cardano.Ledger.Shelley.PoolRank
type
Rep
Histogram
=
D1
('
MetaData
"Histogram" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" '
True
) (
C1
('
MetaCons
"Histogram" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"unHistogram") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
StrictSeq
LogWeight
))))
|
Instances
likelihood :: Natural -> Double -> EpochSize -> Likelihood Source #
applyDecay :: Float -> Likelihood -> Likelihood Source #
Decay previous likelihood
newtype Likelihood Source #
Instances
leaderProbability :: ActiveSlotCoeff -> Rational -> UnitInterval -> Double Source #