pub trait ProviderBoostRewardsProvider<T: Config> {
    type Balance;

    // Required methods
    fn reward_pool_size(
        total_staked: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance
    ) -> <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance;
    fn era_staking_reward(
        era_amount_staked: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance,
        era_total_staked: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance,
        era_reward_pool_size: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance
    ) -> <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance;
    fn capacity_boost(
        amount: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance
    ) -> <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance;
}
Expand description

A trait that provides the Economic Model for Provider Boosting.

Required Associated Types§

source

type Balance

The type for currency

Required Methods§

source

fn reward_pool_size( total_staked: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance ) -> <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance

Return the size of the reward pool using the current economic model

source

fn era_staking_reward( era_amount_staked: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance, era_total_staked: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance, era_reward_pool_size: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance ) -> <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance

Calculate the reward for a single era. We don’t care about the era number, just the values.

source

fn capacity_boost( amount: <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance ) -> <<T as Config>::Currency as InspectFungible<<T as Config>::AccountId>>::Balance

Return the effective amount when staked for a Provider Boost The amount is multiplied by a factor > 0 and < 1.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Config> ProviderBoostRewardsProvider<T> for Pallet<T>

§

type Balance = <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance