A quantitative cryptocurrency trading system implementing micro-transaction strategies (DCA, Grid, HFT) with comprehensive risk management and automated execution.
Phase: Phase 13 - Binance Spot Testnet Deployment (Ready for Configuration + DR Drill) Environment: Binance Spot Testnet Strategy: SMA Crossover (baseline) Readiness: 51% current β 72% post-drill β 81% post-rodage Test Coverage: 203/225 tests passing (90.2%)
- START-HERE.md β - Complete Phase 13 deployment guide (2.5-3 hours to deployment authorization)
- docs/README.md π - Master documentation index (~78 files, 100% coverage)
- CLAUDE.md π€ - AI development guidelines (comprehensive)
- CHANGELOG.md π - Version history (v0.13.0)
- .github/CONTRIBUTING.md π€ - Contribution guide
π€ I'm new to the project β Read README.md (this page, 5 min) β Then START-HERE.md (deployment guide)
π I want to deploy Phase 13 to testnet β Go to START-HERE.md β Follow 6-step execution plan (2.5-3 hours)
π I want to explore the documentation β Go to docs/README.md β Navigate by topic, date, or task
π» I want to contribute code β Read .github/CONTRIBUTING.md β Follow development workflow
π I want to understand the architecture β Read CLAUDE.md β Review code organization and critical files
π¬ I want to research ML/AI strategies β Go to docs/research/ β Start with REGULATORY-ML-LANDSCAPE-2025.md
π I found a bug β Check .github/CONTRIBUTING.md#bug-reports β File issue with template
β I have a question β Check docs/phase-13/CONFIGURATION_GUIDE.md (troubleshooting) β Or file issue
THUNES/
βββ src/
β βββ backtest/ # Vectorbt backtesting
β βββ optimize/ # Optuna hyperparameter optimization
β βββ live/ # Paper & live trading
β βββ filters/ # Exchange order filters (critical)
β βββ data/ # Data fetching & WebSocket streaming
β βββ alerts/ # Telegram notifications
β βββ risk/ # Risk management (kill-switch, limits)
β βββ utils/ # Logging, config
βββ tests/ # Pytest test suite
βββ artifacts/ # Backtest results, optimization studies
βββ logs/ # Application logs
βββ .github/workflows/ # CI/CD pipelines
- Python 3.12+
- Binance Spot Testnet account with API keys
- (Optional) Telegram bot for alerts
# Clone repository
git clone <your-repo-url>
cd THUNES
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
make install
# Configure environment
cp .env.template .env
# Edit .env with your API keysEdit .env with your credentials:
BINANCE_TESTNET_API_KEY=your_testnet_api_key
BINANCE_TESTNET_API_SECRET=your_testnet_secret
TELEGRAM_BOT_TOKEN=your_telegram_bot_token # Optional
TELEGRAM_CHAT_ID=your_chat_id # Optionalmake backtest
# Output: artifacts/backtest/stats_BTCUSDT_1h.csvmake optimize
# Output: artifacts/optuna/study.csvmake paper
# Executes trades on Binance Testnet if signal detected| Phase | Description | Status | DoD |
|---|---|---|---|
| 0 | Prerequisites & Setup | β | .env configured, testnet account ready |
| 1 | Import & Setup | β | Dependencies installed, pre-commit active |
| 2 | Smoke Tests | β | pytest passes, linting clean |
| 3 | Backtest MVP | β | SMA strategy backtested, stats generated |
| 4 | Optimization | β | Optuna study completed, best params identified |
| 5 | Paper Trading | β | Market orders executed on testnet |
| 6 | Order Filters | β | Tick/step/minNotional validation, no -1013 errors |
| 7 | WebSocket Streaming | β | Real-time bookTicker/aggTrade, reconnection logic |
| 8 | Risk Management | β | Kill-switch, max loss limits, cool-down, audit trail |
| 9 | Alerts | β | Telegram notifications for trades/errors/kill-switch |
| 10 | Orchestration | β | APScheduler jobs, anti-overlap, monitoring |
| 11 | Observability | π§ | Prometheus metrics prepared, deployment pending |
| 12 | CI/CD | β | GitHub workflows, quality gates enforced |
| 13 | Paper 24/7 | π§ | Code complete, ready for configuration + DR drill |
| 14 | Micro-Live | β³ | Pending Phase 13 completion (7-day rodage) |
Legend: β Complete | π§ In Progress | β³ Pending
Hard Limits (Non-Negotiable):
- Max loss per trade: 5 USDT
- Max daily loss: 20 USDT
- Max concurrent positions: 3
- Cool-down after loss: 60 minutes
Kill-Switch: Automatically stops trading if daily loss exceeds threshold.
# Run all tests
make test
# Run linters
make lint
# Format code
make format
# Run pre-commit hooks
make pre-commit# Build image
make docker-build
# Run container
make docker-run
# Stop container
make docker-stop- CI: Runs on push/PR (lint, test, type-check)
- Backtest: Weekly or on-demand
- Optimize: Manual trigger only
- Paper Trading: Every 10 minutes (requires approval)
- Secrets: Stored in GitHub Secrets (never committed)
- Testnet First: Always test on testnet before production
- API Permissions: Trading only, no withdrawals
- Environment Guards: Production mode requires explicit confirmation
- Backtesting: vectorbt
- Optimization: Optuna
- Exchange: python-binance
- ML: River (for drift detection)
- Monitoring: Prometheus + Loki
- Scheduling: APScheduler
This project implements concepts from quantitative finance and algorithmic trading:
- Vectorized Backtesting: Faster than event-driven for strategy validation
- Bayesian Optimization: TPE sampler finds optimal parameters efficiently
- Exchange Filters: Critical for preventing order rejections (tick/step/notional)
- Slippage Modeling: Realistic backtest includes fees + slippage
- Kill-Switch Pattern: Prevents runaway losses in production
This software is for educational purposes only. Trading cryptocurrencies carries significant risk. Never trade with money you cannot afford to lose. Always start with testnet/paper trading.
MIT License - See LICENSE file for details
We welcome contributions! Please see our Contributing Guide for details.
Quick Contributor Setup:
# 1. Fork & clone
git clone https://github.com/YOUR_USERNAME/THUNES.git
cd THUNES
# 2. Setup environment
make install-dev
pre-commit install
# 3. Create feature branch
git checkout -b feature/amazing-feature
# 4. Make changes, test, commit
make test && make lint
git commit -m "feat: add amazing feature"
# 5. Push and create PR
git push origin feature/amazing-featureRead Before Contributing:
- .github/CONTRIBUTING.md - Complete contribution guide
- AGENTS.md - Repository guidelines
- docs/TESTING.md - Testing requirements
- START-HERE.md - Phase 13 deployment guide (ultimate entry point)
- docs/README.md - Master documentation index (~78 files)
- CLAUDE.md - Comprehensive development guide
- CHANGELOG.md - Version history and release notes
- .github/CONTRIBUTING.md - Contribution guidelines
Explore by Category:
- Phase 13: docs/phase-13/ - Current deployment preparation
- Archives: docs/archive/ - Historical session records
- Research: docs/research/ - Technical analysis & ML strategies
- Roadmap: docs/roadmap/ - Future phases (14-22)
- Issues: GitHub Issues
- Documentation: docs/README.md
- Troubleshooting: docs/phase-13/CONFIGURATION_GUIDE.md
- Contributing: .github/CONTRIBUTING.md
| Metric | Value |
|---|---|
| Version | 0.13.0 (Phase 13 pre-deployment complete) |
| Test Coverage | 203/225 tests passing (90.2%) |
| Documentation | ~78 files, ~35,000 words |
| Code Quality | 85% (excellent) |
| Deployment Readiness | 51% β 72% (post-drill) β 81% (post-rodage) |
| CI/CD | β All quality gates enforced |
Built with β€οΈ for the quant community | Version 0.13.0 | Last Updated: 2025-10-09