cardano-ledger-shelley-0.1.0.0
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Shelley.PoolRank

Synopsis

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

Instances details
Eq PerformanceEstimate Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Show PerformanceEstimate Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Generic PerformanceEstimate Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

ToCBOR PerformanceEstimate Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

FromCBOR PerformanceEstimate Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NoThunks PerformanceEstimate Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep PerformanceEstimate Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep PerformanceEstimate = D1 (' MetaData "PerformanceEstimate" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' True ) ( C1 (' MetaCons "PerformanceEstimate" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unPerformanceEstimate") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Double )))

data NonMyopic crypto Source #

Instances

Instances details
Eq ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Show ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Generic ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Rep ( NonMyopic crypto) :: Type -> Type Source #

NFData ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Methods

rnf :: NonMyopic crypto -> () Source #

Crypto crypto => ToCBOR ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Crypto crypto => FromSharedCBOR ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Associated Types

type Share ( NonMyopic crypto) Source #

Default ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NoThunks ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep ( NonMyopic crypto) = D1 (' MetaData "NonMyopic" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' False ) ( C1 (' MetaCons "NonMyopic" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "likelihoodsNM") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Map ( KeyHash ' StakePool crypto) Likelihood )) :*: S1 (' MetaSel (' Just "rewardPotNM") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 Coin )))
type Share ( NonMyopic crypto) Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

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"

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.

newtype LogWeight Source #

Constructors

LogWeight

Instances

Instances details
Eq LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Num LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Ord LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Show LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Generic LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NFData LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

ToCBOR LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

FromCBOR LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NoThunks LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep LogWeight Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep LogWeight = D1 (' MetaData "LogWeight" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' True ) ( C1 (' MetaCons "LogWeight" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unLogWeight") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Float )))

newtype Likelihood Source #

Instances

Instances details
Eq Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Ord Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Show Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Generic Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Semigroup Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

Monoid Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NFData Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

ToCBOR Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

FromCBOR Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

NoThunks Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep Likelihood Source #
Instance details

Defined in Cardano.Ledger.Shelley.PoolRank

type Rep Likelihood = D1 (' MetaData "Likelihood" "Cardano.Ledger.Shelley.PoolRank" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' True ) ( C1 (' MetaCons "Likelihood" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unLikelihood") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( StrictSeq LogWeight ))))