substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Nomination Pool Commission

Open rossbulat opened this issue 3 years ago • 0 comments

This PR adds commission functionality to Nomination Pools.

A Commission struct and CommissionThrottle struct have been introduced to have:

  • the current commission, defaults to 0%.
  • a maximum commission: defaults to None, can be set and then subsequently accepts more restrictive values
  • a receiver - the account to receive commission, defaults to None.
  • throttle: allows an optional configuration to limit how often, and by how much, commission can be changed. defaults to None, and accepts more restrictive updates after initial values set.

set_commission_receiver ,set_commission, set_max_commission, and set_commission_throttle calls have been introduced.

The commission is split and sent in do_reward_payout.

Notes:

I wonder if we can merge the 4 calls into one call, set_commission_configs that can accept a Noop or an updated value, to decrease the amount of these calls being introduced here.

Addresses #11672.

TODO:

  • [ ] Commission deduction / transfer tests on do_reward_payout .
  • [ ] Make primitive Commission struct to take over into staking & implement this in nomination-pools?

rossbulat avatar Oct 17 '22 12:10 rossbulat