I remember a classic MIT problem set in computer science where we reduced the problem of finding a "profitable arbitrage loop" in a directed graph to a shortest path problem: imagine a graph where nodes are currencies and edges are exchange rates: we're seeking to find some loop of nodes U,V,W,...U such that the cumulative product of the edge weights is greater than unity.
The trick is to transform the graph by taking the negative log of the edge weights, which turns problem of finding a cumulative product > 1 into one of finding a negative sum loop. Then, you can just run the Bellman Ford algorithm and if it detects a negative cost cycle in the transformed graph, this corresponds to a positive arbitrage cycle in the original graph.
It's nice to do that to banks that didn't set their trading prices to avoid arbitrage (did it couple of times myself).
For cryptocoins it's nearly impossible. Because in most cases there's no idea when the actual transfer will be executed (if arbitraging between exchanges).
The trick is to have the currencies already there so you dont need to do a transfer (well you will want to do one afterwards to get ready for another round, but it isnt that time sensitive).
That just pushes the problem to the next trade. Even if you diligently keep your accounts funded, you’ll need to rebalance them after most trades (by definition of arbitrage), so your velocity will eventually be limited.
Concretely, imagine if every ten minutes you made an arbitrage buy on GDAX, and sell on BitFinex. As long as GDAX remains the “buy side” of the arbitrage, you will need to keep refilling your fiat funds at GDAX. You could “keep it filled,” but this becomes more unsustainable as you deplete your bankroll. You will eventually need to rebalance which will affect your velocity.
Not entirely true. If you wait for the arbitrage opportunity to occur in the reverse direction, you can rebalance. But you take the risk of waiting days/weeks for a reverse dip opportunity.
Source: I tried to make money arbitraging BTC back in 2015. I made a 2x return, entirely because of inflation, realized I didn't understand anything I was doing and pulled my 8k out. If only I had kept it in :)
Yep, I've tried to do arbitrage on one exchange during dumps (there's quite a lovely way to realize there will be a massive dump done on the exchange) and most of my trades couldn't even execute because the trading engine can't meet the demand.
When you look at the price history (and open orders history) between some pairs on one exchange you'll find that during these spikes there was no arbitrage being done at all.
One example is seeing the price on ETH-BTC pair being constant despite BTC dropping 10-20%, and then combing back in 5-10 minutes.
The elevated chance of an exchange going down in the middle of a crisis is actually a major source of the risk that one needs to take into account when evaluating the expected profitability of arbitrage strategies.
I know the exact exercise you are talking about and about 4 years ago it inspired me to try arbitrage on bitcoin across the exchanges. My hopes were soon dashed when I found out how slow everything in bitcoin processes.
Although I did recently see a more sophisticated example of arbitrage where you have money on all the exchanges at once and then you don't actually do a transfer, but you long on one and short on the other. However, I don't think it would work w/ bitcoin b/c I don't think shorting is much of a thing yet.
While this is true and is efficient in the computational complexity sense, I’ve found in practice it is easier, faster, and qualitatively better to set the problem up as a simple LP. Qualitatively better in the sense that the LP tells you the potential magnitude of the arbitrage cycle, not just its existence, and faster in the sense of actual computed latency.
While transaction costs are easy to model in LPs, transaction clearing times are much harder. To the point where most opportunities are better described as phantasma.
One of the upsides of BTC is that it is supposed to be costless and frictionless to sell across the globe, yet 1k+ arbs exist across exchanges. So much for that argument. Maybe segwit2 will help, or another altcoin will actually remove friction.
When there is a spread between exchanges in the BTC/USD price, doing arbitrage requires requires not only moving bitcoin but also USD in the opposite direction. USD transfers are usually still a lot slower, so the bitcoin transfer speed is not the bottle neck here.
Yes, the general observation about Bitcoin exchanges is that getting USD or EUR out is difficult and slow. Sometimes impossible. It makes one doubt they have the cash they should. Many exchanges in the past haven't survived a downturn and cashout.
Which makes BTC purchased via exchange the Hotel California of Assets. You can check in any time you like but you can't ever leave.
Something is amiss here. Selling BTC to USD should be instantaneous even if cash withdrawal isn't no? Can you not look at the bid/ask and get executed at the bid on these exchanges?
I should be able to buy "cheaply quoted BTC" on Exchange A. Transfer to wallet at "higher quoted BTC" at exchange B, and executed a sale at the bid, even if I can't pull my USD into my actual bank account for a couple days.
Yes, if you have USD on an exchange, you can instantly buy bitcoin, and quickly move it to another exchange, and again instantly sell it there.
The problem is that after this sequence of events, your USD is at the exchange with the higher priced BTC, while you need it at the exchange with the lower priced BTC to repeat the process. This requires moving the USD back via the traditional banking system, which is slow. The bank wires are the bottleneck.
Crypto-Crypto trading pairs don't have this problem, which is why the ETH/BTC spread for example is much smaller. The spread there probably just reflects fees and custodial risks that put a slight break on arbitrage.
Most of the big spreads seem to be caused by cex being much more expensive than the other exchanges... Does that indicate something is happening with cex?
A high price on an exchange is a symptom of problems withdrawing national currency. In order to get around this issue, users will spend their on-exchange national currency by purchasing e.g. bitcoins, and then transfer these to their wallet or to another exchange (where they can sell and withdraw the proceeds). This buying pressure pushes up the price, as measured in national currency.
I guess it doesn't necessarily need to indicate that the exchange is having problems with fiat withdraw, but if they did your scenario could definitely make sense.
I think it could also just indicate a lack of arbitrage being executed that keeps the price in line with other exchanges, meaning as a separate market the price is free to move higher / lower than other markets without necessarily indicating some sort of problem at the exchange. Normally this would be sort of synchronised to some level by arbitrage.
It seems like the arbitrage opportunity here is real and at least someone recently managed to profit ~10% from it:
Although of course it is a bit slow which exposes you to lots of risks, so if you really wanted to do it you would need to hedge your exposure with other types of trades (shorts, etc) to try to limit the amount of risk.
I guess what I am thinking is just it could also be the exchange is operating fine, people are able to withdraw fiat, but it's just not worth the risk / effort to run arbitrage (or people just aren't doing it) and that could at least explain some price difference without there needing to be some sort of systemic problem at the exchange. There of course could be.
Seems like this might at least be a factor, but honestly I don't know what something like that would mean in terms of the impact on pricing on an exchange.
How is this being calculated? In didn't see anything.
- You want to look at the order book, not just the last trade to compare the bid on one against the offer on another venue. The bid-offer spread can be very wide on some of these.
- Fees should be included.
- You still aren't pricing in counterparty risk, the biggest risk in crypto trading.
- I don't see CME and CBOT. The most reliably venues (you can replicate the spot with a multileg trade).
>- I don't see CME and CBOT. The most reliably venues (you can replicate the spot with a multileg trade).
since those are futures, arbitraging them brings a bunch of other problems. mainly, keeping your (futures) account with enough cash to prevent liquidation (if there are drastic price swings). this is easier said than done because a short position requires 100% margin (afaik).
I think you are reading that wrong. Initial margin is 100% to 110% of maintenance margin (44%) depending on how they classify you (almost everybody here is a speculator not hedger).
Current maintenance margin is about $34k on a single contract (5 BTC).
The very large spreads you see here are (usually) caused by some unexpected interruption to the usual stream of arbitrage trades. These unexpected interruptions could be anything from a temporary wallet maintenance to an overloaded exchange not accepting trades for a few minutes to people fleeing an exchange due to insolvency (mt gox). If everything is working correctly, then we might get a wonderful situation where users on one exchange are just going nuts for buying a specific crypto, and then it can be very profitable but also usually short lasting. One example of this was the recent run-up of LTC's price.
When things are running "normally" the arb space is pretty crowded especially amongst crypto-crypto pairs. Things like BTC-USD arbitrage between a USA exchange like GDAX and a Korean exchange are more of a regulatory arbitrage than a trading arbitrage (it takes a lot of work to get set up to trade and withdraw money from Korea to the USA to balance the sell-leg of the arb), so I would ignore those as they are really out of the scope of a HN tech discussion.
I think this site has come up before and I might have commented on it. If you are seeing these spreads and thinking about quitting your day job, don't.
Source: I did quit my day job and paired arbs like this account for about 0% of trading volume we do.
Shameless plug: if you are interested in this stuff feel free to contact me, info should be in my profile.
I saw some blogs theorize that nefarious bots are also increasing apparent spread—e.g. painting the tape on gdax to skim from coinbase cash whales—and so little of the everyday trading activity is human, that if you try to arb it, all of a sudden the spread disappears. It even makes sense that the entity responsible for this website is trying to combat effects like this by driving the spread down. What reasons can you think of for someone to make this website?
GDAX bot activity is all: speculative automated trading, arbitrage, or (and most importantly) coinbase's own activity on the gdax exchange. They have to fill orders for all their customers clicking the buy button on their iphone apps. 100k new customers A DAY were seen at bitstamp, the coinbase app was the #1 app in the appstore, that is a lot of retail buying activity. Those buys are then passed to traders / bots that fill them on the exchange so I get that it looks automated and one-sided.
"if you try to arb it, all of a sudden the spread disappears" - well there's a lot of people trying to do the same thing because they think it is easy money and no one has thought of this great idea of buying LTC on one exchange and selling on GDAX, so when your incoming transfer of LTC completes so do a bunch of other transfers all doing the same arb trade (and those are automated and will beat you in the race).
The blogs you are referring to I do not hold in high esteem. I maintain high levels of doubt about exchanges as a whole and realize the extremely high counterparty risk more than most in the space, but their ideas about painting the tape and nefarious bots are misguided at best.
Most of the reason for the spreads is counterparty risk. So you might have a lot of trouble getting your money out of the exchange or the exchange might go completely under.
You are correct--there is no such thing as "risk free". By convention, we mark our zero point at the risk of sovereign bonds. It is the smallest risk everyone in our economy agrees on a level for. It still contains "risk". But it's a convenient--and practical--reference point.
The analog in Bitcoin would be getting your transaction committed to the blockchain. It's still "risky". (Quantum computers could break the encryption!) But it's a convenient--and practical--zero. (You'll notice the advantage of a currency backed by a debt-like obligation. Interest rates come as a first-class function. There is no "risk free" borrowing rate in Bitcoin.)
Between these zeros, an arbitrage would require, simultaneously, committed transactions on the Bitcoin ledger and immediately-available funds in an FDIC-insured (or analogous, e.g. SIPC) account. That is not something exchange-based trading, which involves depositing U.S. dollars and/or Bitcoins with the exchange in exchange for an IOU, permits.
For whatever reason I always get too tempted and have to jump into these crypto-arbitrage posts that appear on here about twice a month.
This is by far the most informed reply I've seen in all those threads I've read.
Especially wanted to highlight the last two sentences: there is no way to do risk-free arb in crypto due to counter party risk with exchanges. Even if it might seem small, it isn't small! The opportunity size, scale, roi, etc need to outweigh that risk and (despite playing in this sandbox which I guess makes me a hypocrite but w/e, just trying to help...) I don't think it is worth it right now.
That’s actually a bit of a loaded argument... we assert that all arbitrage profit must be at least counterbalanced by various kinds of risk (including liquidity risk, counterparts risk, & cetera) because we're assuming that we're operating in an efficient market. We should actually reason the opposite way around: analytically evaluate all sources of risk, compare it to the expected profit, and if the latter is no greater than the former, deduce that we are in an efficient market.
You don't get killed by transaction fees. Some exchanges have withdraw limits. Some exchanges have withdraw fees (but they are flat). Your market/limit orders may also have fees, percentage fees, so those are to look out for, but when arbitrage opportunities are around the 5% range, it's moot. I think what kills you is the time that it takes to balance your accounts between exchanges. You can make one arbitrage execution, and have to wait 30 minutes up to an entire day, before you can rinse and repeat, assuming the spread still exists by then. Scripts should really help here.
LTC is often higher on GDAX than most other exchanges and the coin takes about 15-20 minutes to send. Sending Bitcoin back can take a while but that has more to do with GDAX/Coinbase actually posting your transaction to the blockchain than Bitcoin itself (though, yes, Bitcoin transactions themselves can take a while). The longest I've had to wait was 8 hours total. But 5-10% profit in 8 hours is, um, pretty good.
The last time I did this about a week or 2 ago, there was an 8% difference between GDAX and Bittrex. At the end of it, after fees and all that, I made 6%.
Stupid question: what about doing more limited, "pseudo arbitrage"? Where you just maintain balances in USD and cryptocurrencies on each exchange and "buy low sell high" without actually completing the loop, and only later even out your balances across exchanges until you're ahead?
That is, if LTC is higher on exchange A than B, then you buy all you can on B and sell on A. You've made free money, but aren't strictly better than before because you have a different allocation across exchanges. But then you can later do a slow transfer that evens them out.
That requires holding a balance of LTC on different exchanges which is great if you really like LTC but personally I don't since you can't really trade that much with it other than BTC and USDT/EUR. Ethereum on the other hand has a ton of trading pairs on many exchanges so I would consider your strategy with it. Only issue is, arbitrage opportunities with Ethereum come around a lot less often than with LTC so I'm unlikely to hold ETH just waiting for that. To make a long story short, my base currency for trading is BTC so that's what I like to hodl. When an opportunity for arbitrage comes up, I take my chances buying, transferring to another exchange, selling, then transferring the BTC back. Successful trading is predicated on the probabilities being in your favor and a >5% arbitrage spread, usually (not always) works out. At least it works out enough to make it worth your while.
In that case, then yes, it is a good strategy. Find a currency you like holding and have some of it on as many exchanges as you want. When the price gets out of whack, sell on one exchange and buy on the other. Square up when it's convenient.
The trick is to transform the graph by taking the negative log of the edge weights, which turns problem of finding a cumulative product > 1 into one of finding a negative sum loop. Then, you can just run the Bellman Ford algorithm and if it detects a negative cost cycle in the transformed graph, this corresponds to a positive arbitrage cycle in the original graph.
I always thought that was a neat application.