Open sourcing crypto-arbitrage bot in Python – back to the dawn of crypto hype
my-it-notes.com
my-it-notes.com
In reality, the complexities involved are enormous and the biggest issue is simply that it is almost impossible to predict when the opportunity opens. Therefore, you're always dealing with what is effectively stale data. The next step is to try to trade faster, which then exposes bugs in apis and issues with dealing with connection failures.
That said, I do think that with the proper architecture and enough effort, it is definitely possible to build an arbitrage bot. Especially when you get into more complex solutions, like 3+ way. Those that have done it and are successful with it, don't sell or give away their bots because, it is arbitrage, and to make money, you have to be better at it than everyone else. Why sell a money printer when you can use it to print money?
The other realization is that the exchanges must be running arbitrage bots against themselves. I also would not doubt that there is cross exchange collusion in place as well. They help create volume and heck.. why not? No trading fees.
Something I experienced too. I would still spot profitable trade but would be late to pick them up, most of the time. With arbitrage you also have to beat the fees and the time.
Arbitrage in the past 2 years is a loser game - (or maybe not, and I am that loser). It was still a good learning experience that eventually led to other profitable ideas.
Anything you want to share?
Probably in other fields situation might be the same - judging only by facts and data can bring potential opportunities.
>> I had a lot of fun trying to optimize round trip time with various datacenters around the world.
To be honest - I am thinking crypto exchanges are not at this state yet: many of them relying on public clouds, some of them still send non-compressed plain text json data, etc.
My bot basically only traded on two exchanges, and only triggered trades. For any real profit you had to tie down quite a bit of money and risk having them on the exchanges. But the biggest issue I faced was execution. The connection to the API for both exchanges was unreliable. Arbitrage involves executing a trade on both exchanges, and much too often, one trade would fail to execute and instead of arb the bot would effectively take a position in BTC or USD. I concluded it was beyond my abilities and willingness to learn to try to mitigate the risks that came with. Frankly I wasn't sure the problem could be worked around reasonably.
A fun exercise, for sure!
As far as data, there are lots of ways to handle it. Initially the old team had used kdb mainly because they literally thought that was the only possible solution. I made something called `timequerylog` that uses newline-terminated JSON files separated out by date and hour.
Currently our postgres have something around 1 Tb which is already not so easy to play with.
[1] https://blog.coinfabrik.com/what-i-have-learned-from-my-arbi... HN thread: https://news.ycombinator.com/item?id=17249163
[2] https://blog.coinfabrik.com/an-efficient-algorithm-to-exploi...
Thats make me severely reconsider acceptance criteria of product to be ready to face customers :D
At this point the only real “arbitrage” opportunities are through derivatives (swaps and futures). However, there is still enough inefficiency in the market for individuals to squeeze out a bit of profit.
nothing in college prepared me to do even 10% of this
Maybe I fell asleep during that class I don't know.