Numbers quickly became one of the trickier parts of tracking and calculating mining profit. MySQL offers many different numeric types and I first settled on using DECIMAL for most of my calculations. Some ridiculous values like with 40 significant digits. That worked out fairly well at the start.
The cryptocurrency market however was in a downward spiral and exchanges started trading in fractions of a Satoshi. First 1/10, then 1/100 and 1/1000th of a Satoshi for certain high volume coins like Qwertycoin are being traded at 0.0000000048 BTC or 0.48 Satoshi. All of the major Cryptonight coin exchanges only had BTC pairs at the start of my project but they soon added LTC and XMR pairs. Those pairs drove prices down again where you see BBSCoin trading at 0.00000001 LTC. That is 0.0000000000969 BTC or 0.00969 Satoshi per coin.
In the end my largest numbers stored are in my exchange logs tracking the pair prices for coins other than BTC. The longest field is 74 characters long. So 73 digits total assuming all of them have a decimal point.
0.000001889999999999999903886019510246274677456312929280102252960205078125A small precise number I didn’t feel like optimizing.
Using TEXT might be lazy but it bought me precision and removed having to think about updating my schema when new coins came out that were even crazier in terms of block rewards and fractional LTC values. In the end any trade off I think was worth it because I fixed my problems and could move on to other issues while removing a potential failure point in the future.
This was part of a series: Ephemeral Projects as Performance Art