GitHub Logo HIP-782: Smoothing Staking Rewards

Author Leemon Baird
Discussions-To https://github.com/hashgraph/hedera-improvement-proposal/pull/782
Status Final
Needs Council Approval Yes
Review period ends Wed, 09 Aug 2023 07:00:00 +0000
Type Standards Track
Category Core
Created 2023-08-01
Updated 2023-09-13
Replaces 406
Release v0.40.0

Note: This hip does not replace all of hip-406 Staking. It replaces only replaces a small part. Otherwise, hip-406 still stands.

Abstract

This HIP describes a change to the staking reward system for proof of stake described in HIP-406. HIP-406 gives rewards at a constant reward rate until the unreserved balance of account 0.0.800 is empty, then suddenly drops to a near zero reward rate. This HIP defines a change so that as 0.0.800 approaches being empty, the reward rate decreases smoothly rather than with an abrupt drop.

Motivation

Rationale

User Stories

Specification

In the original HIP, there is a setting stakingRewardRate, and rewards are given at that rate until the unreserved balance of account 0.0.800 is empty, at which point it abruptly drops to simply distributing each day whatever came in to that account the previous day, such as through transaction fees.

The change is to remove this settings, and have stakingRewardRate automatically change each day, based on the balance of 0.0.800 and three settings: maxRewardRate, rewardBalanceThreshold, and maxStakeRewarded. The maxRewardRate (in tinybars earned per hbar staked per day) is the rate to pay normally (i.e., when 0.0.800 has a large balance, and not too many hbars are staked for reward). When the balance of 0.0.800 drops below rewardBalanceThreshold (in tinybars), then the stakingRewardRate drops smoothly as the balance drops. If the hbars staked for reward exceed maxStakeRewarded (in tinybars), then there is a further decrease.

Let unreservedBalance (in tinybars) be the balance of account 0.0.800 minus the amount of rewards that have been earned but not yet distributed. Let stakedForReward (in tinybars) be the total balance of all accounts on Hedera that have been staked for reward (so it ignores accounts that stake but decline a reward). Then each day, just before the HIP-406 reward calculations are performed using stakingRewardRate, recalculate stakingRewardRate as follows (implemented with equivalent results, but using integer calculations, rather than the real-number calculations shown):

//A real number proportional to the unreserved balance, from 0 for empty, up to 1 at the threshold.
balanceRatio = min(unreservedBalance, rewardBalanceThreshold) / rewardBalanceThreshold;

stakingRewardRate = maxRewardRate
                      * balanceRatio * (2 – balanceRatio) 
                      * min(1, maxStakeRewarded / stakedForReward)

Backwards Compatibility

This has no effect on HAPI or on transactions. It just affects the amount of daily staking rewards received by accounts that stake for reward, when 0.0.800 has a low balance.

Security Implications

None.

How to Teach This

Reference Implementation

Rejected Ideas

Open Issues / FAQ

Copyright/license

This document is licensed under the Apache License, Version 2.0 – see LICENSE or (https://www.apache.org/licenses/LICENSE-2.0)

Citation

Please cite this document as: