Hello everyone!
The purpose of this post is to share the design sketch for dApps Staking v3 we’ve been working on lately. We’d like to get YOUR (community’s) opinion, feedback & ideas!
Please keep in mind that the requirement for understanding this post is knowledge about current dApps staking design.
It’s a long post so strap in!
1. Overview
The main purpose of dApps staking is to incentivize developers & builders who choose Shiden or Astar network as their platform.
ASTR or SDN holders can choose to lock their tokens so they can vote (nominate) for a registered dApp of their choosing. Stakers are rewarded for their action by being rewarded a part of inflation.
The registered dApp will receive rewards, depending on the TVL of that dApp. E.g. if dApp A nomination consists of 10% of total dApps staking TVL, it will receive 10% of the inflation meant for dApp rewards.
2. Problems
Over the past year, many problems with dApps staking design have surfaced. Some of the community members voiced their concern and we’ve discussed them internally. Here is a short non-exhaustive summary of the problems (in no particular order):
- Registration & unregistration needs to be fully decentralized.
- Not all registered dApps are really dApps (infra providers, community projects) but are treated equally all the same.
- Lack of insight into dApps performance (metrics).
- Reward schema for dApps isn’t scalable (zero sum game).
- Theoretically, a single dApp could earn 100% of rewards intended for dApps staking.
- High entry threshold for new dApps if they want to receive tangible rewards (new dApp has to immediately compete with another dApp which might have billions in TVL).
- Low engagement from stakers, which results in stake & forget behavior. It’s enough to bond & stake once and to just keep claiming rewards.
- Unclaimed (stale) rewards are never burned.
3. Solution Sketch
Not all of the aforementioned problems can necessarily be fixed by tweaking or redesigning the dApps staking pallet (module). Decentralized registration requires governance integration, dApp performance metrics require off-chain logic with a UI (which is in works already).
The following solution sketch will focus on what should be changed in the core dApps staking protocol. We want to achieve:
- Scalable dApps rewards. We cannot accommodate an infinite amount of dApps in dApps staking since rewards are finite. But as the network grows in value, a positive feedback loop must allow increase of number of supported dApps.
- There is a limited amount of rewards that a single dApp can earn.
- A new dApp which just entered dApps staking protocol doesn’t need to immediately compete with the top dogs in order to earn tangible rewards. However, there competition is still present and encouraged.
- Stakers are encouraged to engage in dApps staking more often, instead of staking & forgeting.
- Active stakers are rewarded more than passive ones.
The following sub-chapters will explain proposed changes for v3.
3.1. Separate Locking & Staking
In dApps Staking v2, locking and nominating is joined together in a single action (bond_and_stake
). Same goes for removing nomination and unlocking funds (unbond_and_unstake
).
As part of v3, these actions will be separated.
- Locking funds will make them usable for staking
- Nominating funds will provide votes for the staked dApp
- If funds aren’t used to stake, they do not contribute to any dApp score
- Unlocking funds will begin the unlocking (
unbonding
) process - Same as today, after unbonding period finishes, owner can withdraw unlocked funds back to their free balance
- Nomination transfer functionality will most likely be kept although it might have some additional effect compared to today (depends on the final design)
3.2. dApp Tiers For Developer Rewards
In dApps Staking v2, dApp reward scaled linearly with the portion of dApps Staking TVL coming from that dApp. In v3, we will use tier-based reward distribution system.
Perhaps the easiest way to explain is by a simple example:
We have 3 tiers.
Altogether, they can support up to 23 dApps (3 + 5 + 15).
Only 13 dApps are part of dApps staking.
An era ends and tier sorting is started. After it finishes, 13 dApps will be sorted into 3 tiers.
1 dApp, A, has made it into the top tier 1. There are two vacant spots in this tier but none of the other dApps has fulfilled the requirements to join. This is a major shift from the current mentality where we always distribute the entire reward between active dApps.
In tier 2 we have 4 dApps and only one spot is vacant.
In tier 3 we have 8 dApps and 7 spots are left vacant.
3.2.1. Tier Configuration
The first parameter for tiers is how much of them we have.
- number of tiers
Each tier will have separate basic configuration parameters:
number of dApps
- number of dApps that can be part of this tier% of dApps Reward
- percentage of dApp reward going into this tier
Using these two parameters we can calculate how much each dApp in tier earns: %_of_dApp_reward / num_of_dApps
.
Small Example
- Inflation per block: 2.5 ASTR
- Inflation percentage going towards dApp rewards: 20%
- which means 0.5 ASTR goes towards dApp rewards
- Let’s assume we have multiple tiers and one of the tiers has basic config params:
- number of dApps = 20
- % of dApp rewards = 10%
- This means that for each dApp we allocate 0.5 * 0.1 / 20 = 0.0025 ASTR per block
- in today terms, era takes 7200 blocks, so dApps in this tier would earn 18 ASTR per era
(this is just an example and has no correlation to real numbers)
We can have an additional configuration parameter like:
minimum TVL
(or percentage) - minimum amount that has to be nominated for dApp in order to enter a tier. This means that we don’t need to reward highest tier rewards always!- Scenario: we have 20 spots in total for the highest earning tier but since we have an entry threshold, we could have 100 dApps in dApps Staking with only 5 of them being part of the top tier.
- This is a shift from the mentality that we need to distribute ALL the inflation intended for dApps reward. We don’t need to do that.
There were various ideas on how to sort dApps into tiers. To provide greater flexibility, the best approach is to have this logic outside of dApps Staking core protocol. This would allow us to design different tier sorting functions for different runtimes, if needed.
This would make tier sorting
functionality one of the core tier configuration parameters.
The most basic example would be sorting by TVL and taking into account minimum TVL parameter.
We might want to whitelist a dApp for a certain tier Or in another words, to force put it into a tier. This might be an interesting way to accomplish project bootstrapping. We utilize the core dApps staking mechanism to provide funds to a project for some time.
We could have this as a forced tier
configuration parameter.
E.g. a projects gets forced into 3rd tier for 3 months. After that period, the forced tier parameter gets removed, and they are sorted into tiers based on whichever functionality is used for that runtime (e.g. by TVL).
Although whitelist term is used, it can also work in opposite direction via blacklisting dApps. We could outright ban projects from dApps staking or limit them to some tiers. E.g. a specific type of project could be limited to allow it to enter tier 2 at most.
3.2.2. Eras & Tier Calculation
In general, calculating staker’s reward will be computationally easier than calculating developer rewards. Tier sorting can be time consuming operation since it might depend on many different parameters (see previous chapter). For that end, calculating developer rewards more rarely (weekly or monthly) might be better.
In production, this would mean that stakers could still claim on a daily basis, as they do today. For developers, they would claim less often. When developer era finishes, number crunching would start and provide back the tier information to the dApps staking pallet.
IMPORTANT: This doesn’t mean developers would earn less rewards, it only means they would be able to claim them less often. Each claim would be much heftier than before though. If we assume that developer era lasts for 7 days, it would mean that it accumulates rewards for 50400 instead of 7200* as today.
3.2.3. Keeping Track of (Un)Claimed Rewards
We might want to keep a better track of the amount of rewards that were claimed versus what was rewarded versus what was assigned for rewards.
A fixed amount of inflation goes towards dApps rewards but by utilizing tier logic, it is highly unlikely that we’ll distribute all of the rewards.
We’ve also had developers (and stakers) who haven’t claimed their rewards for a very long time.
Being able to easily keep track of these values would allow us to handle unclaimed/unused rewards on-chain. We could burn them to reduce inflation or utilize them in some other way.
3.3. Voting Period and Build&Earn Period
In dApps Staking v2, users staking (nominating) a dApp in era X directly contributes to that dApps TVL for that era. There are no special periods designated for voting.
Stakers could also stake & forget, keeping potentially high nomination on a project they don’t even really support. They could loose their private key, and nomination would remain there forever.
This will be addressed in v3.
3.3.1. Two Periods
Two distinct periods will be introduced:
Voting Period
Build&Earn Period
These two periods would cycle on a regular basis. For example, a week long voting period would be followed by 11 week long build&earn period. Then the cycle would repeat.
During (and before) the voting
period, projects can run marketing campaigns to attract stakers. All the stakes made during the voting
period are counted separately from nominations in build & earn
period. This will be explained in more details later. But for now, please note that voting period
is just a name - the voting here is simply staking (or nominating), so same as it is today.
We should foster building a culture around voting period, like projects committing on what they will deliver in following build&earn period. This could be in line with their roadmap or milestones. If voting + build&earn period would last together for e.g. 3 months (configurable), it would allow our marketing & projects to build activities around it.
Voting during the voting
period ONLY nominates the dApp for the next build&earn
period. It doesn’t mean dApp is nominated indefinitely.
While voting
period is active, no rewards would be earned or distributed. Instead, they would just be accumulated (read on for further explanation).
During build & earn
period, projects focus on building. They can earn rewards based on their tier.
If user decides to nominate additional funds, or claims with automatic re-stake, these additions would not be counted in same way towards dApp score as they would have during the voting
period. They would be kept track of separately. This is useful since we can construct modified TVL metrics which could provide dApp score with a formula like:
score = nomination_from_voting_period + 0.5 * nomination_from_build/earn_period
This approach gives voting period
bigger weight but still makes voting in build & earn period
relevant. IMPORTANT: This is only related for tier sorting it’s not related to stakers stake If someone locks & stakes 100 ASTR during build&earn period, it will be counted as if 100 ASTR was staked from their perspective.
3.3.2. Voting Period Reward Accumulation
During the voting
period, it is not possible to earn rewards, neither for stakers or dApps. Instead, rewards are accumulated into a loyalty reward fund.
For all stakers who vote during the voting
period and don’t unstake any funds during the entire follow-up build&earn
period, they can claim the rewards accumulated during the voting
period.
This aims to reward voting
period participants (active stakers), who remained staked for the entirety of the build&earn
period.
This is the monetary incentive for dApps staking participation in voting
period.
Example Of Reward Accumulation
Before explaining this, let’s just quickly go over how inflation and dApps staking works today.
Producing each block results in minting of new tokens. These new tokens are distributed between collators, treasury and dApps staking.
The dApps Staking part of the inflation is split between stakers & dApps. As blocks are produced, both staker and dApp rewards are accumulated. Once enough blocks have passed (we call this an era), snapshot is taken and both stakers and dApp devs can claim the accumulated rewards.
Let’s say for the sake of example that voting period
lasts 3 blocks and build&earn period
lasts 4 blocks. Reward accumulation would look like the following image:
As blocks are produced during voting period, all rewards are accumulated into the extra reward accumulator
. During build&earn period
, rewards are normally distributed between dApps and stakers (same as today).
Continuing the example, let’s assume the following:
- We only have a single dApp on which stakers can stake
- We assume that
build & earn period
lasts for 1 era which is 4 blocks - dApp Reward Inflation per block is 1 ASTR
- staker Reward Inflation per block is 2 ASTR
- Alice, Bob and Charlie stake during the
voting period
- Bob and Charlie remain staked during the entire
build&earn period
- Alice decides to reduce her stake during the
build&earn
period
Block 1
-
Alice stakes 10 ASTR, Bob stakes 20 ASTR, Charlie stakes 40 ASTR
-
Both rewards get deposited into
Extra Rewards
accumulatorAlice Bob Charlie Locked 10 ASTR 20 ASTR 40 ASTR Staked 10 ASTR 20 ASTR 40 ASTR Extra Rewards dApp Rewards Staker Rewards Accumulated 3 ASTR 0 ASTR 0 ASTR
Block 2 & Block 3
-
Since it’s
voting period
, rewards are accumulated intoExtra Rewards
Alice Bob Charlie Locked 10 ASTR 20 ASTR 40 ASTR Staked 10 ASTR 20 ASTR 40 ASTR Extra Rewards dApp Rewards Staker Rewards Accumulated 9 ASTR 0 ASTR 0 ASTR
Block 4
-
Build & earn period
begins, rewards are deposited in their respective accumulatorsAlice Bob Charlie Locked 10 ASTR 20 ASTR 40 ASTR Staked 10 ASTR 20 ASTR 40 ASTR Extra Rewards dApp Rewards Staker Rewards Accumulated 9 ASTR 1 ASTR 2 ASTR
Block 5
-
Alice decides to reduce her stake (nomination) by 7 ASTR, bringing it down to just 3 ASTR
-
This no longer makes Alice eligible for extra rewards but since she only unstaked, without unlocking, she’s still eligible for standard staker rewards
Alice Bob Charlie Locked 10 ASTR 20 ASTR 40 ASTR Staked 3 ASTR 20 ASTR 40 ASTR Extra Rewards dApp Rewards Staker Rewards Accumulated 9 ASTR 2 ASTR 4 ASTR
Block 6 & Block 7
-
Rewards are being accumulated
Alice Bob Charlie Locked 10 ASTR 20 ASTR 40 ASTR Staked 3 ASTR 20 ASTR 40 ASTR Extra Rewards dApp Rewards Staker Rewards Accumulated 9 ASTR 4 ASTR 8 ASTR
Block 8
-
This marks the beginning of the new
voting period
, which means we can payout rewards for the previous period -
First we consider standard rewards paid for just locking
- TVL is 10 + 20 + 40 = 70 ASTR
- Staker reward accumulator contains 8 ASTR
- Alice will get 10 / 70 * 8 = 1.14 ASTR
-
Then we can consider extra rewards paid for staking (voting) during
voting period
and remaining staked throughout the entirebuild & earn period
-
Loyalty TVL is calculated by summing up only Bob and Charlie’s stake which is 20 + 40 = 60 ASTR
-
Bob earns 20 / 60 * 9 = 3 ASTR
Alice Bob Charlie Sum Standard Reward 1.14 ASTR 2.29 ASTR 4.57 ASTR 8 ASTR Extra Reward 0 ASTR 3 ASTR 6 ASTR 9 ASTR Total Reward 1.14 ASTR 5.29 ASTR 13.57 ASTR 17 ASTR
-
Please also check Kahori’s post below.
Nominations During Voting Events Example
Alice and Bob have decided to participate in dApps staking which only has two dApps registered: A and B.
New voting period has started (VP1)
- Alice nominates dApp A with 80 ASTR and dApp B with 20 ASTR
dApp A dApp B voting period nomination 80 ASTR 20 ASTR build&earn nomination 0 0 - Alice nominates dApp B with an additional 10 ASTR
dApp A dApp B voting period nomination 80 ASTR 30 ASTR build&earn nomination 0 0
Voting period (VP1) has ended, build&earn period has started (BEP1)
- Bob nominates dApp B with 90 ASTR
dApp A dApp B voting period nomination 80 ASTR 30 ASTR build&earn nomination 0 90 ASTR - Alice claims some of the rewards (1 ASTR), automatically re-staking them on dApp A
dApp A dApp B voting period nomination 80 ASTR 30 ASTR build&earn nomination 1 ASTR 90 ASTR
Build&earn period (BPE1) has ended, new voting period has begun (VP2)
- Nomination (votes) do not carry over, both dApps start with zero
dApp A dApp B voting period nomination 0 ASTR 0 ASTR build&earn nomination 0 ASTR 0 ASTR - Same as in VP1, stakers can nominate dApps again
NOTE: tier sorting can utilize the above information, but is not core part of the voting events.
NOTE 2: please refer to the new inflation model forum post for more concrete numbers for staker rewards, dApp rewards, and tiers.