Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def inf_apy():
- auction_adjust = 0.3 / 60
- auction_max = 60
- falloff = 0.05
- max_inflation = 0.1
- min_inflation = 0.025
- stake_target = 0.7504
- total_staked = 6_915_481_381_481_673_659
- total_issuance = 12_723_233_806_674_928_899
- num_auctions = 52
- if total_staked == 0 or total_issuance == 0:
- staked_fraction = 0
- else:
- staked_fraction = total_staked / total_issuance
- ideal_stake = stake_target - min(auction_max, num_auctions) * auction_adjust
- print(f'sf = {staked_fraction}_ is = {ideal_stake}')
- ideal_interest = max_inflation / ideal_stake
- if staked_fraction <= ideal_stake:
- inflation = min_inflation + staked_fraction * (ideal_interest - min_inflation / ideal_stake)
- else:
- power_of_two = 2 ** ((ideal_stake - staked_fraction) / falloff)
- inflation = min_inflation + (ideal_interest * ideal_stake - min_inflation) * power_of_two
- print(f'pow2 = {power_of_two}_ inf = {inflation}')
- return inflation, staked_fraction, inflation / staked_fraction, ideal_stake
- print(inf_apy())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement