Cycle 21 (v2 cycle #3), day 1 Off:
Setuping my XMR miners did make me realise that crypto mining was something fun that I did like.
Something that I did want to do for a long time but I have never dare doing it before due to the price tag was to purchase BTC miners. I just bought 2 Antminer S9...
There was definitely a fear that investing in that was a resource misallocation... I did just put the fear aside and I did pass my order impulsively.
I started to look around if I could place them behind a proxy like I did for the XMR miners. There is no such thing for the mining Stratum protocol...
I did look into the stratum protocol for some time yesterday and I have found a very clever way to implement a proxy for this protocol.
When the proxy receive subscription reply from a mining pool, You slightly modify the answer that you are going to send to your miners.
1. You decrement the Extranonce2_size value
2. You append unique 1 byte id for each miner to the Extranonce1 field.
That should do it. In fact, if I put that idea on github, I suspect that this could become a very popular project...
But I'm not forgetting my trading server project. I did finish reviewing the logs. This time, I have found a bug in the exchange code. I did report the issue, lets see what they are going to reply. This could deserve me a small bug bounty. They did that last time that I found something similar.
I have restarted the server before going to bed. Now, I see a lot of opportunities that I fail to grab. When I initiate my trade, the spotted book entry disappear 40-50ms after having appeared and I miss it. It feels like someone else is spotting the same opportunities and I am getting front-runned.
Timing is perfect, I started to have plenty of good ideas for optimization. It seems like it is going to be optimization season now (one of my favorite hobby to not say one of my sins...).
First step has been done. I did put in place some instrumentation code to measure the time it takes between receiving an update from the exchange and the time an order is sent out.
Once I know the answer, this is going to be my baseline to measure potential improvements (or simply if there is a lot of fat there. If there is not much, it is simply a question of getting my server closer to the exchange).
But things got crazy since I restarted my server. Usually, the log file size gets around 5MB after a week of running... Traders are crazy since yesterday evening because the markets are taking a dive. The side effect is that the trade volume is so big that it is saturating the exchange server and as a sideeffect, it sends out of date data. My server went crazy because of that and it generated 17MB of logs. No idea what did happen exactly. I'll need to look into this damn log file. I was so happy to have finished goign through the logs of January 7th.... I'm not too happy to have to return to log analysis so fast after having done it for a long time.
Fortunately, by inspecting my account balances, nothing dramatic did happen. I made even have made a small profit but I need to find out what did happen. The server did shuffle my balances around the place... It is weird...
Oh well, my days are everything but boring.
Update:
I have a first reaction time number. It seems a bit high... It took 2ms between receiving and update and sending out an order... It is going to be fun shaving this number...
Setuping my XMR miners did make me realise that crypto mining was something fun that I did like.
Something that I did want to do for a long time but I have never dare doing it before due to the price tag was to purchase BTC miners. I just bought 2 Antminer S9...
There was definitely a fear that investing in that was a resource misallocation... I did just put the fear aside and I did pass my order impulsively.
I started to look around if I could place them behind a proxy like I did for the XMR miners. There is no such thing for the mining Stratum protocol...
I did look into the stratum protocol for some time yesterday and I have found a very clever way to implement a proxy for this protocol.
When the proxy receive subscription reply from a mining pool, You slightly modify the answer that you are going to send to your miners.
1. You decrement the Extranonce2_size value
2. You append unique 1 byte id for each miner to the Extranonce1 field.
That should do it. In fact, if I put that idea on github, I suspect that this could become a very popular project...
But I'm not forgetting my trading server project. I did finish reviewing the logs. This time, I have found a bug in the exchange code. I did report the issue, lets see what they are going to reply. This could deserve me a small bug bounty. They did that last time that I found something similar.
I have restarted the server before going to bed. Now, I see a lot of opportunities that I fail to grab. When I initiate my trade, the spotted book entry disappear 40-50ms after having appeared and I miss it. It feels like someone else is spotting the same opportunities and I am getting front-runned.
Timing is perfect, I started to have plenty of good ideas for optimization. It seems like it is going to be optimization season now (one of my favorite hobby to not say one of my sins...).
First step has been done. I did put in place some instrumentation code to measure the time it takes between receiving an update from the exchange and the time an order is sent out.
Once I know the answer, this is going to be my baseline to measure potential improvements (or simply if there is a lot of fat there. If there is not much, it is simply a question of getting my server closer to the exchange).
But things got crazy since I restarted my server. Usually, the log file size gets around 5MB after a week of running... Traders are crazy since yesterday evening because the markets are taking a dive. The side effect is that the trade volume is so big that it is saturating the exchange server and as a sideeffect, it sends out of date data. My server went crazy because of that and it generated 17MB of logs. No idea what did happen exactly. I'll need to look into this damn log file. I was so happy to have finished goign through the logs of January 7th.... I'm not too happy to have to return to log analysis so fast after having done it for a long time.
Fortunately, by inspecting my account balances, nothing dramatic did happen. I made even have made a small profit but I need to find out what did happen. The server did shuffle my balances around the place... It is weird...
Oh well, my days are everything but boring.
Update:
I have a first reaction time number. It seems a bit high... It took 2ms between receiving and update and sending out an order... It is going to be fun shaving this number...