Skip to content

Instantly share code, notes, and snippets.

@ncodes
Last active September 22, 2017 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncodes/01f273cbb222f35aebe2889da4d8149d to your computer and use it in GitHub Desktop.
Save ncodes/01f273cbb222f35aebe2889da4d8149d to your computer and use it in GitHub Desktop.
function ExchangeFunc(usd, currentYear) {
// percentage of depreciation per year
var depPercent = 2 / 100
// Blockchain launch year
var epochYear = 2017
// Time since blockchain launch
var yearSinceEpoch = currentYear - epochYear
// initial estimated number of global scanners
var initEstScanners = 1000000
// increase unique scanners by depPercent each year
var finEstScanners = initEstScanners + (initEstScanners * depPercent * yearSinceEpoch)
// Calculate reward
var ell = (usd - (depPercent * usd * yearSinceEpoch)) / finEstScanners
ell = (ell < 0) ? 0 : ell
ell = isNaN(ell) ? 0 : ell
return {
ell,
initialEstimatedScanner: initEstScanners,
finalEstimatedScanners: finEstScanners,
yearSinceEpoch,
epochYear,
depPercent,
usd,
currentYear,
}
}
@ncodes
Copy link
Author

ncodes commented Sep 22, 2017

This is the initial Ellcrys exchange algorithm. It is designed to allow millions of people participate in the banknote scanning
operation without significantly inflating the value of already circulating ells. A few things to note:

  • All amount are assumed to be USD. Banknotes of other currencies must be converted to USD.
  • The amount of Ells depreciates by 2% every year from epoch (launch time).
  • The estimated number of banknote scanners (set to 1 million) helps to further depreciate the USD making room for more people
    to participate in scanning. This also increases by 2% every year.
  • This algorithm makes it extremely expensive to get 1 Ell. It will take 1,000,000 USD (in first year / epoch) to get 1 Ell.
  • At a point in the future, a dollar denomination will generate zero Ells. A $100 bill will return 0 Ell in year 2067.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment