Last active
January 8, 2017 22:16
-
-
Save moocowmoo/947e3f60276eee74f4af1b3372f95c0a to your computer and use it in GitHub Desktop.
projection of total dash generated if budget is completely allocated (max) or never allocated (min)
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
# blockchain state at first block of 2017 | |
year_now = 2017 | |
now_height = 596411 | |
now_outstanding = 6990727 | |
# 200423 == average annual block discovery rate across 2 years | |
avg_blocks_per_year = float(((596411 - 395793) + (395793 - 195565)) / 2) | |
# subsidy reduction interval in blocks | |
CYCLE_LENGTH=210240 | |
def min_blok_subsidy(nHeight): | |
nSubsidy = float(5) # assume minimum subsidy | |
for i in range(CYCLE_LENGTH, nHeight, CYCLE_LENGTH): | |
nSubsidy -= nSubsidy/14 | |
return nSubsidy | |
future_year = float(year_now) | |
totals = { | |
"max" : now_outstanding, | |
"min" : now_outstanding | |
} | |
print "approx minimum maximum min/max difference" | |
print "date coins coins difference percentage" | |
for block in range(now_height, now_height+(CYCLE_LENGTH*200), CYCLE_LENGTH): | |
future_year += float(CYCLE_LENGTH / avg_blocks_per_year) | |
month = int((future_year - int(future_year)) * 12) + 1 | |
cycle_subsidy = (min_blok_subsidy(block) * CYCLE_LENGTH) | |
totals["max"] += int(cycle_subsidy * 1.0) # full budget allocated | |
totals["min"] += int(cycle_subsidy * 0.9) # no budget allocated | |
delta = totals["max"] - totals["min"] | |
delta_pct = (1.0 - float(totals["min"])/float(totals["max"])) * 100 | |
fmt="{:02d}/{} {:10,d} {:10,d} {:10,d} {:.2f}%" | |
mod_scale = int(future_year) <= 2050 and 1 or 5 | |
if int(future_year) % mod_scale == 0: | |
print fmt.format(month, int(future_year), totals["min"], totals["max"], delta, delta_pct) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run at https://repl.it/FDPd/5