Show HN: RandomCoin – A cryptocurrency that changes its price every second
eugenekudashev.com
eugenekudashev.com
But I would argue that the proper mechanism for the random-pattern is a random-walk of the %increase or %loss at each step, and not the uniformly-varying price that's rather easy to game.
----
Perhaps this "game" is more fun with a uniformly-varying price however.
If you randomly add or subtract x% at each step the price tends toward zero (100, 50, 75, 37.5, …)
Make this a disaster lol
If you add CALL and PUT options (American style ie., exercisable anytime before expiry), perhaps one can try buying both (ie., hedging) and profit from both the random upside as well as random downside without really HODLing the underlying RandomCoin.
Something that I didn't expect is that is not that easy as "buy low" and "sell high". I had to cap the buying price for the bot to make money at all, else the "bought at" will get so high, that you won't have a chance to buy much.
let bougthAt = 0;
let fn = { click: () => {} };
let buy = document.querySelector("#buy");
let sell = document.querySelector("#sell");
(function work() {
let founds = +document.querySelector("#funds-fiat").innerText;
let coins = +document.querySelector("#funds-coin").innerText;
let price = +document.querySelector("#price").innerText;
if (founds > price && price < 5000) {
fn = buy;
bougthAt = price;
console.log("bougthAt", bougthAt);
} else if (price > bougthAt && coins > 0) {
fn = sell;
console.log("sellingAt", price);
}
fn.click();
requestAnimationFrame(work);
})();One easy way is to add a flag
let working = true;
(function work() {
console.log("running");
if (working) requestAnimationFrame(work);
else console.log("stopped");
})();
Programmatically, you have the function cancelAnimationFrame that you give as parameter what requestAnimationFrame returns. The same as setTimeout and clearTimeoutVIX is now a how many billion dollar industry? (Not that that defeats Black-Sholes.)
note. how about a total supply so limit number of coins in circulation and a coin burn mechanism to reduce supply slowly, maybe with each transaction, transfer