Live data from Hacker News

Lessons learned building an ML trading system

tradientblog.com

11–20 of 160 posts

Re: Lessons learned building an ML trading system

#11
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.

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.

Few notes:

* 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.

* Order books are seemingly simple but the devil is in the details. This especially matters for paper trading.

* Efficiently using API limits at exchanges is an optimization problem in and of itself.

* 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.

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.

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.

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!).

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.

Further we realized that there will always been a better resourced or more dedicated team willing to fight you for your alpha.

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.

Edit: typos and formatting

Re: Lessons learned building an ML trading system

#12

Great post! Very refreshing to hear about a) the honest level of effort involved in this type of endeavor, b) the amount of nonsense trading advice out there. Maybe in a future post you could discuss the security and banking side of this in more detail? In the 6ish years I’ve played around with crypto trading (and I really mean play, nothing close to your level), I’ve had 2 exchanges hacked and lose all customer fund…

The banking side is becoming more mature, I think, as many exchanges like Coinbase provide custodial cold-storage options for institutional clients. Counter-party risk always exist. > Then there are the horror stories of banks freezing your account when you move funds in and out of exchanges. Depends on the country. What happened to me is that a bank did not freeze my account. Instead, they simply reported it to the…

Why did you have to pay back trading profits with interest? Do you mean taxes on trading profits with interest*?

Which country?

Re: Lessons learned building an ML trading system

#13

Earlier quoted context omitted.

The banking side is becoming more mature, I think, as many exchanges like Coinbase provide custodial cold-storage options for institutional clients. Counter-party risk always exist. > Then there are the horror stories of banks freezing your account when you move funds in and out of exchanges. Depends on the country. What happened to me is that a bank did not freeze my account. Instead, they simply reported it to the…

Why did you have to pay back trading profits with interest? Do you mean taxes on trading profits with interest*? Which country?

Yes, taxes on the profit with interest applied.

Finland.

Extra warning: ensure your country allows individual cryptocurrency investors to reduct losses from winnings. Without such law, if you win 100 dollars and then lose 100 dollars, you would still owe the government taxes while you are at 0. This is the case in surprisingly many countries.

Re: Lessons learned building an ML trading system

#16

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. 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. Few notes: * Finding an objective point of truth for value when all of the currencies are floating is hard but vita…

Thanks for sharing. Do you think building the strategy on another exchange such as Coinbase Pro or pursuing a strategy that wasn't as latency-sensitive might've yielded more success?

Re: Lessons learned building an ML trading system

#18

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. 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. Few notes: * Finding an objective point of truth for value when all of the currencies are floating is hard but vita…

> the orderbooks were slightly different between bots

That sounds like a big deal. If this is repeatable, you should document it better. Unregulated doesn't mean a license to do blatantly illegal things. Crypto exchanges certainly get taken to court.

Sure it wasnt your book building algo and a snapshot retrieval race?

Post reply on HN