[go: up one dir, main page]

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 r rewards must be paid to delegate B (follow !8091 (merged) to see what places to change)
  • let e be B's baking_over_staking_edge for 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 * e on the delegate's spendable balance
  • pay r * (1 - e) on the delegate's frozen deposits

Version 2 (takes delegation into account):

  • let d and f be the delegated and frozen parts of B stake for the current cycle (as given by the distribution)
  • let d' = d / staking_over_delegation_edge
  • pay r * (1 - e) * f / (d' + f) on B'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