pub fn calculate_loyalty_multiplier<Period: CheckedSub + TryInto<u32> + TryInto<u128>>(
    periods: Period,
    initial_reward_percentage: FixedU128,
    scale_coef: u32
) -> Result<FixedU128, MathError>
Expand description

This function calculate loyalty multiplier or error.

t = periodNow - periodAdded num = t + initial_reward_percentage * scale_coef denom = t + scale_coef

loyalty_multiplier = num/denom