Skip to content

Commit

Permalink
update inflation
Browse files Browse the repository at this point in the history
  • Loading branch information
AkakaKong committed Feb 17, 2020
1 parent ef3ae09 commit 94fc84f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ async function main() {

let stakingRatio = totalBond / totalIssuance;
let inflation = 0.1;
let inflationForValidators;
if (stakingRatio <= 0.5) {
inflationForValidators = 0.025 + stakingRatio * (0.2 - 0.025 / 0.5);
} else {
inflationForValidators = 0.025 + (0.1 - 0.025) * (2 ** ((0.5 - stakingRatio) / 0.05));
}
let lastRewardPercent = await DB.getLastRewardEventPercent();
let inflationKsm = totalIssuance * inflation;
let inflationKsmToValidators = lastRewardPercent ? lastRewardPercent * inflationKsm : inflationKsm;
Expand All @@ -85,7 +91,7 @@ async function main() {
totalBond: totalBond.toString(),
validatorsCount: validatorsCount,
stakingRatio: stakingRatio,
inflation: inflation,
inflation: inflationForValidators,
rewardPerValPerDay: rewardPerValPerDay,
});
};
Expand Down

0 comments on commit 94fc84f

Please sign in to comment.