Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions contracts/eosio.system/src/producer_pay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ namespace eosiosystem {
// TELOS BEGIN
uint64_t tlos_price = get_telos_average_price();
auto to_workers = static_cast<int64_t>((12 * double(_gpayrate.worker_amount) * double(usecs_since_last_fill)) / double(useconds_per_year));
double bp_pay_per_month = std::min((double(378000) * std::pow(tlos_price/10000.0,-0.516)),double(882000)) * 10000;
double bp_pay_per_month = std::min((double(189000) * std::pow(tlos_price/10000.0,-0.516)),double(315000)) * 10000;
auto to_producers = static_cast<int64_t>((bp_pay_per_month * 12 * double(usecs_since_last_fill)) / double(useconds_per_year));
// TELOS END
auto new_tokens = to_workers + to_producers;
Expand Down Expand Up @@ -400,9 +400,6 @@ namespace eosiosystem {
// Reads the payouts table
tedp::payout_table payouts(tedp_account, tedp_account.value);

// Gets daily median TLOS price
uint64_t tlos_price = get_telos_average_price();

uint64_t now_ms = current_time_point().sec_since_epoch();
bool payouts_made = false;
int64_t new_tokens = 0;
Expand All @@ -424,21 +421,7 @@ namespace eosiosystem {
uint64_t total_due = (payouts_due * p.amount) * 10000;
payouts_made = true;

if (p.to == REX_ACCOUNT)
{
uint64_t payout = total_due;
if(tlos_price >= 10000 && tlos_price < 20000) { // If TLOS daily close of $1.00, the payout will be decreased to 2/3
payout *= 2;
payout /= 3;
} else if(tlos_price > 20000) { // If TLOS daily close of $2.00, the payout will be decreased to 1/3
payout /= 3;
}
new_tokens += payout;
}
else
{
new_tokens += total_due;
}
new_tokens += total_due;
}

// Check if any payouts are needed to be made
Expand Down