Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def inf_apy():
- auction_adjust = 0
- auction_max = 0
- falloff = 0.05
- max_inflation = 0.1
- min_inflation = 0.025
- stake_target = 0.75
- total_staked = 6_420_000_493_040_793_352
- total_issuance = 12_325_604_969_594_086_733
- num_auctions = 27
- 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
- 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
- return inflation, staked_fraction, inflation / staked_fraction
- print(inf_apy())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement