Arbitrage is taking advantage of the price difference between identical assets but in two different markets. Cryptocurrency arbitrage is fundamentally no different than other asset types and in this article, I will show you how I was able to achieve a 1 % profit an hour with nothing more than a hundred bucks in cryptocurrency and a little programming knowledge.



Understanding Arbitrage Trading

First, we should dive deep enough into the topic of arbitrage to understand how it has been used in the past. We also need to know how we might be able to map it to something relevant to us crypto-obsessed people. In the most basic sense, you are buying some assets in one place and then selling it for a slightly higher price somewhere else. So the general idea is pretty simple.

Let us imagine that you’ve just noticed that in one part of town the price of something like apples is higher in one market than at another. If the apples cost $1 in market A and you take them to the market B before it closes where they cost $2 and you are able to sell them, then your profit is the difference between the prices. So: $2 – $1 = 100% profit minus any overhead costs like transportation and taxes, of course.

Beyond the simple definition

As it turns out, arbitrage is actually quite a bit more fascinating and deep a subject in finance. In fact, there are many different types and theories as to how or even if it’s possible. In the example we just gave, that’s a type of arbitrage called Spatial Arbitrage, which is taking advantage of the price differences between two locations.

This is typically what people mean by arbitrage. It’s buying assets in one location and usually physically taking them to another location to sell them there. Although this may be what you think of when you think of arbitrage it is just one of the types. Other kinds of arbitrage do not involve selling the exact same assets per se or in a direct sense.

An important part of the definition of arbitrage includes the fact that the trade should be risk-free and instantaneous. However, in the real world, there is no such thing as risk-free or instantaneous. There are always risks in any type of trading or investing. So we will settle for low-risk and fast.

Conditions for Arbitrage

According to modern thought, if at least one of these conditions is true, arbitrage is likely possible.

The same asset is traded at different prices in different markets.

Two assets, such as stocks, with the same cash flow, are not trading at the same price.

When an asset has some known future price but does not trade at that price.

Types of arbitrage

Here are some of the arbitrage types that would be common in the cryptocurrency space.

Spatial/Geographical

Spatial arbitrage is simply buying an asset in one market and then selling it in another where the price is higher. And in most definitions, this includes moving it in “digital space” from one online exchange to another.

Cross-border

Like spatial arbitrage, cross-border arbitrage involves selling the asset in different locations. But specifically in different countries across borders where there may be a price difference.

Statistical arbitrage

Or “stat arbitrage” means identifying statistical arbitrage opportunities using mathematical models.

Triangular arbitrage

Triangular arbitrage usually refers to an arbitrage opportunity that involves price variations at three exchanges for foreign currencies.

Are markets efficient?

Many investors, traders, and economists believe in the efficient-market hypothesis. This is a hypothesis that at any given point in time the market prices of assets are accurately reflecting all available information.

The implications with this hypothesis include:

It is impossible to beat the market.

Assets are always fairly priced and only change when new information becomes available.

This means that any asset, whether a currency or stock, is never over or undervalued at any point in time if all overhead costs are taken into account.

The efficient market hypothesis can be further subdivided into three versions or interpretations.

Strong Efficiency

All asset prices are a perfect reflection of both public and private information. Therefore the asset’s price is always equal to its true or intrinsic value. There is no way to beat the market via strategy. Only being lucky can produce above-average returns as this version of the theory predicts that there is a normal distribution of returns for investors.

The idea here is that even if all the market participants don’t have all the information about an asset like a stock, that as long as some participants do have that information they will act on it in a rational way and buy or sell the stock, which then affects the price of it accordingly.

This is ironically and arguably the weakest form of the hypothesis. Becuase the research and empirical evidence seem to suggest that this isn’t the case as the value of assets, like stocks and especially cryptocurrencies, can fluctuate wildly in short periods of time. Even without new and important information being widely disseminated into the market. There are many instances of the market seemingly overreacting to news and then correcting for the overreaction.

Also, it’s impossible for markets to always be an accurate reflection of information. This is due to the fact that information takes time to propagate in any system or network like a market. Traders need to eat and sleep and certain markets only trade during certain hours. So it seems rather doubtful that the strong form is accurate.

Semi-strong-form Efficiency

The semi-strong form is similar to the strong form. But it is limited to all public information rather than all the information available. It also gives more wiggle room and time for information propagation. Although prices do adjust very rapidly to information.

This version suggests that neither of the most common trading strategies (fundamental and technical analysis) will give investors or traders any advantage in the market. Essentially, the only way to get an advantage is to have insider knowledge. But of course, that’s illegal in most places.

Weak-form Efficiency

The weak form says that asset prices are random and not influenced by the prices in the past. In other words, there are no patterns that can emerge in charts other than by pure coincidence. Therefore technical analysis doesn’t work.

The weak form has no room for the idea of price momentum which says that previous price movements affect future prices. Although it does allow room for some fundamental analysis to allow investors to potentially beat the market and make wise investment decisions.

Law of One Price

In the context of arbitrage, it would seem that the semi-strong form of the efficient market hypothesis is probably the more accurate version. That’s because different arbitrage opportunities do arise in markets but generally don’t last for long periods of time if the strategy is actually profitable. It is believed that arbitrage is generally good as it makes the market more efficient. Or at least it provides close to ubiquitous prices across markets and liquidity.

The Law of One Price says that identical goods sold in any location should be the same price if you control for the costs of overhead like transportation. Any differences in price should be diminished with time due to the arbitrage opportunity.

Arbitrage and demand

Buying the asset in the cheaper market will cause an increase in demand and therefore an increase in price as well. Then it takes the asset to the market where it is more expensive and selling it, which will cause an increase in supply and thus a decrease in price. Doing this repeatedly will cause the prices in both markets to converge to roughly the same. Or at least eliminate the profit taking opportunities.

The prices may not precisely converge because the risks and/or cost of moving the asset from one market to the other might outweigh the profit that can be made on average. And so the market enters a state called the arbitrage-free or no-arbitrage condition. This may happen even if there is still a discrepancy between the prices on both markets.

Is arbitrage legal?

Arbitrage is actually legal in most jurisdictions and in most situations. This is despite the negative connotations the word might have in popular culture. This negativity may have partially come about as a result of the drama film starring Richard Gere called, “Arbitrage”.

It’s usually legal because the arbitrageur is fundamentally a market maker. Market makers are generally encouraged in most free markets as they help to provide liquidity in by increasing overall transaction volume. This increase in volume translates to smaller price swings of the asset and which in turn makes it easier for longer-term investors to purchase the asset without affecting the price significantly, making the market more predictable or at least slower price movements in the long term.

Low liquidity is one of the biggest issues with the cryptocurrency market in general, which we could then arguably infer that this translates to lots of opportunity for arbitrage.

Historical examples

Arbitrage is probably as old as trade itself. There is some evidence of arbitrage in the middle east in ancient times. Spatial or geographic arbitrage with merchant networks was common. Th ey often traveled long distances to many locations with varying local currencies. These merchants would often share information about prices of goods in different locations, which helped them to identify good arbitrage opportunities along the trade routes.

In the Mediterranean around 400 BC, there was an increase in arbitrage opportunities among money changers due to Persia using a bimetallic coinage system. This system offset the value of silver relative to gold causing an increase in exports to Greece and arbitrage activity.

Academic thoughts on arbitrage

Much like the Efficient Market Hypothesis itself, there are multiple camps to the idea of arbitrage which are extensions of the EMH.

The first camp is weak no-arbitrage, which says that arbitrage is rare but not impossible. Generally, opportunities can be found where there is low liquidity in an asset or market.

The second camp is strong no-arbitrage, which says that under no circumstances is arbitrage actually possible. If you do somehow make a profit it’s because of dumb luck and market fluctuations and not real arbitrage. If you were to try a strategy enough times, you would find its no more profitable than random buying and selling of an asset. This view of arbitrage is consistent with the efficient market hypothesis. It also assumes markets are always perfectly efficient.

Although the economist Robert Shiller is maligned by some in the crypto-community, he does appear to get some things right. He is the author of the book “Irrational Exuberance” whose title has entered the common parlance to describe market bubbles. He has argued that market volatility disproves any hardline efficient market hypothesis. In essence, people are too irrational and there are too many dynamic factors at play in markets for them to be truly efficient .

This should give us some hope that we can exploit these inefficiencies to our profit.

Finding the arbitrage opportunity

In the brief history of cryptocurrency, there have been periods of time which produced cross border arbitrage opportunities. This was most notably seen in places like India, which had periods of time with a 30% premium or more compared to the global average on Bitcoin and other cryptocurrencies. But this might be caused by the friction and crypto bans Indian banks have put on cryptocurrency.

A paper from the University of Calgary highlights the potential arbitrage opportunities in Korean bitcoin markets, which is colloquially called the “Kimchi Premium”.

The paper showed that the average premium was about 4% from 2016 to 2018. At times, the premium was as high as 54%. The study identifies two main causes of the premium; capital controls and friction caused by the Bitcoin network itself (transaction speed and fees).

This type of arbitrage is likely a lot more difficult to exploit. It would come down to knowing the more intricate details of the financial system in your area. So it’s something beyond the scope of this article, but worth looking into if you are interested in arbitrage.

Verdict on the Kimchi premium

With that said, the study concluded that cryptocurrency arbitrage is not likely possible. At least arbitrage on the Kimchi premium:

“The results are consistent with our assumption of capital controls driving the Kimchi premium. If one of the other crypto currencies had no premium or a lower premium than Bitcoin arbitrageurs could use that currency to move funds out of Korea and complete the arbitrage. Since cryptocurrencies are not subject to capital controls no arbitrage opportunities between cryptocurrencies should be possible…“

and further saying:

“The analysis shows that the Kimchi premium is therefore not something unique to Bitcoin but rather a result of Korea’s capital controls that prevent arbitrageurs from aligning Korean prices with those of the world market“

Despite this, there are plenty of traders in all kinds of markets who claim to make a profit out of arbitrage strategies. So if we continue with the hope that there still might be an opportunity in the market for us to make money, let’s look at what steps might be necessary.

Arbitrage strategy

The spread of an arbitrage trade is defined as:

Bid(exchange A) - Ask(exchange B) = Spread

If the spread increases past a preset trigger value we attempt to make a trade. The trigger value should be some specific number, ideally derived from some kind of risk analysis that takes into account market volatility, exchange fees, past trade attempts, etc.

Most arbitrage strategies require holding sums of both assets on both markets and simultaneously buying and selling respectively. The reasoning here is that it is a risk-free trade because it happens nearly instantly. However in the case of cryptocurrency, you can argue that this would not be risk-free. This is because cryptocurrencies are so volatile. Holding them indefinitely during trading time waiting for arbitrage opportunities could offset trading profits by a substantial margin. This is also called “price risk”.

So in outlining our strategy here, we will use more of the typical spatial arbitrage. This involves actually sending the asset from one market to another. With the information here you could adapt it to be one of the other types of strategies to your liking.

Identifying market inefficiencies

It will be logistically unlikely that you will be able to have a very profitable trading strategy of any kind without writing some scripts or bots. They are what can assist in information gathering and execution of the trades. This is especially true with arbitrage since you need to make the trades as fast as possible. Basically, it’s how many trading strategies in the modern world work. So if you are serious about it, it is advisable to learn how to program or use advanced pre-made trading software.

In order to find our market inefficiencies, we can’t waste large amounts of time searching multiple pairs of currencies and multiple exchanges by hand. It could take hours and we probably wouldn’t be able to find them fast enough to actually act on them.

Aside from the normal arbitrage conditions stated earlier, with cryptocurrency trading, we will need an additional set of criteria and heuristics. That’s how we’ll know if an arbitrage trade will be possible.

Exchange trading fees must be low for things to be profitable.

If the trade is spatial arbitrage, the asset being transferred should be fast. This will be determined by the speed of the blockchain, TX fees, and the minimum amount of confirmations the exchange requires before debiting your account for the trading of the asset. This will vary drastically depending on the exchanges you use, the fees set, and the blockchain you are using.

The volume must be sufficient (mitigate volatility price risk). If the volume is insufficient, then you could risk being stuck bag holding more of the asset than you would want as a market maker.

Gathering Data

Now let’s gather some data. One of the most common sources for price data is CoinMarketCap.com. It is one of the first exchange prices aggregating websites in crypto and has over 2000 crypto assets listed.

You can use the CoinMarketCap API (if you are familiar with programming). However, the free version has limited functionality. Instead, we will use the API from CoinGecko.com which is also a good source for price information. Lucky for us, it has well-maintained API wrappers in several languages. Plus it’s close to the same amount of coins and exchanges listed on their website.

Or to follow along, you can go to coinmarketcap.com and click on the currency you would like to do arbitrage on. Then press the exchange tab and click “sort by price” to see if there are any major differences. It should look something like this.

Getting started with Python API

We will be using the Python API here (see GitHub repo for installation instructions).

Here is a short script containing only 3 functions that use the Coingecko API. What it does is essentially the same thing that we would have to do manually if we were searching for arbitrage opportunities in the markets. It checks all the markets for a given coin or token. Then it looks at the current prices on the exchanges where it’s listed and returns a sorted list of the spread of each coin.

Next, it takes the highest price and lowest price, finds the absolute difference, and returns that as a percentage.

So if the going rate for a Bitcoin on an exchange is $1.00 and on another it is $1.10, then our function would return the spread of 10%. The bigger the spread the more profit potential because the spread is your profit (minus trading and transaction fees.)

Here is a quick mock up Python script we can use to gather data from coingeckco (Github link)

#!/usr/bin/env python3 import requests from pycoingecko import CoinGeckoAPI import operator import random def get_coin_pair_data(exclude=[], include=[]): cg = CoinGeckoAPI() coins = cg.get_coins_list() random.shuffle(coins) coin_data = [] for coin in coins: try: market_data = cg.get_coin_by_id(coin['id'])['tickers'] pairs_data = [] for i in market_data: market = i['market']['name'] price = float(i['converted_last']['usd']) volume = float(i['converted_volume']['usd']) info = {'market': market, 'price': price, 'target': i['target'], 'volume': volume } if len(include) == 0: if market not in exclude: pairs_data.append(info) else: if market in include: pairs_data.append(info) coin_data.append({'name': i['base'], 'market data': pairs_data}) except: continue return (coin_data) def coins_by_spread(coins, min_volume=5000): coins_spread = [] for coin in coins: prices = [] for m in coin['market data']: vol = m['volume'] if vol >= min_volume: prices.append(m['price']) if len(prices) > 1: spread = ((max(prices) - min(prices)) / min(prices)) * 100 coins_spread.append({'name': coin['name'], 'spread': spread}) coins_spread.sort(key=operator.itemgetter('spread')) return (coins_spread) def get_coins_with_spread(min_spread=0.01): exchanges = ['Bibox', 'Huobi Global', 'Poloniex', 'Kraken', 'Kucoin', 'Bittrex', 'Binance', 'HitBTC', 'Upbit', 'Coineal' ] coins = get_coin_pair_data(include=exhanges) coins = coins_by_spread(coins) return (coins) def main(): coins_spread = get_coins_with_spread() for coin in coins_spread: spread = 'spread: ' + str(coin['spread'])[:4] + '%' print (coin['name'], spread) if __name__ == "__main__": main()

And if we run this script it outputs something like this:

BOT spread: 5.39% PRG spread: 5.49% PMA spread: 9.26% CLOAK spread: 14.2%

So most of the spread is tiny, but in some cases, it is around 5-10%. However, that’s usually just because of extreme low liquidity. So we will have to manually check these pairs.

Dangers of cryptocurrency arbitrage

In my first attempt just going on this information, I saw that Bytom had a spread of nearly 30% and just enough volume between HitBTC and Kucoin to make the trade possible. The trade was almost too good to be true, 30% in just minutes? No way!

So I hurried as fast as I could before the other traders would exploit this trade and sent 20 bucks worth of Bitcoin to HitBTC. Then I placed a limit buy order for BTM and then went to withdraw and send to Kucoin .

BTM withdraws deactivated…

This may explain why there was such a large spread. And also why no one had exploited this opportunity already. If it’s too good to be true, it probably is. Perhaps markets are efficient and the difference in prices on the two exchanges was simply the discounted, risk-adjusted cost. Often when a coin on an exchange has its wallets disabled, the market can view it as a risk because it could be happening for a number of reasons ranging from exchange insolvency, a hack of the blockchain or token, or a simple technical issue.

It’s possible that buying and holding the BTM, in this case, would pay off. That is if the wallet got reactivated shortly. But the maintenance page of HitBTC didn’t give much useful information. So it would be a role of the dice and definitely a gamble, which does not satisfy the criteria of “true arbitrage” which must have really low risk. Market volatility could easily wipe out these gains if you had to wait days or even hours.

I found a few other examples of a large spread which also happened to have wallets that were in maintenance mode. So this seems to be a common false positive that we should look out for. However, if you are a risk taker, maybe it could also be an opportunity to profit as the price should correct as soon as the wallets go out of maintenance mode.

A different approach

So it appears that simply taking the spot price might be insufficient. I spent some time looking for opportunities based purely on the spot prices and they were few and far between. I suspect most of the time there were similar issues with the trade that might not be immediately obvious until you actually try to execute it. For instance, such as transaction time or risk similar to that we see in other markets with large price differences, such as the Korea cryptocurrency markets I mentioned earlier.

Intra-exchange arbitrage trading

So let’s try something else. Instead of spot prices, let’s try a statistical approach and look at frequent or average arbitrage opportunities to see if there are particular pairs that often have low liquidity in which we can fill a niche as a market maker.

We are going to first look for arbitrage opportunities within an exchange between an asset with several pairs. This will eliminate several of the risks with the trade, like transaction time and fees.

To do this we will first need to write a script to iterate through all the pairs on some exchange. In this example, we will use the public Bittrex API. Our script will not only iterate , but also produce some graphs. So we can quickly get an idea of what’s going on with the data.

Here is one output graph from our new script (Github code)

This shows us the prices converted to USD of the different pairs. On the bottom of the graph in orange you can see the size of the price difference.

Note: It appears the spread is greatest during times of higher volatility. This makes sense since it’s hard for the market to predict volatility or fast price changes in advance. This could then cause the markets to have differences in efficiency, leaving us with opportunities for arbitrage.

The graph also gives us a percentage of the average spread right beside the currencies name at the bottom.

The liquidity problem

However, notice a major problem and that’s liquidity. Here is a graph with the highest spread out of all the pairs our script analyzes.

Siacoin has an average of an 18% difference between the highest and lowest trading pairs on Bittrex, but the sharp edges give us a clue that something is off here. This was the USD pair which only has about $125 volume over the past 24 hours. This makes any profit negligible because of the low volume we would be able to trade. But at scale, it might be profitable (more on that later on).

Let’s look at different but high spread cryptocurrency and see if we can find a better balance.

On Bittrex, trading fees are 0.25%. Because it would take us 3 trades to successfully execute this type of arbitrage, the spread would, therefore, need to be greater than 0.75%. The USD pair has only about $1000 of 24hr trade volume and the BTC pair has about $90,000.

Even if we are generous and say that we can capture 10% of that trade volume on the USD pair every day, and that we are successful with every arbitrage attempt, then even with a nice 1.56% profit we would only be making a buck and a half every day on this pair. But our profit would probably be a lot less than that due to market volatility and other risks.

It gets worse

It’s worse than that. Because it’s not clear that doing this complicated arbitrage with 3 pairs is any better than traditional market making . If there is a consistent spread on the KMD/USD pair between bids and asks, why not just trade the difference?

This doesn’t look good for those of us trying to make a profit from intra-exchange triangular arbitrage. Virtually all the pairs with an average spread greater than 0.75% have very low liquidity, making the profit very low.

Currently, there are about 40 pairs with a large enough spread to potentially cover our trading fees. So even if we wrote a program to do the trading automatically and luck was always in our favor, we would only be making about $30-60 a day. But I suppose that’s better than nothing.

Maybe no-arbitrage is right and there is no free lunch. However arbitrage does still appear to be possible, just very very unprofitable. So let’s keep looking at other avenues.

Inter-exchange arbitrage

Instead of trading solely Bittrex pairs, we will adapt our script to find the biggest spread between Bittrex and Binance . There is no reason why we can’t do this with any other pair of exchanges. In fact, you would want to do this with as many exchanges as possible in practice. Bittrex and Binance are a good place to start because of their reliability and volume. (Github code)

Ethereum classic has a large spread at times, so this is just one of the pairs that our script produces.

Trying with inter-exchange

My first inter-exchange attempt I saw a large spread with Zcoin. I bought it on Bittrex and then quickly sent it to Binance . But I didn’t do my due diligence. Turns out it took 90 minutes to confirm the deposit. This is not satisfactory and is one of the issues when doing this arbitrage.

So I tried a different cryptocurrency, a fast one; Stellar Lumens. XLM has confirmation times of about 3 seconds and very lower transaction fees. This was the first successful arbitrage attempt.

Profits

XLM/ETH (Binance) -> XLM/BTC (Bittrex)

Profit ≈ 1% - 0.25% (Bittrex trading fee) - 0.1% (network fee) - 0.1% (Binance trading fee) Net profit ≈ 0.55%

Using the information from our script I was able to manually perform this type of trade a few more times, with an average time of about 20 minutes from entry to exit getting a total of about 1% profit in an hour!

Although there was a big catch. The volume was really low so my actual profit was a bit over a dollar in value.

Such a small profit, why should I care?

In fact, this is quite a lot of profit and makes things look much more promising for arbitrage being possible and profitable. Mostly because of the fact that this is scalable. We will definitely be limited by liquidity and our capital available to trade, but there is no reason why we couldn’t completely automate this process increasing the frequency we are doing it with and also doing this across many different exchanges and many different pairs simultaneously.

It might even be possible to do cryptocurrency aribtrage with hundreds of pairs at the same time. This could equate to hundreds of dollars an hour, which isn’t bad considering you aren’t doing much. It just would take some overhead in developing all of the API interfaces and code.

However, I would still be skeptical about how profitable this is in the long term. Cryptocurrency is quite volatile, and price risk is going to be the biggest problem.

Summary of cryptocurrency arbitrage

Formulate your strategy

Do your best analysis for determining risks and P/L ratios for your strategies. Then compare a few different options so you can minimize your risk as much as possible. Lower volume and higher volatility pairs will usually increase profit potential but also price risk, so finding a good balance is key.

More than likely, even if you are trying any of the various other arbitrage strategies, you will likely need to follow the basic steps outlined here. It will probably need some form of automation to be profitable. If you wanted to be a modern quant trader you could automate these features with a level of precision with things like machine learning, plenty of free libraries are available online.

Build a bot

Gather data on price via exchange APIs and price aggregators such as Coinmarketcap.com and Coingecko.com

Sort and clean the data to give you the most likely arbitrage opportunities.

Fully automate the trading logic to reduce the time per entry and exit of the trade. (This can be done with most exchange APIs)

Scale the strategy (and software) to include as many exchanges and pairs as possible, increasing your optionality.

Mitigate risks

Estimate fees from trading and transferring to make sure that the price spread is profitable.

Verify that liquidity will be high enough for the size of your trade on all pairs

If you are doing inter-exchange arbitrage check that the network fees and transaction time of the coin you are transferring are taken into account. WARNING: many exchanges will have withdrawal fees that are higher than the actual blockchain fees and often require more confirmations than most wallets.

Make sure your data feeds are clean! Many anomalies can occur in real-world data collection and could cause catastrophic errors especially if you completely automate your trading.

Conclusion

It appears that arbitrage might be possible in the crypto markets. Just with low profitability and potentially large fat tail risks. For me personally, I’ll stick to the conservative strategy, play the long game and HODL .

Developing a cryptocurrency arbitrage strategy that works will be quite complicated, requiring a lot of work and likely technical expertise. Unless of course you are really lucky and happen to be in a unique position to do cross-border arbitrage and sell cryptocurrency locally at higher prices than the global average. Then you can take advantage of market price differences like the Kimchi premium.

Disclaimer

This is purely educational and an exploration into the topic of cryptocurrency arbitrage. It is by no means any sort of financial advice. Trade at your own risk.