Add Dynamic Inflation
constants/constant_values.go:
- Added
InflationPercentageThreshold
for setting the threshold in which the dynamic inflation should not mint. - Added
InflationPoolPercentage
for setting the percentage that the pool should receive from the minted cacao.
constants/constants_v1.go:
- Added
InflationPercentageThreshold = 90
for setting the threshold in which the dynamic inflation should not mint. - Added
InflationPoolPercentage = 50
for setting the percentage that the pool should receive from the minted cacao.
x/thorchain/keeper/keeper.go:
- Added
DynamicInflation
function prototype.
x/thorchain/keeper/keeper_dummy.go:
- Added
DynamicInflation
function prototype to dummy keeper.
x/thorchain/keeper/v1/keeper_network_fee.go:
- Added function
GetCACAOOnPools
in which it gets all the pools and sum the cacao on theirBalanceRune
. - Added function
DynamicInflation
in which calculate ay = cacaoOnPools / cacaoOnChain
and then used formulainflation = ((1-y)*40)+1
, which represent a percentage to mint based on the cacaoOnChain. If the relationy >= 90%
it should not mint anything. For more information see: https://docs.google.com/document/d/126pnKeC7N9wy-bluy9kJUfVt4jUjiDvW5KY7TWIZ9P4/edit - Added function
distributeDynamicInflation
in which it distribute the minted cacao to:
- 50% to pools
- 50% to SystemIncome -> [90% Reserve, 10% MayaFund]
x/thorchain/keeper/v1/keeper_network_fee_test.go:
- Added unit test for
DynamicInflation
,GetCACAOOnPools
anddistributeDynamicInflation
x/thorchain/keeper/v1/keeper_test.go:
- Added setup test for inflation
x/thorchain/manager_gas_current.go:
- Added the called for function
DynamicInflation
on EndBlock
FEATURE DESCRIPTION:
Edited by Bitol Maya