Automated Dollar Cost Averaging bot for Binance and Bitkub
100% self-hosted Β· No cloud dependency Β· Just docker compose up -d
| Feature | Detail |
|---|---|
| π¦ Multi-Exchange | Binance (USDT pairs) and Bitkub (THB pairs) |
| β° Flexible Schedule | Daily / Weekly / Monthly / Every N hours |
| π Buy & Sell | Market, Limit, Percent of Holdings |
| π Live Stats | Avg Cost, Unrealized PnL, Holdings per plan |
| π THB/USDT Toggle | Automatic cross-currency conversion |
| π Telegram Alerts | Notifications for every buy/sell order |
| π Secure | API keys encrypted with Fernet before storage |
| π Web UI | Dashboard, Plans, Orders, Settings |
- Docker Desktop
- Exchange API Keys (Binance and/or Bitkub)
git clone https://github.com/CableKungZ/autoDCA.git
cd autoDCAcp .env.example .envEdit .env:
POSTGRES_PASSWORD=your_strong_password
FERNET_KEY= # β see how to generate below
BINANCE_API_KEY=
BINANCE_API_SECRET=
BITKUB_API_KEY=
BITKUB_API_SECRET=
TELEGRAM_BOT_TOKEN= # optional
TELEGRAM_CHAT_ID= # optionalGenerate Fernet Key:
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"docker compose up -dFirst build takes ~2-5 minutes
| Service | URL |
|---|---|
| π Web UI | http://localhost:3333 |
| π API Docs | http://localhost:8888/docs |
π‘ Binance
- Go to Binance API Management
- Create a new API Key
- Enable Spot & Margin Trading permission
- Whitelist your server IP β find it at Settings β Server Public IP
π’ Bitkub
- Go to Bitkub API
- Create a new API Key
- Enable Trading permission
- Whitelist your server IP β find it at Settings β Server Public IP
- Go to Plans β click + New Plan
- Select Exchange β Select Pair β Set amount per order
- Binance β₯ 5 USDT Β· Bitkub β₯ 10 THB
- Set Schedule β click Create
Click Buy Now on the Plans page to execute immediately without waiting for the schedule.
Click Sell to open the Sell modal:
- β‘ Market β Sell at current market price instantly
- π― Limit β Set a target price to sell at
- % Percent β Sell a percentage of your holdings
# Start
docker compose up -d
# Stop
docker compose down
# View logs
docker compose logs -f api
docker compose logs -f scheduler
# Rebuild after code changes
docker compose up -d --build
# Check status
docker compose psautoDCA/
βββ π³ docker-compose.yml
βββ π .env.example
βββ backend/
β βββ app/
β β βββ models/ # SQLAlchemy models
β β βββ routers/ # FastAPI endpoints
β β βββ services/ # exchange, dca_engine, telegram
β β βββ scheduler/ # APScheduler jobs
β βββ alembic/ # DB migrations
βββ frontend/
βββ src/
βββ views/ # Dashboard, Plans, Orders, Settings
βββ components/ # OrderTable, SellModal, SchedulePicker
API not responding
docker compose logs api --tail=50Orders stuck at Pending
Go to Orders page β click Clear Pending
Binance / Bitkub 401 Unauthorized
- Check API Key and Secret in
.env - Whitelist your server IP (find it at Settings β Server Public IP)
- Re-run
docker compose up -dafter editing.env
Docker build fails (DNS error)
Edit ~/.docker/daemon.json:
{
"dns": ["8.8.8.8", "1.1.1.1"]
}Then restart Docker Desktop.
| Layer | Technology |
|---|---|
| Backend | Python 3.12 + FastAPI |
| Scheduler | APScheduler |
| Database | PostgreSQL 16 |
| Cache / Lock | Redis 7 |
| Frontend | Vue 3 + Vite + TailwindCSS |
| Reverse Proxy | Nginx |
| Container | Docker Compose |
This project is licensed under CC BY-NC 4.0
| Action | Allowed |
|---|---|
| β Personal use | Yes |
| β Modify / Adapt | Yes (credit required) |
| β Redistribute | Yes (credit required) |
| β Commercial use | Strictly prohibited |
Made with β by CableKungZ
β Star this repo if you find it useful!