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

Polkadot: Constant yearly emission #471

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Polkadot: Constant yearly emission #471

wants to merge 9 commits into from

Conversation

ggwpez
Copy link
Member

@ggwpez ggwpez commented Oct 7, 2024

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).

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
Contributor

cc @gpestana

@ggwpez ggwpez marked this pull request as ready for review October 7, 2024 19:05

log::debug!(target: LOG_TARGET, "params: {:?}", params);
relay_common::relay_era_payout(params)
Copy link
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
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 🙈

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
Copy link
Contributor

@ordian ordian left a comment

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
Copy link

jonasW3F commented Oct 9, 2024

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.

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
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
Contributor

@gilescope gilescope left a comment

Choose a reason for hiding this comment

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

LGTM

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