0.19
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
A gem for conducting arbitrage with Bitcoin.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

= 0.2.4
~> 1.3
= 2.1.0
= 0.8.8
= 2.6.1
= 1.10
= 10.1.1
= 0.1.7
= 0.1.0
= 0.18.1
~> 1.1
 Project Readme

RbtcArbitrage

A Ruby gem for executing arbitrage between different Bitcoin exchanges. Supports:

  • Bitstamp
  • CampBX
  • BTC-E
  • Coinbase
  • MtGox (deprecated)

Meta

Please contribute with code! There are always new exchanges that could be easily supported. Check out the contribution guidelines for instructions. Earn Bitcoin for every commit:

tip for next commit

Donations accepted: 16BMcqf93eEpb2aWgMkJCSQQH85WzrpbdZ

Build Status Coverage Status Code Climate

Installation

Install it yourself as:

$ gem install rbtc_arbitrage

Usage

After installing the gem, simply run rbtc in the command line.

Options

  • Live: whether you want to actually execute trades. See the 'Environment Variable' section for the required keys.
  • Cutoff: the minimum profit percentage required to execute a trade. Defaults to %2.00.
  • Volume: The amount of bitcoins to trade per transaction. Defaults to 0.01 (the minimum transaction size).
  • Buyer: The exchange you'd like to buy bitcoins from during arbitrage. Default is bitstamp
  • Seller: The exchange you'd like to sell bitcoins from during arbitrage. Default is campbx

Valid exchanges for the --buyer and --seller option are bitstamp, campbx, btce,and coinbase.

Examples

	$ rbtc --live --cutoff 4
	$ rbtc --cutoff 0.5
	$ rbtc --cutoff 3 --volume 0.05
	$ rbtc --seller bitstamp --buyer campbx
	$ rbtc

The output will look like this:

I, [APR  6 2014  7:14:33 AM -0700#52261]  INFO -- : Fetching exchange rates
I, [APR  6 2014  7:14:37 AM -0700#52261]  INFO -- : Bitstamp (Ask): $455.0
I, [APR  6 2014  7:14:37 AM -0700#52261]  INFO -- : Campbx (Bid): $455.05
I, [APR  6 2014  7:14:37 AM -0700#52261]  INFO -- : buying 0.01 btc at Bitstamp for $4.58
I, [APR  6 2014  7:14:37 AM -0700#52261]  INFO -- : selling 0.01 btc at Campbx for $4.52
I, [APR  6 2014  7:14:37 AM -0700#52261]  INFO -- : profit: $-0.05 (-1.18%) is below cutoff of 2%.

Environment Variables

You will need to configure the following environment variables to trade with real accounts.

BitstampClient
  • BITSTAMP_KEY
  • BITSTAMP_SECRET
  • BITSTAMP_ADDRESS
  • BITSTAMP_CLIENT_ID
CampbxClient
  • CAMPBX_KEY
  • CAMPBX_SECRET
BtceClient
  • BTCE_KEY
  • BTCE_SECRET
  • BTCE_ADDRESS
CoinbaseClient
  • COINBASE_KEY
  • COINBASE_SECRET

Exchange Adapters

rbtc_arbtitrage also exposes a handy interface for interacting with different bitcoin clients. For example:

client = RbtcArbitrage::Clients::BitstampClient.new
client.price :buy
 => 462.88
client.price :sell
 => 462.88
client.balance
 => [0.0079, 1.41] # [btc, usd]
client.options[:volume] = 0.5 # default is 0.01
# client.trade uses market price
client.trade :buy
client.trade :sell
client.address # for deposits
 => "16rQQYMTTKb9cnnSX3xYkN4hcKXoYcXXXX"
# send btc to an address
coinbase = RbtcArbitrage::Clients::CoinbaseClient.new
client.transfer coinbase.address

License

Available here