Tuesday, January 02, 2018

Cryptocurrency Arbitrage Tool - v 2.0

Happy New Year!

I was discussing crypto (among other things) with my family this past holiday and amongst the "It's a bubble" and "What about IOTA?" chatter, I had some interesting conversations about volatility.

While volatility is, on its surface, a concern for people new to Bitcoin and other digital currencies, it is manageable. Whether you want to manage it is another question entirely since, for anyone looking at volatility of any period over the past year longer than about 6 days, the direction of the volatility is UP.

But let's be honest, the trade between fiat currencies and cryptocurrencies is in its infancy.  5 years ago, there was one coin.  It's managed to stay at the top of a heap of over 1500 coins and tokens today.

BTC's price recently fell about 35% in 2 days.  This was called a "correction", but I tend to disagree.


Perhaps at the velocity of cryptocurrency markets, this is a correction, but to my mind, a correction lasts.  This is normal respiration after the injection of the second wave of investment, which started in Asia and now includes institutional investors.  While bitcoin is the most established cryptocurrency in the world, it's markets are still inefficient and liquidity is affected by everything from zealotry (HODL!) to technical setbacks (2X) and hacks (Mt. Gox) that drive enormous amounts of bitcoin off the market and into cold storage.

It's the inefficiency that we can leverage to mitigate the volatility.

As I write, I note that the price of bitcoin on two commonly used North American exchanges is

13780.40 (at Kraken) and  13571.38 at Gemini.

This is over 1.5% difference in price for the exact same trade.

It so happens that Kraken allows margin trading and Gemini credits cash deposits instantly, so if one had a small amount of BTC at Kraken, a range of options is presented.

Cash neutral trade:

  1. Deposit $500 with Gemini
  2. Place limit BUY order on Gemini for $500 worth of Bitcoin @ 13571.37 and offsetting SELL order on Kraken for $500 worth of Bitcoin @ 13780.41.
  3. These trades should close very quickly resulting in the following changes to accounts:
Gemini USD balance -500, Kraken USD balance +500
Gemini BTC balance +.036842, Kraken BTC balance -.036283

This is a net gain of.000569 BTC

If I'm relying on instant deposits, I must remember to transfer the $500 cash balance out of Kraken to offset what I put in at Gemini.

Likewise, I can make the transaction BTC neutral by setting my quantities at .036283 BTC, which would leave me even in BTC and with a cash profit of roughly $7.50.  It doesn't seem like much, but it's not uncommon to see divergences of 3-5%, especially when tracking multiple exchanges and currencies and these divergences tend to be larger during high volatility periods.

There are important considerations:

TRADING Fees:

Depositing and withdrawing fiat currency (USD) to/from exchanges generally costs money.  Here is how to save:
ACH deposits up to $500 per day at Gemini are free.  Withdrawals are also free.
ACH deposits to GDAX are no instant, but are also free.

Trading incurs a fee.  On Gemini and GDAX, this fee can be avoided buy using LIMIT orders.  Limit orders mean that you are placing an order with your coins or dollars at a set price that is out of the money.  You are, in essence, contributing liquidity by tying up your assets.  When orders close, there is generally a "maker" and a "taker".  The maker is the side of the transaction that set a price out of the money (a sell order above market, for instance). A taker is an order that matches instantly with the market rate (generally a market order or "in the money" limit order). Trading fees are generally assigned to the taker (or are higher for takers than makers on Kraken).

NETWORK Fees:

Network Transaction Fees are incurred when you withdraw cryptocurrency from an exchange (or, more generally, whenever you send cryptocurrency). For most cryptocurrencies, these fees are quite low--on the order of pennies per transaction regardless of size, but in the case of BTC, they have become so high due to network congestion that it really makes no sense to withdraw $500 worth of bitcoin. The fee may be as high as $40.  Bitcoin transactions are also quite slow relative to other currencies.

Note that transactions within an exchange do not incur a network fee.

Avoiding Network (also known as "Miner") fees is a separate topic, but note that you can trade BTC for any currency supported on the exchange (e.g., buy ETH/BTC) and incur only a trading fee (again, try to use limit orders). This currency can then be transferred and converted back or held in cold storage.

So, I generally don't look at any arbitrage transactions that do not have a margin of at least 1.5%. The idea is to make money, not spend it all on fees.  

When I'm actively trading, I try to make 5-10 arbitrage trades in a session. Ideally, arbitrage transactions are always profitable as they capitalize on instant differences between exchanges and/or currencies.  So, when things were going crazy last week, I executed 23 trades that averaged $1433 in dollar size and averaged 3.623% in returns. 16 were "cash neutral", 7 were "coin neutral". I rebalanced accounts several times, including 2 BTC transfers which resulted in $76 in mining fees (crazy).  I managed also to pay approximately $230.72 in trading fees, some of which was due to my own poor execution. So I netted over $887 in less than a holiday week while the market was generally headed down. I increased both my cash accounts and my crypto holdings during that period, all without risking a penny of additional cash.

BTC took a drubbing last week and eventually came to "rest" around $13400 (but not before sinking to under $11000). The horizontal phase we're in now may be the start of a bull market or it may just be a breather after a month of unsustainable growth. We've seen what amounts to 2 "dead cat bounces".  Usually, we would expect 3, so I expect to trade another week in the 12-14K range before we see what direction we'll be moving in.

If you're interested in Cryptocurrency Arbitrage, I created an excel-based tool last May that helps analyze prices of a handful of currencies across 2 North American exchanges.  Since that time, I've been inundated with requests to expand the tool to cover more exchanges and currencies.  Since Gemini and Coinbase/GDAX are fairly limited in their offerings, real arbitrage opportunities are also limited.  Coinbase has since added Bitcoin Cash (BCH) and it seems to have solid volume.  I've added these assets and the Kraken exchange, which has more than doubled the opportunity landscape.


As always, the tool is provided "as-is" and without support. You are free to modify and reshare as long as you provide a link to this blog and credit me with original development.  I've used the native public APIs for each of the exchanges (Gemini, GDAX/Coinbase, and Kraken).  The color coding takes into account expected fees of 1.5%, so don't trade the reds and yellows.

You'll need to download the spreadsheet and run in Excel. It doesn't work in Google Docs. You don't need accounts on any of the exchanges to use the tool. It uses the public APIs.

You can download the tool here:

Cryptocurrency Arbitrage Tool

Happy Trading!

DT