This proposal introduces a new way to calculate the delegators share of rewards to have more intuitive, stable commission rates.
New delegations and undelegations dramatically change the staking income for indexers and validators unless the cut rate is regularly adjusted. This happens because the staking income for the indexer and delegators is pooled before the indexer cut is calculated.
In a scenario with constant rewards yield for each token deposited, the delegation yield goes down anytime new delegators contribute tokens to an indexer. An indexer would need to adjust their cut if it were to keep the delegation yield constant. This mechanism leads to several issues: it makes it hard for delegators to choose an indexer; indexers change the rewards cut very frequently, the cooldown period becomes ineffective, etc.
This GIP is inspired by https://forum.thegraph.com/t/proposal-to-change-the-indexer-cut-mechanism/1422
Update the rewards distribution formula to consider the delegation to the total-stake ratio when an indexer creates the allocation. In addition, the implementation repurposes the indexer cut parameter as the share of delegator rewards the indexer gets.
Example Scenario
"Indexer sets query fee cut to 25%"
"Indexer sets reward cut to 10%"
All the proposed changes are constrained to the Staking contract.
\[ indexerDelegationRatio={\frac{delegatedTokens}{indexerStake + delegatedTokens}} \]
\[ delegatorRewardsCut = (1 - indexerRewardsCut) * indexerDelegationRatio \]
Calculate theindexerDelegationRatio
as the ratio of delegation to total stake for a particular indexer and use that in the rewards distribution function. This leads to a fairer distribution based on the tokens contributed by each one and avoids an edge case where a delegator with just a few delegated tokens could keep all the delegation portion of rewards.
Store the calculated delegators rewards cut at the moment when the allocation is created. This avoids any manipulation of the reward cut before closing an allocation. To enable this, two new attributes will be added to the Allocation struct.
Make the distribution function to first split rewards based on the indexer delegation ratio and then take the indexer cut from the delegators rewards. Creates a more stable rate that reduces the amount of updates to the delegation parameters.
Rename delegation pool variables to make them clearer.
Use a single internal function to collect any delegators rewards _collectDelegationRewards()
to reduce bytecode.
Based on an index rewards cut of 10% and a rewards yield of 10%
Indexer | Delegator | Del. Ratio | New Rewards | Eff. Index Cut | Indexer | Indexer Yield | Delegator | Delegator Yield |
---|---|---|---|---|---|---|---|---|
100 | 200 | 66.67% | 30 | 10% | $3.00 | 3.00% | $27.00 | 13.50% |
100 | 300 | 75.00% | 40 | 10% | $4.00 | 4.00% | $36.00 | 12.00% |
100 | 400 | 80.00% | 50 | 10% | $5.00 | 5.00% | $45.00 | 11.25% |
100 | 500 | 83.33% | 60 | 10% | $6.00 | 6.00% | $54.00 | 10.80% |
100 | 600 | 85.71% | 70 | 10% | $7.00 | 7.00% | $63.00 | 10.50% |
100 | 700 | 87.50% | 80 | 10% | $8.00 | 8.00% | $72.00 | 10.29% |
100 | 800 | 88.89% | 90 | 10% | $9.00 | 9.00% | $81.00 | 10.13% |
100 | 900 | 90.00% | 100 | 10% | $10.00 | 10.00% | $90.00 | 10.00% |
100 | 1000 | 90.91% | 110 | 10% | $11.00 | 11.00% | $99.00 | 9.90% |
Based on an index rewards cut of 10% and a rewards yield of 10%
Indexer | Delegator | Del. Ratio | New Rewards | Eff. Index Cut | Indexer | Indexer Yield | Delegator | Delegator Yield |
---|---|---|---|---|---|---|---|---|
100 | 200 | 66.67% | 30 | 40% | $12.00 | 12.00% | $18.00 | 9.00% |
100 | 300 | 75.00% | 40 | 33% | $13.00 | 13.00% | $27.00 | 9.00% |
100 | 400 | 80.00% | 50 | 28% | $14.00 | 14.00% | $36.00 | 9.00% |
100 | 500 | 83.33% | 60 | 25% | $15.00 | 15.00% | $45.00 | 9.00% |
100 | 600 | 85.71% | 70 | 23% | $16.00 | 16.00% | $54.00 | 9.00% |
100 | 700 | 87.50% | 80 | 21% | $17.00 | 17.00% | $63.00 | 9.00% |
100 | 800 | 88.89% | 90 | 20% | $18.00 | 18.00% | $72.00 | 9.00% |
100 | 900 | 90.00% | 100 | 19% | $19.00 | 19.00% | $81.00 | 9.00% |
100 | 1000 | 90.91% | 110 | 18% | $20.00 | 20.00% | $90.00 | 9.00% |
This changes require new attributes in the Allocation struct that won't exist on older allocations. Logic must be introduced in the contract to perform the new calculation from a particular activation block. The rest of the contract interfaces are preserved.
The implementation has not yet been audited and an audited is being scheduled.
The implementation has not yet been deployed to Testnet.
Copyright and related rights waived via CC0.