Skip to content

Polkadot: Constant yearly emission - #471

Merged
fellowship-merge-bot[bot] merged 9 commits into
mainfrom
oty-inflation
Oct 17, 2024
Merged

Polkadot: Constant yearly emission#471
fellowship-merge-bot[bot] merged 9 commits into
mainfrom
oty-inflation

Conversation

@ggwpez

@ggwpez ggwpez commented Oct 7, 2024

Copy link
Copy Markdown
Member

Sets the inflation to ~120M DOT per year as specified in Ref 1139. 15% of that goes to the treasury and the rest to stakers.

Details

This MR sets the Polkadot inflation to a fixed amount per year. The yearly increase is ~120,063,259 DOT. The amount was set to 8% of the Total Issuance at block 22810263 in which referendum 1139 was executed. You can check this for yourself:

Screenshot 2024-10-08 at 16 51 07

Multiplying this by 8% and converting to DOT is about 120,093,259 DOT per year.
This results in an emissions of 120,093,259 / 365.25 about 328,797 DOT per day.

The Total Issuance and yearly inflation look like this over the next 25 years:
inflation

Concrete numbers

Initial 1.501 BDOT
Year 1: 1.621 BDOT +7.407%
Year 2: 1.741 BDOT +6.897%
Year 3: 1.861 BDOT +6.452%
Year 4: 1.982 BDOT +6.061%
Year 5: 2.102 BDOT +5.714%
Year 6: 2.222 BDOT +5.405%
Year 7: 2.342 BDOT +5.128%
Year 8: 2.462 BDOT +4.878%
Year 9: 2.582 BDOT +4.651%
Year 10: 2.702 BDOT +4.444%
Year 11: 2.822 BDOT +4.255%
Year 12: 2.942 BDOT +4.082%
Year 13: 3.062 BDOT +3.922%
Year 14: 3.182 BDOT +3.774%
Year 15: 3.303 BDOT +3.636%
Year 16: 3.423 BDOT +3.509%
Year 17: 3.543 BDOT +3.390%
Year 18: 3.663 BDOT +3.279%
Year 19: 3.783 BDOT +3.175%
Year 20: 3.903 BDOT +3.077%
Year 21: 4.023 BDOT +2.985%
Year 22: 4.143 BDOT +2.899%
Year 23: 4.263 BDOT +2.817%
Year 24: 4.383 BDOT +2.740%
Year 25: 4.503 BDOT +2.667%

Implications

15% of the inflation goes to the treasury which results in a yearly treasury inflow of ~18M DOT (1.5M DOT per month).
Stakers will receive ~102M DOT per year (~8.5M DOT per month).

ggwpez added 3 commits October 7, 2024 15:59
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@kianenigma

Copy link
Copy Markdown
Contributor

cc @gpestana

@ggwpez
ggwpez marked this pull request as ready for review October 7, 2024 19:05
Comment thread relay/polkadot/src/lib.rs
FixedU128::from_rational(era_duration_millis.into(), MILLISECONDS_PER_YEAR.into());

log::debug!(target: LOG_TARGET, "params: {:?}", params);
relay_common::relay_era_payout(params)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can probably now remove some unused code from both relay_common and polkadot-sdk related to the old inflation formula.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we are still using it in Kusama and the other relay runtimes, but yea we can remove the dynamic parameter stuff again 🙈

ggwpez added 5 commits October 8, 2024 14:06
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez changed the title Polkadot: Fixed Inflation Polkadot: Fix inflationary emission Oct 8, 2024
@ggwpez ggwpez changed the title Polkadot: Fix inflationary emission Polkadot: Constant inflationary emission Oct 8, 2024
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez changed the title Polkadot: Constant inflationary emission Polkadot: Constant yearly emission Oct 8, 2024

@ordian ordian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code seems to match the intention of the Wish for Change proposal 1139, which was approved by the community.

@jonasW3F

jonasW3F commented Oct 9, 2024

Copy link
Copy Markdown

Looks good to me. The exact timing of the snapshot of the total_issuance was never explicitly discussed. This update sets it to the time of execution of the WFC with the obvious benefit that it is in the past (and therefore we can hardcode it).

Would it be possible to include something that queries the total_issuance of the time this runtime update would execute? That might be more complex and therefore not worthwhile. But maybe there is an easy way to do it, then using the total_issuance at the time of execution of the root referendum is slightly preferred.

Taking the number at the execution of the WFC is still sensible.

Comment thread relay/polkadot/src/lib.rs
FixedU128::from_rational(era_duration_millis.into(), MILLISECONDS_PER_YEAR.into());

// TI at the time of execution of [Referendum 1139](https://polkadot.subsquare.io/referenda/1139), block hash: `0x39422610299a75ef69860417f4d0e1d94e77699f45005645ffc5e8e619950f9f`.
let fixed_total_issuance: i128 = 15_011_657_390_566_252_333;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code looks good here. i might take the preference to just keep this a round 15x10^18, so that numbers look clean and obvious.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yea I thought about it, but did not want to make any deliberate alterations to the proposal... It is quite fortunate that it works out to 120M by accident already i think.

@gilescope gilescope left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

github-merge-queue Bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Oct 14, 2024
Testing the approach of this before it goes live on Polkadot
polkadot-fellows/runtimes#471

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Dónal Murray <donal.murray@parity.io>
@ggwpez

ggwpez commented Oct 17, 2024

Copy link
Copy Markdown
Member Author

bot merge

@ggwpez

ggwpez commented Oct 17, 2024

Copy link
Copy Markdown
Member Author

/merge

@fellowship-merge-bot
fellowship-merge-bot Bot merged commit e8e59d6 into main Oct 17, 2024
@fellowship-merge-bot

Copy link
Copy Markdown
Contributor

Enabled auto-merge in Pull Request

Available commands
  • /merge: Enables auto-merge for Pull Request
  • /merge cancel: Cancels auto-merge for Pull Request
  • /merge help: Shows this menu

For more information see the documentation

@ggwpez
ggwpez deleted the oty-inflation branch October 17, 2024 15:09
@ggwpez ggwpez mentioned this pull request Oct 17, 2024
fellowship-merge-bot Bot pushed a commit that referenced this pull request Nov 1, 2024
Release for the updated inflation formula from
#471

This release only affects the Polkadot runtime.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Dónal Murray <donalm@seadanda.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants