{"id":21625059,"url":"https://github.com/ryandau/rbot","last_synced_at":"2025-03-18T19:54:24.437Z","repository":{"id":264420146,"uuid":"893319306","full_name":"ryandau/rbot","owner":"ryandau","description":"Bitcoin trading bot for the Australian market using CoinSpot API","archived":false,"fork":false,"pushed_at":"2024-12-14T05:40:36.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T22:32:57.354Z","etag":null,"topics":["bitcoin","coinspot","cryptocurrency","python-fastapi","technical-analysis","trading-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryandau.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-24T05:35:44.000Z","updated_at":"2024-12-14T05:40:41.000Z","dependencies_parsed_at":"2024-12-14T05:27:18.459Z","dependency_job_id":null,"html_url":"https://github.com/ryandau/rbot","commit_stats":null,"previous_names":["ryandau/rbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryandau%2Frbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryandau%2Frbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryandau%2Frbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryandau%2Frbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryandau","download_url":"https://codeload.github.com/ryandau/rbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244297667,"owners_count":20430344,"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":["bitcoin","coinspot","cryptocurrency","python-fastapi","technical-analysis","trading-bot"],"created_at":"2024-11-25T01:07:41.015Z","updated_at":"2025-03-18T19:54:24.413Z","avatar_url":"https://github.com/ryandau.png","language":"Python","readme":"# rbot\n\nBitcoin DCA (Dollar Cost Average) trading bot for the Australian market using CoinSpot API. Features technical analysis, risk management, and automated trading strategies.\n\nLicensed under [MIT License](LICENSE)\n\n## Overview\n\nrbot implements an advanced trading strategy for Bitcoin purchases on CoinSpot, featuring:\n- Multi-level price entry points\n- Technical analysis validation\n- Risk management systems\n- Real-time monitoring\n- Push notifications\n\n## Requirements\n\n- Python 3.8+\n- fastapi\n- aiohttp\n- pydantic\n- python-dotenv\n- uvicorn\n- hmac\n- typing\n- json\n\n## Setup\n\n1. Clone and install:\n```bash\ngit clone https://github.com/ryandau/rbot.git\ncd rbot\npip install -r requirements.txt\n```\n\n2. Set up credentials:\n- Get your [CoinSpot API credentials](https://www.coinspot.com.au/my/api)\n- Create a [ntfy.sh](https://ntfy.sh/) topic for notifications\n- Copy `.env.example` to `.env` and update with your credentials\n\n3. Create data directory:\n```bash\nmkdir -p data\n```\n\n4. Run:\n```bash\npython bot.py\n```\n\n## Market Analysis\n\nThe bot employs multiple technical indicators and analysis methods:\n\n- Moving Averages\n  - Short-term SMA (8 periods)\n  - Long-term SMA (21 periods)\n  - EMA with configurable alpha\n- Momentum Analysis\n  - Price momentum calculation\n  - Trend strength evaluation\n- Statistical Analysis\n  - Linear regression\n  - R-squared validation\n  - Volatility measurement\n- Signal Agreement\n  - Multiple signal validation\n  - Confidence scoring\n  - Risk level assessment\n\n## Risk Management\n\nComprehensive risk management features:\n\n1. Position Protection\n   - Maximum drawdown limits\n   - Stop-loss automation\n   - Rapid decline protection\n   - Exposure limits\n\n2. Entry Validation\n   - Price buffers\n   - Volatility thresholds\n   - Technical confirmation\n   - Signal agreement requirements\n\n3. Portfolio Management\n   - Position sizing\n   - Allocation controls\n   - Total exposure limits\n   - Investment pacing\n\n## API Endpoints\n\n### Core Operations\n\n#### Status Check\n```bash\nGET http://127.0.0.1:8000/status\n```\nReturns current market conditions, positions, and bot status.\n\n#### Health Check\n```bash\nGET http://127.0.0.1:8000/health\n```\nConfirms bot is running.\n\n### Position Management\n\n#### Get Positions\n```bash\nGET http://127.0.0.1:8000/positions\n```\nReturns detailed position information including P/L.\n\n#### Sync Positions\n```bash\nGET http://127.0.0.1:8000/sync_positions\n```\nSynchronizes positions with exchange history.\n\n#### Recover Position\n```bash\nPOST http://127.0.0.1:8000/recover_position\n```\nManually recover a position into tracking.\n\n### Configuration\n\n#### Update Price Levels\n```bash\nPOST http://127.0.0.1:8000/update_levels\nContent-Type: application/json\n\n{\n    \"165000.0\": {\"price\": 165000.0, \"allocation\": 0.15, \"triggered\": false},\n    \"160000.0\": {\"price\": 160000.0, \"allocation\": 0.15, \"triggered\": false},\n    \"155000.0\": {\"price\": 155000.0, \"allocation\": 0.15, \"triggered\": false}\n}\n```\n\n#### Update Settings\n```bash\nPOST http://127.0.0.1:8000/update_settings\nContent-Type: application/json\n\n{\n    \"POLL_INTERVAL\": 20,\n    \"INITIAL_INVESTMENT\": 500.0,\n    \"RISK_THRESHOLD\": 0.65\n    // ... other settings\n}\n```\n\n#### Reset Triggers\n```bash\nPOST http://127.0.0.1:8000/reset_triggers\n```\nResets all price level triggers.\n\n### Monitoring\n\n#### Check Balances\n```bash\nGET http://127.0.0.1:8000/check_balances\n```\nReturns current account balances.\n\n#### Verify Credentials\n```bash\nGET http://127.0.0.1:8000/verify_credentials\n```\nValidates API credentials.\n\n#### Verify State\n```bash\nGET http://127.0.0.1:8000/verify_state\n```\nChecks bot state consistency.\n\n#### Debug Sync\n```bash\nGET http://127.0.0.1:8000/debug_sync\n```\nDetailed synchronization information.\n\n## Configuration\n\nThe bot can be configured through:\n\n1. Environment Variables\n   - Set in `.env` file\n   - System environment variables\n   - Runtime updates via API\n\n2. Price Levels\n   - Multiple entry points\n   - Individual allocations\n   - Buffer zones\n   - Trigger status\n\n3. Trading Parameters\n   - Investment amounts\n   - Risk thresholds\n   - Technical indicators\n   - Protection settings\n\n## Data Storage\n\nThe bot maintains state in the `data/` directory:\n- `trader_state.json`: Current bot state\n- `price_history.json`: Historical price data\n\n## Notifications\n\nReal-time notifications via ntfy.sh for:\n- Trade executions\n- Stop losses\n- Error conditions\n- State changes\n\n## Security Notes\n\n- API keys stored locally\n- No external data transmission except to CoinSpot\n- Secure notifications via ntfy.sh\n- No sensitive data logging\n\n## Disclaimer\n\nThis software is provided \"as is\" without warranty. The author(s) are not liable for any:\n- Trading losses or financial decisions\n- Technical malfunctions\n- Data inaccuracies\n- Direct or indirect damages\n\nThis is not financial advice. Use at your own risk.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryandau%2Frbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryandau%2Frbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryandau%2Frbot/lists"}