This guide covers deploying QuantumFlow to Fly.io and configuring the automated workflows.
- Fly.io account
- GitHub account with repository access
flyctlCLI installed
curl -L https://fly.io/install.sh | shflyctl auth loginflyctl apps create quantumflow-hftflyctl volumes create quantumflow_data --size 1 --region gruflyctl secrets set TELEGRAM_BOT_TOKEN="your_token"
flyctl secrets set TELEGRAM_CHAT_ID="your_chat_id"flyctl deploy-
Get Fly.io API token:
flyctl auth token
-
Add to GitHub Secrets:
FLY_API_TOKEN: Your Fly.io token
-
Push to
mainbranch to trigger deploy
| Variable | Description | Default |
|---|---|---|
SYMBOLS |
Trading symbols | BTCUSDT,ETHUSDT |
DATABASE_URL |
SQLite path | sqlite:///data/trades.db |
RISK_MAX_POSITION |
Max position size | 1.0 |
RISK_MAX_DRAWDOWN |
Max drawdown % | 0.05 |
TIMEZONE |
Shabbat timezone | America/Sao_Paulo |
The default configuration uses:
- 1 shared CPU
- 256MB RAM
- 1GB persistent storage
For higher throughput:
flyctl scale vm shared-cpu-2x --memory 512flyctl logsflyctl ssh consolecurl https://quantumflow-hft.fly.dev/healthRuns on every push:
- Rust tests and linting
- OCaml tests
- Python tests
- Docker build validation
Runs on push to main:
- Deploys to Fly.io
- Runs health check
- Alerts on failure
Runs daily at 00:00 UTC:
- Downloads database from Fly.io
- Generates performance charts
- Updates README
- Commits changes
Runs every 15 minutes:
- Checks API health
- Restarts if unhealthy
- Sends Telegram alert on failure
- Check logs:
flyctl logs - Verify volume mount:
flyctl volumes list - Check secrets:
flyctl secrets list
- SSH into container:
flyctl ssh console - Check database:
sqlite3 /data/trades.db ".tables" - Reset if needed:
rm /data/trades.db
The Rust component has automatic reconnection with exponential backoff. If issues persist:
- Check Binance API status
- Verify network connectivity
- Restart:
flyctl apps restart quantumflow-hft
flyctl ssh console -C "cat /data/trades.db" > backup.dbcat backup.db | flyctl ssh console -C "cat > /data/trades.db"Fly.io free tier includes:
- 3 shared-cpu VMs
- 160GB outbound transfer
- Unlimited inbound
The default configuration stays within free tier limits.