top | item 13889608

Bitcoin arbitrage without market risk

138 points| butor | 9 years ago |github.com | reply

77 comments

order
[+] Animats|9 years ago|reply
All the US dollar exchanges with substantial volume are within 1% of each other. [1] Some of the little guys are a few points out there, but any significant order would blow the price. All the exchanges lock together within the range of the cost of trading, which is usually at least 1% when you combine buying, selling, short-selling loan, blockchain reward, and cash withdrawal fees.

[1] http://bitcoincharts.com/markets/currency/USD.html

[+] Veratyr|9 years ago|reply
They are right now but this isn't always the case. For example you can see just from that page that in the past 24h, Kraken reached a low of 1025 while Bitstamp only reached a low of 1118, a difference of 9%. If at that low, you'd bought BTC on Kraken and sold BTC on Bitstamp, you would have made that 9% difference.

This is the point of the strategy. Whenever they diverge for whatever reason, assume it's temporary and that they'll reconverge. Make money converging them.

[+] comboy|9 years ago|reply
I think I may have a better visualization for that [1]. But I definitely agree. Differences in prices come from fees and how hard and expensive it is to get cash from one exchange to another. Plus most exchanges offer preferential fees for bigger players so when you are just starting you are already at disadvantage.

One need to also consider order books not just the price difference (I also have a chart! [2]). Price difference may be 10% but there may be 0.01BTC in order book within that difference. Or if you just look at the price of the last trade, there may actually be nothing in order book to arbitrage against.

There may be some window to make money when there are really big price changes and basically those who do the arbitrage run out of money on one side (fiat is slow to move). But then you have to deal with high volatility.

1. https://data.bitcoinity.org/markets/arbitrage/USD

2. https://data.bitcoinity.org/markets/books/USD

[+] ns8sl|9 years ago|reply
Historically, exchanges that are failing have significant spreads from stable exchanges (Mt. Gox comes to mind).

So, there is risk with this strategy. One of the exchanges could fail and you lose everything you have on that exchange.

[+] butor|9 years ago|reply
This is correct. That's why I specified market risk. Of course not all the risks are overcome.
[+] lz400|9 years ago|reply
Are you eliminating execution risk? with these exchanges and this liquidity I wouldn't be surprised if your algo slips and actually loses money on the attempted executions on the arbitrage prices. Isn't that too dangerous to claim you've eliminated "market risk"?
[+] Taek|9 years ago|reply
Some exchanges are going to be more permanently divergent. Does the software handle this well?

An exchange can be permanently cheaper if withdrawals are limited, trust is lower, or some other effect reduces trader confidence in the exchange.

Major events like hacks are also imo likely to cause this software to stumble. Are there safety features to make sure it'll stop trading if something sufficiently unusual is happening?

[+] butor|9 years ago|reply
You're absolutely right: some exchanges are systematically divergent. It has been the case with BTC-e for a long time. This is not natively handled by the software.

The long/short mechanism overcomes the market risk (i.e. risk of losing money due to market moves) and reduces the slippage risk, but not the other risks, like technical issues on an exchange.

[+] t3soro|9 years ago|reply
The reason this doesn't profit is because the spread tends not to exceed the difference in exchange fees. So while there may be a $1 spread between two exchanges, the sum total of two 0.5% exchange fees on a $1000 coin will only net the exchange profits in fees, and you might earn a penny.
[+] matt_wulfeck|9 years ago|reply
I always wondered who might be doing this. I never expected to see an open-source tool, since it introduces immediate competition.
[+] ng12|9 years ago|reply
Yeah I don't understand -- if it works well wouldn't it be better to keep it to yourself?
[+] garethsprice|9 years ago|reply
Cool to see a project like this open-sourced regardless of it's profitability, fintech/trading is usually such a black box.

Are there any other examples of trading systems like this that are good to read for someone with a passing interest in building simple trading systems?

[+] t3soro|9 years ago|reply
It would be dangerous to run this open source code, also, since your program could be manipulated with precision timing attacks, if it were to be fooled into making a bid at a price flash. There is in fact plenty of technical risk. Caveat emptor!
[+] omgam|9 years ago|reply
This is basically how many closed source Bitcoin trading robots operate. They create giant waves of predictable trades because naive operators leave the default parameters for trading signals. Other traders just get in (and out) right before the robots.
[+] reckoner2|9 years ago|reply
When building an automated trading system the first thing you write should be the risk system. Simply having a 'MaxExposure' per exchange doesn't cut it.

This has nothing to do with it being a market-neutral strategy or not. All code has bugs in it, exchanges have hiccups, quotes from many exchanges are notoriously wonky, programs freeze, Internet connections go down, users fat finger inputs etc. This needs a real risk system built into it.

[+] blantonl|9 years ago|reply
But there is no market risk, because the project says so.
[+] jacobwcarlson|9 years ago|reply
It's weird that over the course of 7 hours no one on a site called Hacker News noticed that send_email.cpp passes unsanitized user-supplied args to system(). I've spent less than 5 minutes looking at this code, so maybe that's the worst of it. But if 5 minutes of investigation found 1980's style bugs I doubt that's the worst of it.
[+] xapata|9 years ago|reply
I haven't read the code, but regarding unsanitized user input... Isn't the user the, well, user, in this case?

Complaining about bad data in that situation is like complaining that an admin could hit the power switch.

Or maybe I've completely misunderstood the purpose of this software.

[+] ryanlol|9 years ago|reply
For someone to "exploit" this they must already have code execution.
[+] fuddle|9 years ago|reply
Have you made much profit using the software?
[+] omarforgotpwd|9 years ago|reply
Looks like a great app for anyone looking to accidentally destroy their life savings and get arrested by the IRS.
[+] RoboTeddy|9 years ago|reply
Are the price differences between markets already arbitraged to the point of maximum profitability?

(which wouldn't be 100% due to eg exchange failure risk, transaction fees, risk of getting hacked while currency is in play, etc)

[+] kbody|9 years ago|reply
There is at least one exchange that has enough discount, but their reputation is horrible, so if you want to arbitrage that then it's on your head. In general that's the case if there is any opportunity. While they don't make mainstream headlines, mini MTGox'es still happen, like a Polish exchange some months ago.

There are a lot of people going after it, and probably some that do it wrongly thinking they are profitable while they are not. If you look at some of those bitcoin bots, they full of wrong calculations.

[+] mhluongo|9 years ago|reply
Highly doubtful, considering the spreads between even highly regulated exchanges
[+] rampage101|9 years ago|reply
Just curious why someone would open source a project like this?

If it works, it should be making money consistenly, but giving away the system will make the arbitrage opportunity non-existant if enough people use it.

[+] dalore|9 years ago|reply
Perhaps he realises that other people are doing it too and, as you said, realised the more people who do arbitrage the more it goes away. He could be out to stabilise the bitcoin exchanges as well as provide liquidity to the market.

Perhaps as more people use it, the demand for bitcoins go up also, and since limited supply the price goes up. And he might have substantial holdings of bitcoin he wants to sell. More people trying to find arbitrage opportunities makes it easier to sell his bitcoin which are now higher value.

[+] random3|9 years ago|reply
given the high latency with the exchanges the choice of language seems an unnecessary risk
[+] TheDong|9 years ago|reply
The main bitcoin codebase is in C++ so C++ has the most mature library and best support for the protocol.

Other implementations, including two Javascript ones and a Go one, have had significant bugs in handling the protocol correctly.

Seems like a pointless risk and waste of time to use any non-c++ language for dealing with the BTC protocol

[+] thehardsphere|9 years ago|reply
"without market risk"

> Blackbird doesn't sell but actually short sells Bitcoin on the short exchange.

Because nobody ever faced risk short selling. That big market crash that was part of the worst recession in 60 years had nothing to do with short selling. Long Term Captial Management totally came out of that just fine. Bear Sterns is alive today and doing swell.

Jesus.

[+] galacticpony|9 years ago|reply
What does that have to do with anything? You don't understand the point.

You go short on one market, while simultaneously going long on the other market. That's how you profit (arbitrage).

[+] whack|9 years ago|reply
The liability from short-selling on exchange A is balanced by the buy order on exchange B. The failures you described in LTCM and Bear Sterns bear no relation whatsoever to what the OP is describing. I suggest reading more on long-short arbitrage before disparaging someone's ideas with such condescension.