8 namespace database_ns {
14 TFundService& _service;
17 const uint32_t _guaranted_reward_supply_period_in_days;
18 const uint32_t _reward_increase_threshold_in_days;
23 uint32_t guaranted_reward_supply_period_in_days
26 : _service(reward_service)
27 , _adjust_percent(adjust_percent)
28 , _guaranted_reward_supply_period_in_days(guaranted_reward_supply_period_in_days)
29 , _reward_increase_threshold_in_days(reward_increase_threshold_in_days)
38 return _service.get().balance;
44 const auto symbol_type = current_per_day_reward.symbol();
46 asset real_per_block_reward(0, symbol_type);
53 if (pool.balance > current_per_day_reward * _reward_increase_threshold_in_days)
56 pool.current_per_block_reward += delta;
58 else if (pool.balance < current_per_day_reward * _guaranted_reward_supply_period_in_days)
61 pool.current_per_block_reward
69 if (pool.balance >= pool.current_per_block_reward)
71 pool.balance -= pool.current_per_block_reward;
72 real_per_block_reward = pool.current_per_block_reward;
74 else if (pool.balance.amount > 0)
76 real_per_block_reward = pool.balance;
81 return real_per_block_reward;
const asset & increase_ballance(const asset &delta)
reward_balance_algorithm(TFundService &reward_service, percent_type adjust_percent=SCORUM_ADJUST_REWARD_PERCENT, uint32_t guaranted_reward_supply_period_in_days=SCORUM_GUARANTED_REWARD_SUPPLY_PERIOD_IN_DAYS, uint32_t reward_increase_threshold_in_days=SCORUM_REWARD_INCREASE_THRESHOLD_IN_DAYS)
const asset take_block_reward()
#define SCORUM_ADJUST_REWARD_PERCENT
#define SCORUM_REWARD_INCREASE_THRESHOLD_IN_DAYS
#define SCORUM_GUARANTED_REWARD_SUPPLY_PERIOD_IN_DAYS
#define SCORUM_100_PERCENT
#define SCORUM_MIN_PER_BLOCK_REWARD
#define SCORUM_BLOCKS_PER_DAY