• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 11 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A gem for automating arbitrage between Bitcoin exchanges.

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

More Repositories

1

issue_stats

Analyze and compare how long it takes for Github issues to be closed.
Ruby
185
star
2

electron-cookies

Adds support for cookies in Electron. Cookies are persisted through localStorage.
CoffeeScript
126
star
3

gender

Gender classification by first name in Go.
Go
99
star
4

copypastecsv

Paste in CSV, get a shareable file
Ruby
9
star
5

afterparty

A Rails 4 compatible queue with support for executing jobs in the future and serialization with ActiveRecord.
Ruby
9
star
6

stacks-fungible-token

A set of example contracts implementing the Stacks fungible token standard
TypeScript
9
star
7

glitchnet

An experimental Tensorflow LSTM network that glitch and pixel artwork.
Jupyter Notebook
8
star
8

uludum

An open platform for online education
Ruby
6
star
9

genetic

A genetic algorithm library in Go
Go
5
star
10

aqui

A handy method for logging your code as it runs
Ruby
4
star
11

sip-12-js

A JS / TS library for fetching SIP 12 data
TypeScript
4
star
12

send-many-stx-cli

A simple CLI for making a bulk STX transfer in one command.
TypeScript
4
star
13

bsk-analytics

TypeScript
4
star
14

dynamojs_rails

A light wrapper for using dynamo.js with Ruby on Rails.
Ruby
3
star
15

clarigen-counter-example

An example project for Clarity smart contracts that use Clarigen and Clarinet
TypeScript
3
star
16

bns-scripts

A few scripts for BNS stuff
TypeScript
3
star
17

Coderbracket-Weighted-Scorer

Some javascripts for making march madness brackets on coderbrackets.com
CoffeeScript
2
star
18

blockstack-demo-apps

A few Blockstack sample apps made to try out new functionality
JavaScript
2
star
19

mailigen-js

A JS library for using the Mailigen API
JavaScript
2
star
20

geospeed

An app for getting the speed limit, wherever you are.
Ruby
2
star
21

always-sunny

Visualize the time of day and weekday that episodes of "It's Always Sunny in Philadelphia" start at.
Ruby
1
star
22

hn-scraper

A gem for logging in and posting to Hacker News
Ruby
1
star
23

hankstoever.com

My personal website
Ruby
1
star
24

debut-server

Debut Server powered by Radiks
JavaScript
1
star