Skip to content

Python script to check profitability by simulating USD/BTC/BRL/USD transactions

License

Notifications You must be signed in to change notification settings

cinaglia/bitcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcheck

Calculate potential profitability by simulating Bitcoin transactions such as USDBTCBRLUSD. The script currently uses Coinbase's JSON API to fetch USD/BTC and MercadoBitcoin's to fetch BTC/BRL.

Profit is calculated by making the assumption that bitcoin will be bought and sold whithin the shortest time frame possible.

Installation

To install bitcheck follow the steps below. If you do not have virtualenvwrapper, feel free to skip the environment creation step.

git clone https://github.com/cinaglia/bitcheck.git
cd bitcheck && mkvirtualenv bitcheck
pip install -r requirements.txt
python setup.py install

Usage

Usage:
    bitcheck [--investment=I]
                       [--coinbase=C]
                       [--mercadobitcoin=M]
                       [--exchange=E]
                       [--verbose]
                       [--cycle]
    bitcheck (-h | --help)
    bitcheck (-v | --version)

Options:
    -h --help           Show this screen.
    -v --version        Show version.
    --verbose           Print additional data about process.
    --cycle             Calculate full cycle. Transfer BRL back to USD.
    --investment=I      Total USD invested [default: 1000].
    --coinbase=C        Price paid at Coinbase.
    --mercadobitcoin=M  Price sold at MercadoBitcoin.
    --exchange=E        Exchange Rate.

Sample output

$ bitcheck --verbose
Retrieving exchange rates ..  took 1.355609 seconds

    Bitcheck
    ==================
    Investment:  $1000
    USD/BRL:    R$2.70
    ------------------
         Coinbase
    ------------------
    USD/BTC:  $298.40
    Fee:      $10.00
    Total:    $990.00
    Bitcoin:  3.317694
    ------------------
      MercadoBitcoin
    ------------------
    BTC/BRL:  R$879.00
    Fee:      R$61.23
    BRL:      R$2855.03
    ------------------
      Exchange Gains
    ------------------
    BRL:      R$155.03
    Total:    %5.43
    ------------------

Dependencies

This script uses the awesome lib docopt to handle argument parsing, requests for HTTP requests, as well as gevent for asynchronous requests. Optionally use virtualenvwrapper to handle dependencies.

TODO

  • Add support for multiple currencies and exchanges
  • Handle request errors
  • Add support for parallel HTTP requests
  • Add setuptools support

(Un)license

Public domain

About

Python script to check profitability by simulating USD/BTC/BRL/USD transactions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages