Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hybrid inflation model to Astar #1103

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Added hybrid inflation model to Astar #1103

merged 2 commits into from
Dec 14, 2023

Conversation

PierreOssun
Copy link
Member

@PierreOssun PierreOssun commented Dec 12, 2023

Pull Request Summary

Adds Tokenomics 2.0 Phase 2: Hybrid inflation model to Astar.

Three requirements should be met:

  • collators should get 3.2% of yearly inflation
  • treasury should get 5% of yearly inflation
  • stakers and dApps gets the same amount (in absolute value)

The (today) total issuance of ASTR is 8304517045391557672991818108 so 7% is 581316193177409037109427267 ASTR inflation per year. yearly inflation = 581316193177409037109427267

Reward per block is:

Collators: inflation * 0.032 / (7200 * 365) / 10^18 = 7.078431 ASTR/Block calc

Treasury: inflation * 0.05 / (7200 * 365) / 10^18 = 11.060049 ASTR/Block calc

dApps and stakers get the same as today (based on current block reward of 253.08):
dAppRewards = 15.78% * 253.08 = 39.936024 ASTR
baseStakerPercent = 21.05% * 253.08 = 53.27334 ASTR
adjustablePercent = 47.36% * 253.08 = 119.858688 ASTR

so total (max) reward per block (sum of all): 231.206532 ASTR

And we use the blockReward distribution to ensure the three requirements: (and calculate them from the reward per block)

{
  // 11.060049 / 231.206532 = 0.04783623
  treasuryPercent: 4.78%
  // 53.27334 / 231.206532 = 0.23041451
  baseStakerPercent: 23.04%
  // 39.936024 / 231.206532 = 0.17272878
  dappsPercent: 17.27%
  // 7.078431 /  231.206532 = 0.03061518
  collatorsPercent: 3.06%
  // 119.858688 / 231.206532 = 0.51840528
  adjustablePercent: 51.84%
  idealDappsStakingTvl: 60.00%
}

Check list

  • Removed old pallet-rewards
  • Removed Shiden migration + Added Astar migration
  • Integrate new pallet + updated block rewards

@PierreOssun PierreOssun added astar Related to Astar runtime This PR/Issue is related to the topic “runtime”. labels Dec 12, 2023
Copy link

Code Coverage

Package Line Rate Branch Rate Health
pallets/dynamic-evm-base-fee/src 81% 0%
pallets/collator-selection/src 69% 0%
precompiles/sr25519/src 79% 0%
chain-extensions/xvm/src 0% 0%
precompiles/assets-erc20/src 77% 0%
precompiles/utils/macro/src 0% 0%
precompiles/substrate-ecdsa/src 78% 0%
precompiles/xcm/src 75% 0%
chain-extensions/types/dapps-staking/src 0% 0%
precompiles/utils/src/testing 38% 0%
pallets/xc-asset-config/src 53% 0%
chain-extensions/types/assets/src 0% 0%
pallets/dapps-staking/src 81% 0%
pallets/unified-accounts/src 84% 0%
pallets/xvm/src 40% 0%
precompiles/utils/src 55% 0%
chain-extensions/dapps-staking/src 0% 0%
chain-extensions/pallet-assets/src 0% 0%
chain-extensions/types/xvm/src 0% 0%
precompiles/unified-accounts/src 100% 0%
pallets/block-rewards-hybrid/src 87% 0%
pallets/dapps-staking/src/pallet 85% 0%
primitives/src/xcm 66% 0%
chain-extensions/unified-accounts/src 0% 0%
primitives/src 65% 0%
precompiles/dapps-staking/src 93% 0%
chain-extensions/types/unified-accounts/src 0% 0%
pallets/contracts-migration/src 0% 0%
pallets/ethereum-checked/src 48% 0%
precompiles/xvm/src 75% 0%
Summary 57% (2251 / 3979) 0% (0 / 0)

Minimum allowed line rate is 50%

Copy link
Member

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Numbers look good!

Copy link
Member

@ashutoshvarma ashutoshvarma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I didn't check the calculations though

Copy link
Member

@shaunxw shaunxw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the numbers and they look good to me. Just one small question.

runtime/astar/src/lib.rs Show resolved Hide resolved
@PierreOssun PierreOssun merged commit 2220838 into master Dec 14, 2023
9 of 11 checks passed
@PierreOssun PierreOssun deleted the feat/him-astar branch December 14, 2023 08:17
@PierreOssun PierreOssun mentioned this pull request Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astar Related to Astar runtime This PR/Issue is related to the topic “runtime”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants