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

dApp Staking - Improved Tier Threshold Derivation #1295

Closed
Dinonard opened this issue Jul 11, 2024 · 0 comments · Fixed by #1306
Closed

dApp Staking - Improved Tier Threshold Derivation #1295

Dinonard opened this issue Jul 11, 2024 · 0 comments · Fixed by #1306
Assignees
Labels
project Issue is part of an ongoing project

Comments

@Dinonard
Copy link
Member

Overview

Currently, tier thresholds are hardcoded and don't depend on the total issuance of the native token.
This isn't the best since total issuance will increase over time - or rapidly decrease as it has recently.
Given the logic behind dynamic thresholds, it's only fair to adjust thresholds to the changing total issuance.

E.g. if total issuance was to be cut in half, thresholds should also be cut in half since tokens are used to stake,
and if there are half tokens compared to before, lots of dApps would loose on tier positions.

Solution Suggestion

This will require a simple storage migration.
New thresholds should only be applied for the future tier assignment, not retroactively for the old assignments.

  1. pub enum TierThreshold should be updated to use total issuance percentages instead of hardcoded values
  • sanity checks per runtime should ensure these values are within the expected range
  1. TiersConfiguration should be updated to no longer use TierThreshold enum but should store numeric threshold directly as a number
  • also, number_of_slots can be removed from the struct as it is redundant

Choosing Init Percentages

Compare hardcoded thresholds to the total issuance at the time when dApp staking v3 is launched and calculate the percentage (or perbill) to achieve as close number to that as possible.
This requirement can be slightly relaxed if we can end up with a easier to read perbill number.
E.g. if total issuance was 8.4B ASTR and lower threshold for tier 1 was set to 200M ASTR, dividing those numbers gives
0.023809523809524% which can also be represented as 0.0238 for the sake of readability.

@Dinonard Dinonard added the project Issue is part of an ongoing project label Jul 11, 2024
@ipapandinas ipapandinas self-assigned this Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project Issue is part of an ongoing project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants