Giter VIP home page Giter VIP logo

bitcoin-arbitrage's Introduction

How to install

cd ./bitcoin-arbitrage/
pip install .

Supported markets:

- CampBXUSD
- CoinBaseUSD
- OKCoinCNY
- BtceUSD
- BTCCCNY
- BtceEUR
- BitstampUSD
- GeminiUSD
- BitfinexUSD
- KrakenUSD
- PaymiumEUR
- KrakenEUR

Supported observers

Logger
Rabbitmq

How to use:

Default configuration

import logging
import time

from arbitrage.arbiter import Arbiter
from arbitrage.config import Configuration

log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logging.basicConfig(format=log_format, level=logging.INFO)

config = Configuration()
arbiter = Arbiter(config)

while 1:
    arbiter.depths = arbiter.update_depths()
    arbiter.tickers()
    arbiter.tick()
    time.sleep(config.refresh_rate)
    

RabbitMQ observer:

import logging
import time

from arbitrage.arbiter import Arbiter
from arbitrage.config import Configuration

log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logging.basicConfig(format=log_format, level=logging.INFO)

config = Configuration()
config.amqp_url = 'http://guest:guest@localhost'
config.observers = ['Logger','Rabbitmq']
arbiter = Arbiter(config)

while 1:
    arbiter.depths = arbiter.update_depths()
    arbiter.tickers()
    arbiter.tick()
    time.sleep(config.refresh_rate)

Configuration options

Name Type Description Notes
bank_fee float Bank fees accounting at conversion [optional] [default to 0.007]
default_market_update_rate int Default market's depth update rate in seconds [optional] [default to 20]
fiat_update_delay int Delay in seconds between an exchange rate updates [optional]
market_expiration_time int Markets order book expiration time [optional]
markets list[str] List of market names [optional]
max_tx_volume float The max money volume that can be involved into transfer [optional] [default to 10.0]
observers list[str] List of opportunity observers names [optional]
refresh_rate int Update rate in seconds of the arbiter's main loop [optional] [default to 20]
report_queue str The name of the response queue [optional] [default to 'arbitrage_watcher']

Adding new markets and observers

To plug-in the new implementation of the market or observer you need to inherit their base classes:

  • arbitrage.markets.market.MarketBase
  • arbitrage.observers.observer.ObserverBase

and then add an import of the python module with the class implementation to one of the markets or observer packages:

  • arbitrage.markets.__init__.py
  • arbitrage.observers.__init__.py

bitcoin-arbitrage's People

Contributors

achiang avatar ericscheier avatar gpwclark avatar hisabness avatar kbespalov avatar kevin-prichard avatar maccam912 avatar maxme avatar patricksi avatar sixty4bit avatar sscarduzio avatar tadejs avatar twoblink avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.