Bitcoin arbitrage without market risk
github.com
github.com
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.
Exchange 1: 1000 Exchange 2: 900
You sell 1 of exchange 1 and buy 1 of exchange 2.
Scenario 1: Exchange 2 rises to meet exchange 1, exchange 1 stays stable. You make $100 as you bought exchange 2 at 900 and its price is now 1000. You lose nothing on exchange 1 since the price hasn't changed.
Scenario 2: Exchange 1 falls to meet exchange 2, exchange 2 stays stable. You make $100 as you sold exchange 1 at 1000 and its price is now 900. You lose nothing on exchange 2 since the price hasn't changed.
Scenario 3: Exchange 1 rises to 1100 and exchange 2 rises to meet it. You make $200 as you bought exchange 2 at 900 and its price is now 1100. You lose $100 as you sold exchange 1 at 1000 and its price is now 1100. The ultimate profit is $100.
The important thing is that you trade both sides.
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.
So, there is risk with this strategy. One of the exchanges could fail and you lose everything you have on that exchange.
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?
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.
Arbitrage is as much about volume as it is about differences in price. Volume is something bitcoin markets do not really have (compared to most other financial markets).
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?
I found that automated triangular (and 4, 5...) arbitrage was possible in the past, mainly due to fee-raking exchanges providing superfluous instruments. Opportunities were usually small, counterparty risk and fees usually large.
There also seemed to usually be someone else's bots doing the same thing, although occasionally decent sized trades appeared in slow/extraneous markets. Exploiting these mechanically eventually results in humans looking for the source of the arbitrage, and even if there aren't competing bots running it won't last long.
Arbitrage based on first-moving markets and slower moving markets was pretty common, and some people seemed to have automated it.
And of course the market making robots run by the exchanges are the most fun to watch. Lots of times they trigger the crossover bot traders' algorithms on purpose.
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.
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.
The same user who feeds in the values for 'system' is also trusting the program with their bitcoins! This is (in my opinion) like saying "bash" is a security issue because you can give it bash scripts.
> why shouldn't my financial system be as open as bash?
Oh my lord...
I put my cups in the dishwasher, not the autoclave. I use 2fa for my financial accounts, but not for my frisbee league. Security is about appropriate paranoia.
1) The user isn't always the one providing user input.
2) When the user does provide input, the user isn't always smart.
3) Users do things that you never would have conceived.
Unsanitized system() calls are even worse than leaving your system wide open to a sql inection attack.
floats to represent currency?
The worst thing that can happen if you buy a security is that it will become worthless, thus you lose all the money you put in. The worst thing that can happen if you use any form of debt to leverage your investments is that you get wiped out completely because you end up owing more money than you can possibly pay back.
http://www.marketwatch.com/story/help-my-short-position-got-...
While what you're saying may be true in some context, it doesn't apply here.
(which wouldn't be 100% due to eg exchange failure risk, transaction fees, risk of getting hacked while currency is in play, etc)
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.
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.
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.
Anyone wanting more mainstream adoption of bitcoin would do well to promote arbitrage trading to as many as possible.
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
> 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.
You go short on one market, while simultaneously going long on the other market. That's how you profit (arbitrage).
Jesus.
You also can't lose money beyond what you put in (on the exchanges that allow for this), your position just gets terminated.
First line: Potential loss on a short sale is theoretically unlimited.
"However, in practice, the short seller is required to post margin or collateral to cover losses, and inability to do so in a timely way would cause its broker or counterparty to liquidate the position."
That's exactly what the Bitcoin exchange will do, as well. Since the exchange actually holds the assets (i.e. bitcoin and dollars), it can also determine whether such liquidation is backed by orders.
I think it's completely irresponsible to present that as "without market risk" to an audience that doesn't have similar resources and in some cases doesn't even understand what a short is. I think that presention should be disparaged.
Everything you said so far is just wrong in context.