Created
May 27, 2021 14:26
-
-
Save rwarren/4af163d4d7dde9bcfe4fdd1cd29e4414 to your computer and use it in GitHub Desktop.
Chia stats estimator functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def daysToWin(netspaceFraction, confidence = 0.95, challengesPerDay = 4608): | |
losingProbability = 1 - netspaceFraction | |
challengesToWin = math.log(1 - confidence, losingProbability) | |
return challengesToWin / challengesPerDay | |
def earningsPerYear(xchValue_USD, netspaceFraction, confidence = 0.95, challengesPerDay = 4608, xchPerWin = 2): | |
xchPerDay = xchPerWin / daysToWin(netspaceFraction, confidence, challengesPerDay) | |
dailyUSD = xchValue_USD * xchPerDay | |
return dailyUSD * 365 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment