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

Feat/dyn tier thresholds #699

Merged
merged 6 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions docs/learn/dapp-staking/dapp-staking-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ Since number of slots is dynamic, so has to be the threshold to allow for more r
It's not fair to define the same threshold for entering a tier if there are 50 slots or 500 slots since the
staked amount will be more diluted between various dApps.

The formula for adjusting tier entry threshold:
The formula for adjusting tier entry threshold with dApps slot changes:

$\Delta\%_{threshold} = (\frac{100\%}{100\% + \Delta\%_{dApps}} - 1) * 100\%$

Expand All @@ -282,16 +282,20 @@ The comparison is always done between the _baseline_ number of slots and the new

$new\_threshold = base\_threshold * (1 + \Delta\%_{threshold})$

At the moment, there are two types of tier entry thresholds:
There are now two types of tier entry thresholds:

* `Dynamic` - adjusts the threshold based on the aforementioned formula.
* `Fixed` - defines a static, fixed threshold which doesn't adapt.
* `Dynamic` - A percentage of the total issuance as staked funds that can change between periods. It includes a minimum percentage that the threshold cannot fall below. This type is used for _higher_ tiers.
* `Fixed` - A constant percentage of the total issuance as staked funds, which does not change between periods. Used for the _lowest_ tier, and defines a static value.

The `Dynamic` threshold is used for _higher_ tiers, and also defines the minimum amount to which the threshold can fall.
E.g. a threshold might define _current_ value as **1,000,000 ASTR**. Since this can be decreased if number of slots goes up,
it also defines a minimum amount the threshold can take, e.g. **500,000 ASTR**.
These percentages are calculated based on a total issuance of **8.4 billion ASTR** tokens when dApp Staking V3 was launched. As the total issuance changes (e.g. burn events), the dynamic thresholds will adjust accordingly, ensuring a fair and adaptive staking environment. However, the fixed threshold for the *lowest* tier remains constant.
ipapandinas marked this conversation as resolved.
Show resolved Hide resolved

The `Fixed` threshold is used for the _lowest tier_, and defines a static value.
For example, suppose the total issuance is **8.4 billion** ASTR tokens. For **Tier 1**, the dynamic threshold percentage is set at **3.57%** (*approximately 299,880,000 ASTR*), with a minimum required percentage of **2.38%** (*approximately 199,920,000 ASTR*). If the total issuance decreases due to a burn event, the threshold adjusts accordingly. For example, if the total issuance drops to **8.0 billion** ASTR, the **Tier 1** threshold adjusts to:

$new\_threshold = 3.57\% * 8.0 billion = 285,600,000\ ASTR$

If the number of slots changes, the threshold is further adjusted based on the delta percentage formula.

*Refer to the [dApp staking parameters](/docs/learn/dapp-staking/protocol-parameters#network-values) page to find out more about the percentage values for each network.*

#### Tier Rewards

Expand Down
46 changes: 23 additions & 23 deletions docs/learn/dapp-staking/protocol-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ E.g. `[5%, 15%, 20%, 60%]` means that `5%` of the total slots are assigned for *

### Tier Thresholds

The threshold that dApp has to satisfy, essentially the total staked amount, in order to be eligible to enter a tier.
There are two types of thresholds:
The threshold a dApp must meet, based on a percentage of the total issuance staked, to enter a tier.
There are two types of threshold percentages:

* `Fixed` - threshold has a fixed value and doesn't change
* `Dynamic` - threshold has an initial value, which changes dynamically as the number of slots change, but also has a minimum allowed value.
* `Fixed` - A fixed percentage of the total issuance as staked funds, constant and unchanging between periods.
* `Dynamic` - A percentage of the total issuance as staked funds that can change between periods, with a minimum percentage *minimum_required_percentage* that cannot be reduced below.
ipapandinas marked this conversation as resolved.
Show resolved Hide resolved

### Price Aggregation Duration

Expand All @@ -81,22 +81,22 @@ Length of the circular buffer used to implement the _moving-average_ solution.

## Network Values

| Parameter name | Astar | Shiden | Shibuya |
| ------------------------------ | --------------------- | --------------------- | -------------------- |
| Era Reward Span Length | 16 | 16 | 16 |
| Reward Retention In Periods | 4 | 3 | 2 |
| Max Number Of Contracts | 500 | 500 | 500 |
| Max Unlocking Chunks | 8 | 8 | 8 |
| Minimum Locked Amount | 500 ASTR | 50 SDN | 5 SBY |
| Unlocking Period | 9 | 4 | 4 |
| Max Number Of Staked Contracts | 16 | 16 | 8 |
| Minimum Stake Amount | 500 ASTR | 50 SDN | 5 SBY |
| Number Of Tiers | 4 | 4 | 4 |
| Reward Distribution | [25%, 47%, 25%, 3%] | [25%, 47%, 25%, 3%] | [40%, 30%, 20%, 10%] |
| Slot Portions | [5%, 20%, 30%, 45%] | [5%, 20%, 30%, 45%] | [10%, 20%, 30%, 40%] |
| Tier 1 Threshold | Dynamic(300M/200M ASTR) | Dynamic(3M/2M SDN) | Dynamic(3000/2500 SBY) |
| Tier 2 Threshold | Dynamic(75M/50M ASTR) | Dynamic(750k/500k SDN)| Dynamic(2000/1500 SBY) |
| Tier 3 Threshold | Dynamic(20M/15M ASTR) | Dynamic(200k/150k SDN)| Dynamic(800/500 SBY) |
| Tier 4 Threshold | Fixed(1.5M ASTR) | Fixed(50k SDN) | Fixed(200 SBY) |
| Price Aggregation Duration | 7200 blocks | 7200 blocks | 7200 blocks |
| Circular Buffer Length | 7 | 7 | 7 |
| Parameter name | Astar | Shiden | Shibuya |
| ----------------------------------- | ---------------------- | ---------------------- | -------------------------- |
| Era Reward Span Length | 16 | 16 | 16 |
| Reward Retention In Periods | 4 | 3 | 2 |
| Max Number Of Contracts | 500 | 500 | 500 |
| Max Unlocking Chunks | 8 | 8 | 8 |
| Minimum Locked Amount | 500 ASTR | 50 SDN | 5 SBY |
| Unlocking Period | 9 | 4 | 4 |
| Max Number Of Staked Contracts | 16 | 16 | 8 |
| Minimum Stake Amount | 500 ASTR | 50 SDN | 5 SBY |
| Number Of Tiers | 4 | 4 | 4 |
| Reward Distribution | [25%, 47%, 25%, 3%] | [25%, 47%, 25%, 3%] | [40%, 30%, 20%, 10%] |
| Slot Portions | [5%, 20%, 30%, 45%] | [5%, 20%, 30%, 45%] | [10%, 20%, 30%, 40%] |
| Tier 1 Threshold (total issuance %) | Dynamic(3.57%/2.38%) | Dynamic(3.57%/2.38%) | Dynamic(0.0020%/0.0017%) |
| Tier 2 Threshold (total issuance %) | Dynamic(0.89%/0.6%) | Dynamic(0.89%/0.6%) | Dynamic(0.0013%/0.0010%) |
| Tier 3 Threshold (total issuance %) | Dynamic(0.238%/0.179%) | Dynamic(0.238%/0.179%) | Dynamic(0.00054%/0.00034%) |
| Tier 4 Threshold (total issuance %) | Fixed(0.02%) | Fixed(0.06%) | Fixed(0.00014%) |
| Price Aggregation Duration | 7200 blocks | 7200 blocks | 7200 blocks |
| Circular Buffer Length | 7 | 7 | 7 |
Loading