Skip to content

Commit

Permalink
Update eras/shelley/impl/src/Cardano/Ledger/Shelley/PoolRank.hs
Browse files Browse the repository at this point in the history
Co-authored-by: Alexey Kuleshevich <[email protected]>
  • Loading branch information
Soupstraw and lehins committed Jan 27, 2025
1 parent 2c8ac9f commit b435c9d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/PoolRank.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import Cardano.Ledger.BaseTypes (
NonZero (..),
UnitInterval,
activeSlotVal,
knownNonZero,
knownNonZeroBounded,
nonZeroOr,
toIntegerNonZero,
Expand Down Expand Up @@ -279,7 +280,7 @@ desirability ::
PerformanceEstimate ->
Coin ->
Double
desirability (a0, nOpt) r pool (PerformanceEstimate p) totalStake =
desirability a0 nOpt r pool (PerformanceEstimate p) totalStake =
if fTilde <= cost
then 0
else (fTilde - cost) * (1 - margin)
Expand Down Expand Up @@ -336,7 +337,8 @@ getTopRankedPoolsInternal rPot totalStake pp pdata =
rankings =
[ ( hk
, desirability
(pp ^. ppA0L, (pp ^. ppNOptL) `nonZeroOr` knownNonZeroBounded @1)
(pp ^. ppA0L)
((pp ^. ppNOptL) `nonZeroOr` knownNonZeroBounded @1)
rPot
pool
ap
Expand All @@ -362,7 +364,7 @@ nonMyopicStake ::
Set (KeyHash 'StakePool) ->
StakeShare
nonMyopicStake pp (StakeShare s) (StakeShare sigma) (StakeShare t) kh topPools =
let z0 = 1 %. toIntegerNonZero ((pp ^. ppNOptL) `nonZeroOr` knownNonZeroBounded @1)
let z0 = 1 %. (toInteger (pp ^. ppNOptL) `nonZeroOr` knownNonZero @1)
in if kh `Set.member` topPools
then StakeShare (max (sigma + t) z0)
else StakeShare (s + t)
Expand Down

0 comments on commit b435c9d

Please sign in to comment.