Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Commit 1ffdb37

Browse files
authored
Merge pull request #548 from GolosChain/495-inflation-comments
Inflation comments. #495
2 parents ae7ce36 + 362b88f commit 1ffdb37

File tree

1 file changed

+26
-30
lines changed

1 file changed

+26
-30
lines changed

libraries/chain/database.cpp

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,46 +2319,44 @@ namespace golos {
23192319
}
23202320
}
23212321

2322-
/**
2323-
* Overall the network has an inflation rate of 102% of virtual steem per year
2324-
* 90% of inflation is directed to vesting shares
2325-
* 10% of inflation is directed to subjective proof of work voting
2326-
* 1% of inflation is directed to liquidity providers
2327-
* 1% of inflation is directed to block producers
2328-
*
2329-
* This method pays out vesting and reward shares every block, and liquidity shares once per day.
2330-
* This method does not pay out witnesses.
2331-
*/
2322+
/**
2323+
* At a start overall the network has an inflation rate of 15.15% of virtual golos per year.
2324+
* Each year the inflation rate is reduced by 0.42% and stops at 0.95% of virtual golos per year in 33 years.
2325+
* 66.67% of inflation is directed to content reward pool
2326+
* 26.67% of inflation is directed to vesting fund
2327+
* 6.66% of inflation is directed to witness pay
2328+
*
2329+
* This method pays out vesting, reward shares and witnesses every block.
2330+
*/
23322331
void database::process_funds() {
23332332
const auto &props = get_dynamic_global_properties();
23342333
const auto &wso = get_witness_schedule_object();
23352334

23362335
if (has_hardfork(STEEMIT_HARDFORK_0_16__551)) {
23372336
/**
2338-
* At block 7,000,000 have a 9.5% instantaneous inflation rate, decreasing to 0.95% at a rate of 0.01%
2339-
* every 250k blocks. This narrowing will take approximately 20.5 years and will complete on block 220,750,000
2340-
*/
2337+
* Inflation rate starts from 15,15% and reduced to 0.95% at a rate of 0.01% every 250k blocks.
2338+
* At block 178,704,000 (16 years) have a 8.00% instantaneous inflation rate. This narrowing will take
2339+
* approximately 33 years and will complete on block 357,408,000.
2340+
*/
23412341
int64_t start_inflation_rate = int64_t(STEEMIT_INFLATION_RATE_START_PERCENT);
2342-
int64_t inflation_rate_adjustment = int64_t(
2343-
head_block_num() / STEEMIT_INFLATION_NARROWING_PERIOD);
2342+
int64_t inflation_rate_adjustment = int64_t(head_block_num() / STEEMIT_INFLATION_NARROWING_PERIOD);
23442343
int64_t inflation_rate_floor = int64_t(STEEMIT_INFLATION_RATE_STOP_PERCENT);
23452344

23462345
// below subtraction cannot underflow int64_t because inflation_rate_adjustment is <2^32
2347-
int64_t current_inflation_rate = std::max(start_inflation_rate -
2348-
inflation_rate_adjustment, inflation_rate_floor);
2346+
int64_t current_inflation_rate =
2347+
std::max(start_inflation_rate - inflation_rate_adjustment,
2348+
inflation_rate_floor);
23492349

23502350
auto new_steem =
23512351
(props.virtual_supply.amount * current_inflation_rate) /
2352-
(int64_t(STEEMIT_100_PERCENT) *
2353-
int64_t(STEEMIT_BLOCKS_PER_YEAR));
2352+
(int64_t(STEEMIT_100_PERCENT) * int64_t(STEEMIT_BLOCKS_PER_YEAR));
23542353
auto content_reward =
23552354
(new_steem * STEEMIT_CONTENT_REWARD_PERCENT) /
2356-
STEEMIT_100_PERCENT; /// 75% to content creator
2355+
STEEMIT_100_PERCENT; /// 66.67% to content creator
23572356
auto vesting_reward =
23582357
(new_steem * STEEMIT_VESTING_FUND_PERCENT) /
2359-
STEEMIT_100_PERCENT; /// 15% to vesting fund
2360-
auto witness_reward = new_steem - content_reward -
2361-
vesting_reward; /// Remaining 10% to witness pay
2358+
STEEMIT_100_PERCENT; /// 26.67% to vesting fund
2359+
auto witness_reward = new_steem - content_reward - vesting_reward; /// Remaining 6.66% to witness pay
23622360

23632361
const auto &cwit = get_witness(props.current_witness);
23642362
witness_reward *= STEEMIT_MAX_WITNESSES;
@@ -2369,8 +2367,9 @@ namespace golos {
23692367
witness_reward *= wso.miner_weight;
23702368
} else if (cwit.schedule == witness_object::top19) {
23712369
witness_reward *= wso.top19_weight;
2372-
} else
2370+
} else {
23732371
wlog("Encountered unknown witness type for witness: ${w}", ("w", cwit.owner));
2372+
}
23742373

23752374
witness_reward /= wso.witness_pay_normalization_factor;
23762375

@@ -2388,8 +2387,7 @@ namespace golos {
23882387
auto content_reward = get_content_reward();
23892388
auto curate_reward = get_curation_reward();
23902389
auto witness_pay = get_producer_reward();
2391-
auto vesting_reward =
2392-
content_reward + curate_reward + witness_pay;
2390+
auto vesting_reward = content_reward + curate_reward + witness_pay;
23932391

23942392
content_reward = content_reward + curate_reward;
23952393

@@ -2402,10 +2400,8 @@ namespace golos {
24022400
modify(props, [&](dynamic_global_property_object &p) {
24032401
p.total_vesting_fund_steem += vesting_reward;
24042402
p.total_reward_fund_steem += content_reward;
2405-
p.current_supply +=
2406-
content_reward + witness_pay + vesting_reward;
2407-
p.virtual_supply +=
2408-
content_reward + witness_pay + vesting_reward;
2403+
p.current_supply += content_reward + witness_pay + vesting_reward;
2404+
p.virtual_supply += content_reward + witness_pay + vesting_reward;
24092405
});
24102406
}
24112407
}

0 commit comments

Comments
 (0)