Lessons learned building an ML trading system
After having spent an insane amount of time in late 2017/2018 building an HFT bot for Binance I can say this is a pretty solid article.<p>In our case we were doing triangle trading between BTC/ETH/USDT pairs and had our buys/sell delay down to 3-7ms. At one point moving 0.3-0.7% of Binance’s daily volume.<p>Few notes:<p>* Finding an objective point of truth for value when all of the currencies are floating is hard but vital to success.  This was the hardest problem we encountered. We tried taking the realtime average of BTC and ETH across all exchanges, we tried tying it to the shortest route to USD, and several other routes... but ultimately this is where we ended up “losing” most of our alpha.<p>* Order books are seemingly simple but the devil is in the details. This especially matters for paper trading.<p>* Efficiently using API limits at exchanges is an optimization problem in and of itself.<p>* Our model was relatively simple but we focused on speed and edge cases. For instance Binance would rotate IPs on their load balancers and we’d constantly check the latency between each open SSL connection and use the fastest. Further we wouldn’t decode the buy response to plaintext we’d just read the raw stream.<p>After several epic months our entire project fell apart after a cryptic phone call about “institutional access” that didn’t follow the 1s websocket update. The access was quiet expensive and we said no to it and shortly after all of our strategies went to crap.<p>Best we could tell someone was front running us due to an artificial delay for our account (delay between trades went to ~20ms up from our prior steady speed of 3-7ms) and/or a bunch of the trades in the orderbook were bogus.<p>Frustrated we tried our strategy on another account and the delay dropped again to our normal range and was profitable again (the orderbooks were slightly different between bots!).<p>It was in that moment we realized playing in unregulated markets is not fun or something we wanted to continue to do. Intermediary risk was something we didn’t account for.<p>Further we realized that there will always been a better resourced or more dedicated team willing to fight you for your alpha.<p>After months of effort and a ton of fun we decided it was best we went back and focused on a problem where we could build a long term competitive advantage.<p>Edit: typos and formatting