Skip to content
btc搬砖套利程序
Branch: master
Clone or download
zihao
zihao first commit
Latest commit cf19f3a Jun 23, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
arbitrage first commit Jun 23, 2017
bittrex first commit Jun 23, 2017
docs first commit Jun 23, 2017
poloniex first commit Jun 23, 2017
tools first commit Jun 23, 2017
.gitignore first commit Jun 23, 2017
MANIFEST.in first commit Jun 23, 2017
README.md first commit Jun 23, 2017
setup.py first commit Jun 23, 2017

README.md

bitcoin-arbitrage - opportunity detector andgit commit -m "first commit" automated trading

It gets order books from supported exchanges and calculate arbitrage opportunities between each markets. It takes market depth into account.

Currently supported exchanges to get data:

  • Bitstamp (USD)
  • Paymium (EUR)
  • BTC-e (USD, EUR)
  • Bitfinex (USD)
  • Kraken (USD, EUR)
  • OkCoin (CNY)
  • CampBX (USD)
  • Gemini (USD)
  • BTCC (CNY)
  • Coinbase Exchange (USD)
  • Haobtc (CNY)
  • Huobi (CNY)

Currently supported exchanges to automate trade:

  • Bitstamp (USD)
  • Haobtc (CNY)
  • OkCoin (CNY)
  • Huobi (CNY)

Donation are always welcome:

  • Jack: 1BPdnAmQopSnieSZV6Yf11wJHFAuzUrNKM

WARNING

Real trading bots are included. Don't put your API keys in config.py if you don't know what you are doing.

Installation And Configuration

$ cp arbitrage/config.py-example arbitrage/config.py

Then edit config.py file to setup your preferences: watched markets and observers

You need Python3 to run this program. To install on Debian, Ubuntu, or variants of them, use:

$ sudo apt-get install python3 python3-pip python-nose
$ pip3 install requests zmq

You need market broker service, please read its README to install then run it.

https://github.com/ucfyao/bitcoin-broker 

To connect the broker server you will need to install thriftpy:

$ pip3 install cython thriftpy

To use the observer XMPPMessager you will need to install sleekxmpp:

$ pip3 install sleekxmpp

Run

To run the opportunity watcher:

$ python3 arbitrage/arbitrage.py watch -v

To check your balance on an exchange (also a good way to check your accounts configuration):

$ python3 arbitrage/arbitrage.py -m HaobtcCNY get-balance
$ python3 arbitrage/arbitrage.py -m HaobtcCNY,BitstampUSD get-balance
$ python3 arbitrage/arbitrage.py -m HaobtcCNY,OkCoinCNY,HuobiCNY get-balance

Run tests

$ nosetests arbitrage/

Alternative usage

List supported public markets:

  $ python3 arbitrage/arbitrage.py list-public-markets

Help

  $ python3 arbitrage/arbitrage.py -h

Example

arbitrage in haobtc, huobi or okcoin

$ python3 arbitrage/arbitrage.py -oTraderBot -mHaobtcCNY,HuobiCNY
$ python3 arbitrage/arbitrage.py -oTraderBot -mHaobtcCNY,OKCoinCNY

balance statatistic

$ python3 arbitrage/arbitrage.py -oBalanceDumper -mHaobtcCNY

TODO

  • Tests
  • Write documentation
  • Add other exchanges:
    • icbit
    • BitFinex
  • Update order books with a WebSocket client for supported exchanges
  • Better history handling for observer "HistoryDumper" (Redis ?)
  • Move EUR / USD from a market to an other:
    • Coupons
    • Negative Operations
  • use Ethercoin or other cryptocurrencies for triangular arbitrage

LICENSE

MIT

Copyright (c) 2017 Jack Yao yaozihao@yaozihao.cn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.