Pages:
Author

Topic: Bitcoin arbitrage on GitHub: ~2% monthly return, market-neutral long/short - page 8. (Read 38256 times)

legendary
Activity: 1064
Merit: 1000
Added it to my list of trading robots - http://easybitinvesting.com/bitcoin-trading/trading-robots/



I had never seen this list before, thanks for sharing. I bookmarked the page for future reference.
newbie
Activity: 56
Merit: 0
Is that 2% on the fiat or BTC side? If Bitcoin doesn't die it seems hard to believe that bitcoin returns from HLODing won't exceed the returns of this program. The arbitrage would have to make returns on the current bitcoin price and exceed the fact that the funds are not always in BTC. Finally, it would have to account for situations where users get goxxed.

It's hard to believe that this isn't a waste of time and a losing proposition when compared to simply HLODing.

Please explain to me where my logic falters.

The profit is always on the fiat side. See the simple example I wrote earlier.

As I said, the biggest advantage of arbitrage is the independence of the market direction. The goal is to generate a constant profit regardless of the market direction. So yes you will miss opportunities from a bull market but your investment will be safe during a bear market. It's a choice.

The largest risk is if the spread between two exchanges never closes for some reasons or if an exchange goes bankrupt like Mt. Gox.

If you are interested, here is a good Wall Street example where the spreads didn't close as expected during arbitrage investments:
Long-Term Capital Management L.P.


In that case the yearly return is less than 30% and judging by what happened to bitcoin platforms in previous years it has been a negative return. That is because the risk of default from these places was far greater than the 30% return. And have not most major currencies inflated greatly the past year? It seems a lot of extra work and risk to slightly beat out the most transparent stocks in Western countries.
newbie
Activity: 49
Merit: 0
I suppose the obvious question to ask here is why make it public, if it's making you money?

For the moment I get a 2% monthly profit for a USD 2,000 exposure. It means that I make about USD 40 per month... Nothing too crazy and I don't know how long it will last.

If I want to invest more money I will need to develop a mechanism to check that there is enough liquidity for my limit orders to be executed before they are sent. I am working on a mechanism that reads the order books of the two involved exchanges. If and only if there is enough liquidity on both exchanges then the trades are generated.

But more that than I like the challenge of building automatic systems. I like to see my system live, sending orders automatically. But I want to improve it (new exchange connections, order books analysis, failover, etc) and I'm not a professional C++ developer. My goal is to find C++ guys that would be interested in contributing. Also, the system is pretty fast and securely connected to Bitcoin exchanges using C++ libraries and in the future I hope to make it a good example for the open source community (not really the case right now...  Tongue).
full member
Activity: 177
Merit: 100
I suppose the obvious question to ask here is why make it public, if it's making you money?
newbie
Activity: 49
Merit: 0
Is that 2% on the fiat or BTC side? If Bitcoin doesn't die it seems hard to believe that bitcoin returns from HLODing won't exceed the returns of this program. The arbitrage would have to make returns on the current bitcoin price and exceed the fact that the funds are not always in BTC. Finally, it would have to account for situations where users get goxxed.

It's hard to believe that this isn't a waste of time and a losing proposition when compared to simply HLODing.

Please explain to me where my logic falters.

The profit is always on the fiat side. See the simple example I wrote earlier.

As I said, the biggest advantage of arbitrage is the independence of the market direction. The goal is to generate a constant profit regardless of the market direction. So yes you will miss opportunities from a bull market but your investment will be safe during a bear market. It's a choice.

The largest risk is if the spread between two exchanges never closes for some reasons or if an exchange goes bankrupt like Mt. Gox.

If you are interested, here is a good Wall Street example where the spreads didn't close as expected during arbitrage investments:
Long-Term Capital Management L.P.
newbie
Activity: 56
Merit: 0
Is that 2% on the fiat or BTC side? If Bitcoin doesn't die it seems hard to believe that bitcoin returns from HLODing won't exceed the returns of this program. The arbitrage would have to make returns on the current bitcoin price and exceed the fact that the funds are not always in BTC. Finally, it would have to account for situations where users get goxxed.

It's hard to believe that this isn't a waste of time and a losing proposition when compared to simply HLODing.

Please explain to me where my logic falters.
newbie
Activity: 49
Merit: 0
Interesting script but how would the funds be transferred between exchanges? Your script can't possibly automated bitcoin transactions and send it, including checking for deposit addresses and that. How does that work?

That's the best part! Wink There is absolutely no transfer between the exchanges. Please read the example I gave earlier with the $20 spread. You will see that there is no transfer in cash or in Bitcoin between the exchanges at any time. I hope my example is clear enough to understand the arbitrage mechanism.


That being said, a cash rebalancing might need to be done when two specific conditions are met:
  • the market is either only bullish (up) or only bearish (down), and
  • the arbitrage opportunity is always the same over and over (e.g. short Bitfinex / long OKCoin)

In this case we can have after a while a situation where the available cash is not well balanced, e.g:
  • On OKCoin: 436.11 USD, 0.0000 BTC
  • On Bitfinex: 1829.08 USD, 0.0000 BTC

The above example can occur when the market is bearish and we are always long on OKCoin (so we systematically lose money because of the bear market) and short on Bitfinex (so we systematically make money because of the bear market).

Note that in this example the system will enter the next arbitrage opportunity with the lowest amount of cash: $436.11. So the total exposure for that new trade will be only 2 * $436.11 = $872.22 even though the total amount of available cash is $436.11 + $1829.08 = $2265.19.
Therefore it would be a good idea to rebalance the cash between the exchanges to have:
  • On OKCoin: 1132.59 USD, 0.0000 BTC
  • On Bitfinex: 1132.60 USD, 0.0000 BTC

newbie
Activity: 49
Merit: 0
hello! sounds really nice i like it! i wanna test it but im not that confident with programmin
i have a debian Server, but never compiled somethin myself
do i have to config in source code? if yes where?
and which libarys are needed to make?

Yes the project is not very user-friendly for the moment and I apologize for that. But please read the section How to test Blackbird to see how you can compile it. Once you succeed to start it everything else will be automatic.

Good luck
full member
Activity: 236
Merit: 100
only 2 exchanges, if is it can be kade best profits?
sr. member
Activity: 420
Merit: 250
Ever wanted to run your own casino? PM me for info
Interesting script but how would the funds be transferred between exchanges? Your script can't possibly automated bitcoin transactions and send it, including checking for deposit addresses and that. How does that work?
newbie
Activity: 19
Merit: 0
hello! sounds really nice i like it! i wanna test it but im not that confident with programmin
i have a debian Server, but never compiled somethin myself
do i have to config in source code? if yes where?
and which libarys are needed to make?



e: ok i got it... not that hard..  but adding other exchanges i would need help Smiley
newbie
Activity: 49
Merit: 0
I do not know a C++ coder but Im looking to hire a meteor eveloper to make an arbitrage trading tool developer for bitcoinpricelab[dot].com
Check out that website, I have a simple overview of markets. Im looking to get a much advanced version which helps traders

Thank you for the link. I noticed that you do your arbitrage by buying bitcoin on an exchange and selling bitcoin on another exchange. You don't use short selling and this is a fondamental difference: on my side my system is completely market-neutral. This means that it's not impacted by the Bitcoin price fluctuation at all. And this is a huge advantage.

Here is how it works, current Bitcoin quotes in blue:

OKCoin BTC@$300.00
Bitfinex BTC@$300.00
No opportunity, system 100% cash, no market risk:
  • On OKCoin: 1000.00 USD, 0.0000 BTC
  • On Bitfinex: 1000.00 USD, 0.0000 BTC

OKCoin BTC@$290.00
Bitfinex BTC@$310.00
Opportunity ($20.00 spread): system 0% cash, but still no market risk since long/short
  • On OKCoin: 0.00 USD, 3.4483 BTC (buy for $1000.00)
  • On Bitfinex: 0.00 USD, -3.2258 BTC (short sell with $1000.00)

Now the Bitcoin market plummets. The $20.00 spread is still here.

OKCoin BTC@$180.00
Bitfinex BTC@$200.00
There is still a spread. No action taken
  • On OKCoin: 0.00 USD, 3.4483 BTC (long)
  • On Bitfinex: 0.00 USD, -3.2258 BTC (short)

Now the spread closes:

OKCoin BTC@$200.00
Bitfinex BTC@$200.00
Exit opportunity: we close the long and short positions and we get:
  • On OKCoin: 689.66 USD, 0.0000 BTC
  • On Bitfinex: 1354.84 USD, 0.0000 BTC

Before the opportunity we had $2000.00 in cash and now we have $2044.50. So even thought during the trade the market lost 33%, we made a 2.2% profit (trading fees not considered). As you can see being market-neutral is a huge advantage when the market is bearish.
hero member
Activity: 882
Merit: 501
Ching-Chang;Ding-Dong
newbie
Activity: 49
Merit: 0
Indeed. That's what I'm looking for, specially with exchanges that offer short selling. As I said earlier the software tests all the possible long/short combinations between the given exchanges.

The current situation is this one, with an exchange A (Bitfinex) that offers short selling and an exchange B (OKCoin) that doesn't offer short selling:
  • A short selling OK
  • B short selling NOK

In this case we only have one combination to test:
  • short A / long B

Now let's add a new exchange C that doesn't allow short selling. We now have:
  • A short selling OK
  • B short selling NOK
  • C short selling NOK

And the software will automatically test the two following combinations:
  • short A / long B
  • short A / long C

But now let's suppose C actually offers short selling:
  • A short selling OK
  • B short selling NOK
  • C short selling OK

In this case we will automatically test four combinations:
  • short A / long B
  • short A / long C
  • short C / long A
  • short C / long B


However, the selected Bitcoin exchanges have to offer good liquidity to make sure our orders will be executed quickly. I'm currently working on a mechanism that will adapt the limit orders sent based on the real-time bid/ask offers.

If you guys know a C++ developer that would be interested in participating in a nice arbitrage project then 100% of the code is on the GitHub page (https://github.com/butor/blackbird).

newbie
Activity: 49
Merit: 0
For the moment the system can only connect to Bitfinex and OKCoin. The project is really work in progress but I think it's a good practical example to understand how arbitrage works. I'm currently looking for C++ developers to help me out with the project.

I will also improve the documentation on how to test it "out of the box". Currently to use it you need to understand and edit a little bit the source code (work in progress I told you Wink )

If you do want to test it, yes please try with a low amount of cash. I did all my testing with a $10.00 exposure. So please only put a low amount of money on your Bitfinex and OKCoin trading accounts. My monthly returns are surprisingly constant: between 1.7% and 2.3%. Of course I cannot guarantee these returns under any circumstances. My average activity so far is 8 trades per month with the system running 24/7.

I'm pretty confident the system would be able to generate better returns with new exchange connections, specially to Bitcoin exchanges that allow short selling. The system is able to test all the possible long/short combinations for a given set of exchanges. So more exchanges really means more arbitrage opportunities.
legendary
Activity: 3248
Merit: 1070
with other exchanges, the 2% can be raised or this is the best the bot can do?
hero member
Activity: 588
Merit: 500
Don't know much about C++ language, but all I can say is, I might try this out with a few bucks.
You said 2% return with USD 2k exposure, so can't I try this out with some less amounts just to check out, only want to make a check with some play money (I mean what I can afford to lose). Wink
newbie
Activity: 49
Merit: 0
Hi guys,

I just released the C++ code of my Bitcoin exchange arbitrage system that generates a ~2% monthly return with a USD 2,000 exposure.

I think you guys might be interested in seeing how arbitrage can work with Bitcoin exchanges.

The full code is on the following GitHub page: https://github.com/butor/blackbird. I tried to write a pretty complete Readme file that explains the arbitrage mechanism.

It is also a good way to see how you can connect a C++ system to two Bitcoin exchanges (Bitfinex and OKCoin) using JSON and base64 encoding.

Please let me know what you think. I will try to find C++ contributors that will be able to improve the code and connect to new exchanges.

I hope it can help you understand and actually test how arbitrage between Bitcoin exchanges works.

Here is a quick real life example where arbitrage can occur because of market inefficiency between Bitfinex and Bitstamp in November 2014 (between the two vertical gray lines):


Pages:
Jump to: