Sunday, February 26, 2023

XPower: Variable Reward Rates

Hasan Karahan, MSc ETH Zurich

Let’s say you offer stakeable NFTs with fixed reward rates of 1%: So, if a user stakes an NFT with a nominal face value of 1’000 units over a year then he should be rewarded with 10 units.

So, far so good. Now, let’s say you would like to introduce variable reward rates. Let’s discuss the most naive implementation of such variability, and the associated problems.

The Naive Approach to Increasing Rates ¶

The easiest way to realize variable reward rates would be to just increase the current value immediately to the desired target rate:

$$\textbf{rate}_t=\textbf{target[rate]}_t $$

Let’s investigate how such a sudden transition of the current rate would look like:

Reward Rates: Sudden Increase
Reward Rates: Sudden Increase

Above, you see that the reward rate has been doubled (in the middle of the year) from 1% to 2%. While such an increase is easy to understand, it has unfortunately many down sides:

  • In the rate curve above we would like to reward NFT stakers with respect to only the purple area without the rectangle in the red upper-left corner: So, instead of 10 units the reward should now be 15.

  • However, that is not what is happening here: At the end of the year the reward will be 20 units including the red area!

The issue is, that if we naively increase the reward rate then the staking period of the 6 months before the increase is also rewarded at 2%, which is obviously wrong. If the past staking period was long then this could even result in a dangerous situation, where the pool distributing the rewards could immediately be drained due to a sudden spike of the claims.

The Naive Approach to Decreasing Rates ¶

Reward Rates: Sudden Decrease
Reward Rates: Sudden Decrease

Alright, let’s investigate the reverse situation: What happens when an initial reward rate of 2% is dropped down to 1%? Nothing good:

  • Again, above we would like to reward with respect to the purple area (without the rectangle in the red upper-right corner): So, instead of 20 units the reward should be 15.

  • However, that is not what is happening here: At the end of the year the reward will only be 10 units excluding the area of the purple upper-left corner!

So, this time we have the reverse problem where the staking period before the decrease is not rewarded at 2% but instead only at 1%, which again is obviously wrong.

The Correct Approach ¶

Well, how can we solve this conundrum? Simply setting the reward rate to a new target does not work. So, we need somehow to defer a full update, and allow the current value to approach the target slowly over time.

But how slow? We would like the approach to be as fast as possible, but it apparently needs to be slower than an immediate switch. The solution lies in recognizing that the new target rate needs to blend in in proportion to the passage of time compared to the duration the current rate has been active for:

$$\textbf{rate}_t=\sum_{\tau\leqslant t} \textbf{target[rate]}_\tau \times \Delta[\tau] \Bigg{/} \sum_{\tau\leqslant t}\Delta[\tau]$$

The formula states in a nutshell that the reward rate corresponds to the area under the targets divided by the total duration.

Reward Rates: Asymptotic Increase
Reward Rates: Asymptotic Increase

Above, we see that the target rate switched after 6 months from 1% to 2%. If you look at the current value of the purple curve, you notice that it corresponds to the area under the red one at any point in time. For example, in the 12th month of the year the area is in total $1\%\times{6} + 2\%\times{6} = 1.5\%\times{12}$, which corresponds to an average reward rate of $1.5\%$. Obviously, a similar relation holds true if the target rate is decreased (instead of being increased).

Conclusion ¶

As we have seen, to offer variable reward rates on the XPower NFTs we are forced to operate with targets which are then asymptotically approached by the actual reward rates. A nice side effect of this natural constraint is that the stakers of the protocol can be assured that rates which have remained persistent over a long period of time, are hard to change to a new value: We call this property the “Lethargic Principle” which induces trust into the current rate configuration of the protocol.