Adaptive Inflation: use delegate's parameters to pay rewards
In !8091 (merged), I changed how some rewards were paid:
- on the spendable balance (as before) if AI is not enabled
- on the frozen deposits if AI is enabled.
What should be done instead, once #5746 (closed) is finished, is the following:
- when
rrewards must be paid to delegateB(follow !8091 (merged) to see what places to change) - let
ebeB'sbaking_over_staking_edgefor the current cycle (as a value between 0 and 1)- 0 means the delegate shares everything with costakers
- 1 means the delegate shares nothing with costakers
Version 1:
- pay
r * eon the delegate's spendable balance - pay
r * (1 - e)on the delegate's frozen deposits
Version 2 (takes delegation into account):
- let
dandfbe the delegated and frozen parts ofBstake for the current cycle (as given by the distribution) - let
d' = d / staking_over_delegation_edge - pay
r * (1 - e) * f / (d' + f)onB's frozen deposits - pay the rest of
B's spendable balance
If the distribution is available (probably baking rewards, baking bonuses, endorsing rewards), use V2. If not (probably revelation rewards), use V1.
Edited by Mehdi Bouaziz