paymentModelFunction = function(gbHours, downloadedBytes) {
HOURS_IN_MONTH = (24 * 365) / 12
## Average number of hours in a month
STORJ_USD_RATE = 0.81671
## This is determined by value reported on https://coinmarketcap.com/ at time
## of payout calculation.
gbHoursScaled = sapply((gbHours - median(gbHours)) / sd(gbHours),
function(x) ifelse(x < 0, 0, x))
downloadedBytesScaled = sapply((downloadedBytes - median(downloadedBytes)) / sd(downloadedBytes),
function(x) ifelse(x < 0, 0, x))
## Both gbHoursScaled and downloadedBytesScaled can not be less than 0 to
## ensure everyone gets at least the base payout amount.
downloadedBytesFlag = as.numeric(downloadedBytes > 0)
gbHoursFlag = as.numeric(gbHours >= 730)
isQualifiedFlag = sapply(gbHoursFlag + downloadedBytesFlag,
function(x) ifelse(x > 0, 1, 0))
## At least one of the above criteria must be met to qualify for a payment.
basePayout = (1.50 / STORJ_USD_RATE) * isQualifiedFlag
## The current base payout is set to $1.50 USD.
ghHourPayout = 11.45 * gbHoursScaled * isQualifiedFlag
downloadedBytesPayout = 3.0060 * downloadedBytesScaled * isQualifiedFlag
payoutAmountSTORJ = ghHourPayout + downloadedBytesPayout + basePayout
payoutAmountUsd = payoutAmountSTORJ * STORJ_USD_RATE
cbind(payoutAmountSTORJ, payoutAmountUsd)
}
- Nodes that have not been seen in the past week (from the time first preliminary payouts are calculated) are not included in the metric totals
- Each component (gbHours and downloaded bytes) is scaled so that each metric ends up being a measurement of how far away you are from the median
- Those values are multiplied by certain weights and summed to arrive at a final value
also if we are going to avg the hours in a month lets use a more correct 365.2422 days in a year so it won't have to change in a leap year as using this number accounts for that time.