{ "info": { "author": "Matt Hamilton", "author_email": "mh@quernus.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: End Users/Desktop", "Intended Audience :: Financial and Insurance Industry", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Office/Business :: Financial :: Investment" ], "description": "[![Build Status](https://travis-ci.org/hammertoe/crypto_balancer.svg?branch=master)](https://travis-ci.org/hammertoe/crypto_balancer) [![Coverage Status](https://coveralls.io/repos/github/hammertoe/crypto_balancer/badge.svg?branch=master)](https://coveralls.io/github/hammertoe/crypto_balancer?branch=master)\n\n# Cryptocurrency Portfolio Balancer\n\n**USE AT YOUR OWN RISK. THIS TRADES REAL MONEY. NO WARRENTY IS GIVEN**\n\nA script that can connect to a cryptocurrency exchange and buy/sell cryptocurrency to keep your portfolio balancer to a certain ratio.\n\n## Install\n\n```\n$ virtualenv --python=python3 .\n$ . bin/activate\n$ pip install -r requirements.txt\n$ pip install -e .\n```\n\n## Config\nCreate a config file in `config.ini` with definition of your exchange and portfolio percentages, and theshold (percent) that rebalancing is needed:\n\n```\n[binance]\napi_key = \napi_secret = \nthreshold = 2.0\ntargets = XRP 40\n BTC 20\n\t ETH 20\n\t BNB 10\n\t USDT 10\n```\n\nBy default it values the portfolio in USDT, this can be changed with `--valuebase` argument.\n\n## Running\n\nDry run (don't actually trade) against Binance\n```\n$ crypto_balancer binance\nConnected to exchange: binance\n\nCurrent Portfolio:\n XRP 3272.28 (39.92 / 40.00%)\n BTC 0.14 (20.05 / 20.00%)\n ETH 3.85 (20.02 / 20.00%)\n BNB 22.81 ( 9.99 / 10.00%)\n USDT 262.48 (10.02 / 10.00%)\n\n Total value: 2619.40 USDT\n Balance error: 0.043 / 0.08\n\nNo balancing needed\n```\n\nTo force it to rebalance regardless of if needed:\n```\n$ crypto_balancer --force binance\nConnected to exchange: binance\n\nCurrent Portfolio:\n XRP 3272.28 (39.92 / 40.00%)\n BTC 0.14 (20.04 / 20.00%)\n ETH 3.85 (20.02 / 20.00%)\n BNB 22.81 ( 9.99 / 10.00%)\n USDT 262.48 (10.02 / 10.00%)\n\n Total value: 2619.28 USDT\n Balance error: 0.042 / 0.08\n\nBalancing needed [FORCED]:\n\nProposed Portfolio:\n XRP 3278.51 (40.00 / 40.00%)\n BTC 0.14 (20.04 / 20.00%)\n ETH 3.83 (19.95 / 20.00%)\n BNB 22.81 ( 9.99 / 10.00%)\n USDT 262.48 (10.02 / 10.00%)\n\n Total value: 2619.28 USDT\n Balance error: 0.032\n Total fees to re-balance: 0.00199 USDT\n\nOrders:\n BUY 6.2279674364331195 XRP/ETH @ 0.00234478\n```\n\nTo get it to actually execute trades if needed:\n\n```\n$ crypto_balancer --force --trade binance\nConnected to exchange: binance\n\nCurrent Portfolio:\n XRP 3272.28 (39.96 / 40.00%)\n BTC 0.14 (20.04 / 20.00%)\n ETH 3.84 (19.94 / 20.00%)\n BNB 22.94 (10.04 / 10.00%)\n USDT 262.48 (10.02 / 10.00%)\n\n Total value: 2619.01 USDT\n Balance error: 0.043 / 0.08\n\nBalancing needed [FORCED]:\n\nProposed Portfolio:\n XRP 3272.28 (39.96 / 40.00%)\n BTC 0.14 (20.04 / 20.00%)\n ETH 3.85 (20.00 / 20.00%)\n BNB 22.80 ( 9.98 / 10.00%)\n USDT 262.48 (10.02 / 10.00%)\n\n Total value: 2619.01 USDT\n Balance error: 0.031 / 0.08\n Total fees to re-balance: 0.001592 USDT\n\nOrders:\n Submitted: sell 0.13 BNB/ETH @ 0.08422\n```\n\n## Running automatically\n\nYou can set this to run in a cron job on a unix system by putting something along the lines of (adjust for your path and email address) below\nin your crontab file:\n\n```\nMAILTO=matt@example.com\n*/5 * * * * OUTPUT=`cd /home/matt/crypto_balancer; bin/crypto_balancer --trade binance`; echo \"$OUTPUT\" | grep -q \"No balancing needed\" || echo \"$OUTPUT\"\n```\n\nThis will run the script every 5 minutes, and will email you only if some balancing (or an error) occurs.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/hammertoe/crypto_balancer/archive/3.1.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hammertoe/crypto_balancer", "keywords": "cryptocurrency,portfolio,xrp,ethereum,bitcoin,btc,eth", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "crypto-balancer", "package_url": "https://pypi.org/project/crypto-balancer/", "platform": "", "project_url": "https://pypi.org/project/crypto-balancer/", "project_urls": { "Download": "https://github.com/hammertoe/crypto_balancer/archive/3.1.1.tar.gz", "Homepage": "https://github.com/hammertoe/crypto_balancer" }, "release_url": "https://pypi.org/project/crypto-balancer/3.1.1/", "requires_dist": [ "ccxt" ], "requires_python": "", "summary": "A tool to automatically balance cryptocurrency portfolios", "version": "3.1.1" }, "last_serial": 4921043, "releases": { "3.1.1": [ { "comment_text": "", "digests": { "md5": "c7cdd93bf7417175418a3675dd703280", "sha256": "2842c87dbc603d5f3b1cee28fbbd09a41945610850f17671dcb65749b9c153ee" }, "downloads": -1, "filename": "crypto_balancer-3.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c7cdd93bf7417175418a3675dd703280", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16528, "upload_time": "2019-03-10T11:11:32", "url": "https://files.pythonhosted.org/packages/b5/6b/069b72d2cade82272eb2e5e5552b18c92b568f96a42169c5fb3e7b14f7a2/crypto_balancer-3.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "addcedef1a014f60048ee71549dbd004", "sha256": "e962b71714370bc0f117b22003d15fe61e40a60501d81d99c6d38f7c9185958b" }, "downloads": -1, "filename": "crypto_balancer-3.1.1.tar.gz", "has_sig": false, "md5_digest": "addcedef1a014f60048ee71549dbd004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12146, "upload_time": "2019-03-10T11:11:35", "url": "https://files.pythonhosted.org/packages/89/a9/2bc2abd93a69814ad4e39a54ef2adc90fa6b15f0141a40904d6f42f38934/crypto_balancer-3.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c7cdd93bf7417175418a3675dd703280", "sha256": "2842c87dbc603d5f3b1cee28fbbd09a41945610850f17671dcb65749b9c153ee" }, "downloads": -1, "filename": "crypto_balancer-3.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c7cdd93bf7417175418a3675dd703280", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16528, "upload_time": "2019-03-10T11:11:32", "url": "https://files.pythonhosted.org/packages/b5/6b/069b72d2cade82272eb2e5e5552b18c92b568f96a42169c5fb3e7b14f7a2/crypto_balancer-3.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "addcedef1a014f60048ee71549dbd004", "sha256": "e962b71714370bc0f117b22003d15fe61e40a60501d81d99c6d38f7c9185958b" }, "downloads": -1, "filename": "crypto_balancer-3.1.1.tar.gz", "has_sig": false, "md5_digest": "addcedef1a014f60048ee71549dbd004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12146, "upload_time": "2019-03-10T11:11:35", "url": "https://files.pythonhosted.org/packages/89/a9/2bc2abd93a69814ad4e39a54ef2adc90fa6b15f0141a40904d6f42f38934/crypto_balancer-3.1.1.tar.gz" } ] }