def remaining_emission(N_tot, block_n):
# TODO: This is more related to the way QRL works.. Move to another place
"""
calculate remaining emission at block_n: N=total initial coin supply, coeff = decay constant
need to use decimal as floating point not precise enough on different platforms..
:param N_tot:
:param block_n:
:return:
>>> remaining_emission(1, 1)
Decimal('0.99999996')
"""
# TODO: Verify these values and formula
coeff = calc_coeff(config.dev.max_coin_supply, 420480000)
# FIXME: Magic number? Unify
return decimal.Decimal(N_tot * decimal.Decimal(-coeff * block_n).exp()) \
.quantize(decimal.Decimal('1.00000000'), rounding=decimal.ROUND_HALF_UP)
评论列表
文章目录