I am a cautious investor to say the least. I jumped on the index investing bandwagon and have focused on lowering costs wherever possible. I resist any and all urges to time the market because I don’t think that’s it worth the effort to try.
All in all, my investing principles are diversification, low costs, and spending as little time thinking about it as possible.
But crypto arbitrage bots are so fun
So of course, I spent the last month working on building a bot to identify and execute arbitrage opportunities in the crypto-currency markets.
As antithetical as crypto investing is to everything I just said, I actually don’t consider this to be too out of step.
For one, I put up a very small amount of money. Also, while I do have positions in crypto-currencies now, price movements, relative to USD, don’t really matter. The reason: arbitrage.
Not really though
Purists who interrogate my plan would quickly point out that I’m not really attempting true arbitrage. I don’t plan on converting any trades back into USD. In other words, because I’m maintaining a long crypto-position, it’s not arbitrage. And that is true. But the principles of arbitrage still guide my bot.
I created a bot that scans the more established exchanges for price differences in the BTC to ETH market. If the gap between two markets is high enough, then the bot will try to execute two trades simultaneously to capture the difference.
When everything works, the end result is that my aggregate number of ETH and BTC both go up microscopically. My hypothesis is that if you were to extrapolate that out over the course of a year, you can probably generate a better return than my high-yield (I mean, 1.25%, but still) Ally savings account.
(That of course, discounts the changes of an exchange being hacked, which is why I’d never make this a real part of my portfolio.)
Why?
But then, you might ask, if this may not work, and you wouldn’t ever do it at scale, then what is the point?
To that, rational reader, I would say: well, since this is my second post, you clearly do not understand the animating principles of Zack.
It turns out that this is just a really fun problem to solve if you are someone who loves web scraping, economics, and Python.
In order for this to even get off the ground, you need to have a scraper that can pull and parse the order book data for each exchange. And of course, each one is different.
You need to understand enough econ/finance to be able to implement the arbitrage logic.
And you need to have enough Python to a) make sure you don’t accidentally liquidate all your coins for peanuts and b) generate some cool reporting and visualizations out of it.
(Turns out, my brand of arbitrage also needed some additional brains in order to rebalance the coins within each exchange wallet.)
Just a really fun problem to try and solve. It’s modern-day alchemy: you put in an idea, add some Python, and voila, crypto-currency balances go up (however slowly) like magic.
I may have the worst timing ever
I’d be the first to admit, my timing could have been better.
For one thing, I put in my small chunk of USD just about at the top of the crypto-bubble. Honestly, I don’t really care that the value of my “investment” dropped so much, because the goal here is to prove out the arbitrage engine. But still, it’s almost comical how bad the timing was.
For another, I did a lot of my early testing and development prior to the bubble semi-bursting. So I think that probably lulled me into a false sense of high volatility (and therefore, consistent arbitrage opportunities).
The screen-shot below is a quick visualization of roughly 90 minutes last Thursday. The price on the two exchanges that I track was swinging back and forth so wildly that there were no less than 4 trades available in the span of that 90 minutes.
And even crazier, because the exchanges were flip flopping, several of the trades were rebalancing trades, which enabled more trades later.

Now of course, since my timing was of the aforementioned terrible variety, that was the last arbitrage opportunity for 4 days.
Mission accomplished
So even if my bot never identifies another crypto-currency arbitrage trade, I still consider this mission-accomplished.
I mean, I got to do some cool scraping. I built a Python engine that knows that it is doing. And I made a very tiny amount of paper money in the process.
What more could you ask for. Now, for the rest of my life, I’ll be ready to pounce on the off-chance that someone needs a real-live crypto-currency arbitrage-ur.