by withinboredom · 3y ago · 0 comments
Well, it turns out that when I originally wrote the code, time was calculated in milliseconds, not seconds. So, when I thought I calculated out 17 days, it was like half an hour-ish. It caused a small crash trying to dump everything almost all at once, on some of the alt-coin markets, and lost almost all the money.
I walked away with ~$700.
I was literally in tears, as I went from so excited and I'm going to "just retire" ... to just as broke as I was an hour prior. The emotional roller-coaster of euphoria, to 'oh shit, what did I do!?', to 'well ... fuck' was not fun.
Anyway, good luck. There might be a lesson in there, but mostly, be careful where the intersection of money and programming lie.
For what it's worth, I'm not accusing you of lying, I'm making a tongue in cheek observation about altcoin exchanges.
It does seem like you are stating the MTM valuation (i.e. spot x notional) without mentioning liquidity, which is where the confusion from others is coming in. It's very possible to accumulate a large position in a low liquidity altcoin that you will have zero hopes of selling for that valuation, even over time.
I’ve worked on everything from the ultra liquid equity futures markets down to the shittiest of shitcoins imaginable and these numbers just don’t make sense at all. There’s a paradox: your valuation implies an active market and your execution implies a dead market.
When shitcoin markets die, they die at small fractions of a cent, and there are lingering sell orders in from people who got caught in the pump’n’dump and live under the false hope that their superconductorcoin will be worth something later on, which then removes the possibility of any remaining large-price buy orders. So for your valuation to be that high, it can’t have been a dead market.
But for your execution to be that low, it has to have been one.
I can’t truly believe that someone who is smart enough to build a system that accidentally stays functioning in the background for that long (I’ve never seen such a thing) is silly enough to calculate valuations so naively.
If $11,000,000 turned into $700 then the "market cap" was bullshit and the coin was bullshit and whatever "price" it had was bullshit. Maybe you could have done a little better than you did but there wasn't any there there, in the sense that there were actually eleven million real greenback dollars in the hands of people that had any interest at all in owning that coin.
This dynamic completely underpins the entire concept of crypto, with the possible exception of a couple big ones. It's just market manipulation and people trading with each other. Turns out nobody wanted to own digital apes either it was grift all the way down.
public static decimal StdDeviation(IEnumerable<decimal> data, decimal mean)
{
var sumOfSquares = data.Select(x => (x - mean) * (x - mean)).Sum();
return (decimal) Math.Sqrt((double) sumOfSquares / (data.Count() - 1));
}
It was written at 1:30am, according to git blame ... there's even a potential division by 0 hiding in there, so this is some shit code 'just to see what happens'. Anyway, that `data.Count() - 1` is the part that is "wrong" and tbh, I have no idea how it changes things.The mean passed to it wasn't even a true mean either, it was a sliding window mean, of a specific area of resistance multiplied by reciprocal of an "influence" coefficient. Yeah... I have no idea how this shit worked. This is nearly 5 years old at this point and hasn't run in 3+ years.
It used to output a realtime graph that was visible from the web, it would show the output of all this math. From what I remember, this signal shows as a line on the buy side, sloping up/down. That slope indicated whether a specific resistance line was at risk of dissolving or a new one being created with the idea being to buy as much as possible before the resistance line actually dissolved.
It also monitored the buy/sell gap, and took some notes from that (large gaps mean new resistances while a small gap means waiting for a big order to break through and cause volatility).
And another upside: the valuable lessons you learned are probably worth… well… millions of dollars!
Back to topic: How did the crash lead to losing the money technically? What happened here? How did too many requests of selling lead to „devaluation“?
You should definitely write a longer form story about this and include some code.
This is not specific to cryptography, it's a feature of all markets: if there's a scarce resource that a lot of people want, people will pay more for it. Parent flooded the market with whatever cryptocurrency instruments they held, suddenly making them a lot less scarce and so reducing their value. They could have avoided losing that by selling much more slowly (as they intended) or refusing to sell below a certain fixed price. In either case, they would probably not get quite as much as they had hoped for the whole lot due to a lesser version of the same effect.
its one of the easiest trades