{"id":18853489,"url":"https://github.com/kdmukai/binance_bbb","last_synced_at":"2025-04-14T10:23:52.912Z","repository":{"id":39721885,"uuid":"135911416","full_name":"kdmukai/binance_bbb","owner":"kdmukai","description":"Custom-Weighted Portfolio Binance Balanced Buying Bot","archived":false,"fork":false,"pushed_at":"2022-12-08T02:29:13.000Z","size":40,"stargazers_count":20,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T23:41:46.283Z","etag":null,"topics":["binance","bitcoin","bot","buying","crypto","cryptocurrency","cryptocurrency-exchanges","dollar-cost-averaging","etf","ethereum","portfolio"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdmukai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-03T14:30:31.000Z","updated_at":"2024-02-21T23:35:44.000Z","dependencies_parsed_at":"2022-09-21T05:16:14.389Z","dependency_job_id":null,"html_url":"https://github.com/kdmukai/binance_bbb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdmukai%2Fbinance_bbb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdmukai%2Fbinance_bbb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdmukai%2Fbinance_bbb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdmukai%2Fbinance_bbb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdmukai","download_url":"https://codeload.github.com/kdmukai/binance_bbb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860656,"owners_count":21173480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binance","bitcoin","bot","buying","crypto","cryptocurrency","cryptocurrency-exchanges","dollar-cost-averaging","etf","ethereum","portfolio"],"created_at":"2024-11-08T03:44:31.660Z","updated_at":"2025-04-14T10:23:52.887Z","avatar_url":"https://github.com/kdmukai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binance Balanced Buying Bot (binance_bbb) \n\nA Roll-Your-Own approach to setting up your own customized Binance index fund to buy into using a dollar-cost-averaging investing philosophy.\n\nSet up a customized basket of target cryptos and relative weights. Then the `binance_bbb` will buy each of them for you at the specified ratios.\n\n## Note on Binance market orders\nOn many exchanges a market order pays higher fees than limit orders. But Binance fees are the same whether you're the maker or the taker. So this bot just places instantly-fulfilled market orders. There's usually sufficient liquidity to assume your order will be filled without the price moving much in the milliseconds it takes to check the market and then place the order.\n\nThe only way to reduce Binance fees is to hold their BNB token in your account (currently 0.1% fees become 0.075%).\n\n\n# Setup\n- Requires Python 3.7\n- python3 virtualenv recommended\n\n## Dependencies\n\nInstall the python dependencies via:\n```\npip install -r src/requirements.txt\n```\n\n_Note: depending on your setup you might have to use `pip3 install -r src/requirements.txt`_\n\n## Create and store API keys\nCreate a new API key on Binance and take careful note of the api key and api secret. I strongly recommend that you also enable the option to \"Restrict access to trusted IPs only\".\n\nIn the `conf/` dir rename the dummy `settings.conf` to `settings_local.conf`. Open it with \na text editor and update it with your actual Binance API keys:\n```\n[API]\nAPI_KEY = lkasjdfklasdfklasdf\nSECRET_KEY = lkasdjflksadjflkasjdflkasdfs\n\n\n[AWS]\n# Optional. Delete this section if you aren't using AWS SNS email notifications\nSNS_TOPIC = enter:your:arn:here\nAWS_ACCESS_KEY_ID = ABCDEFGHIJKLMNOP\nAWS_SECRET_ACCESS_KEY = foobarfoobarfoobar\n```\n_As noted you can also customize or omit AWS SNS notification integration._\n\nAlso rename the dummy `portfolio.conf` to `portfolio_local.conf` for the next step.\n\n# Customize your portfolio\nOpen your `portfolio_local.conf` in a text editor. It will initially contain some example dummy data:\n```\n[portfolio_weights]\nABC = 1.0\nXYZ = 1.1\nFOO = 0.9\nBAR = 0.0\n```\n\nUpdate the list to the actual crypto ticker labels that you'd like to buy (e.g. NEO, EOS, ZRX). Then specify a weighting for each crypto. The weights determine the ratio of how much of your order will be for each crypto.\n\nExample 1: Equal amounts:\n```\n[portfolio_weights]\nNEO = 1.0\nGAS = 1.0\nONT = 1.0\n```\nIf you buy a total of 0.1 BTC worth of this portfolio, then each of these three cryptos would generate a ~0.0333 BTC order.\n\nExample 2: Varying weights:\n```\n[portfolio_weights]\nAST = 1.0\nLRC = 2.5\nZRX = 0.5\n```\nIn this case AST would make up ```1.0 / (1.0 + 2.5 + 0.5) = 0.25``` of the order.\n\nExample 3: Disabling a crypto:\n```\n[portfolio_weights]\nEOS = 0.0\nADA = 1.0\nXLM = 1.0\n```\nBecause EOS' weight is set to 0.0 the portfolio will ignore it and just follow the weights specified for the other two cryptos.\n\n# Usage\n```\nusage: binance_bbb.py [-h] [-c SETTINGS_CONFIG_FILE]\n                      [-p PORTFOLIO_CONFIG_FILE]\n                      [-m PORTFOLIO_MANUAL_OVERRIDE] [-l] [-j]\n                      crypto amount\n\nBinance Balanced Buying Bot\n\npositional arguments:\n  crypto                The ticker of the crypto to spend (e.g. 'BTC', 'ETH',\n                        etc)\n  amount                The quantity of the crypto to spend (e.g. 0.05)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c SETTINGS_CONFIG_FILE, --settings_config SETTINGS_CONFIG_FILE\n                        Override default settings config file location\n  -p PORTFOLIO_CONFIG_FILE, --portfolio_config PORTFOLIO_CONFIG_FILE\n                        Override default portfolio config file location\n  -m PORTFOLIO_MANUAL_OVERRIDE, --manual_portfolio PORTFOLIO_MANUAL_OVERRIDE\n                        Override portfolio conf and buy the comma-separated\n                        cryptos listed\n  -l, --live            Submit live orders. When omitted, just tests API\n                        connection, portfolio weights, and amount without\n                        submitting actual orders\n  -j, --job             Suppress the confirmation step before submitting\n                        actual orders\n```\n\n\n# Testing your portfolio\n\n## Minimum notional values\nBinance specifies a minimum buy order value for each crypto (aka `minNotional`). Let's say you're looking to buy equal amounts of 10 different cryptos and only want to spend 0.005 BTC altogether. Obviously each order's notional value will then be 0.0005 BTC.\n\nBut the `minNotional` for BTC orders is 0.001; Binance will not let you place an order whose value is smaller than that.\n\n\n## Manual/cron buys\nUse the `-m` or `--manual_portfolio` command line option to specify a comma-separated list of cryptos in lieu of your customized portfolio configuration. This option is intended to allow this bot to be used as a simple, schedulable buying bot for a single crypto or basic portfolio of cryptos. In this mode all manually-specified cryptos are given an equal weighting.\n\nFor example, you might have a new crypto that you want to build a position in so you'll want to set it on its own dollar-cost averaging buy in schedule, separate from your broader portfolio schedule.\n\nTypically you'd set this up as its own cron job:\n```\n* */6 * * * /your/virtualenv/path/bin/python -u /your/binance_bbb/path/src/binance_bbb.py BTC 0.00125 -c /your/settings/path/your_settings_file.conf -m ICX,WAN -j -l \u003e\u003e /your/cron/log/path/cron.log 2\u003e\u00261\n```\nIn this case the specified 0.00125 BTC will be evenly divided between the two manual portfolio cryptos and will repeat this same buy every six hours.\n\n\n#### Mac notes\nEdit the crontab:\n```\nenv EDITOR=nano crontab -e\n```\n\nView the current crontab:\n```\ncrontab -l\n```\n\n\n## Disclaimer\n_I built this to execute my own micro dollar cost-averaging crypto buys. Use and modify it at your own risk. This is also not investment advice. I am not an investment advisor. You should do your own research and invest in the way that best suits your needs and risk profile.  Good luck and HODL strong._\n\n\n# Tips\nIf you found this useful, send me some digital love\n- ETH: 0xb581603e2C4eb9a9Ece4476685f0600CeB472241\n- BTC: 13u1YbpSzNsvVpPMyzaDAfzP2jRcZUwh96\n- LTC: LMtPGHCQ3as6AEC9ueX4tVQw7GvHegv3fA\n- DASH: XhCnytvKkV44Mn5WeajGfaifgY8vGtamW4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdmukai%2Fbinance_bbb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdmukai%2Fbinance_bbb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdmukai%2Fbinance_bbb/lists"}