Configurable crypto trading bot (Binance + Crypto.com) with risk controls and a web dashboard.
150
CryptoBot A configurable crypto trading bot for Binance and Crypto.com: pluggable strategies (grid, DCA), real risk controls (position limits, stop-loss/take-profit, a daily-loss kill-switch), and a web dashboard for configuration and monitoring. Runs as three containers via docker-compose — this image is used for both the bot worker and the dashboard web app.
No bot can guarantee profit. This gives you a configurable strategy engine and risk controls — it does not, and cannot, guarantee you'll make money. Validate any strategy in paper mode before risking real funds.
Supported architectures linux/amd64, linux/arm64
Quick start mkdir cryptobot && cd cryptobot curl -O https://raw.githubusercontent.com//docker-compose.yml # or paste the compose file below Create a .env file next to it:
TRADING_MODE=paper CONFIRM_LIVE_TRADING=
BINANCE_ENABLED=true CRYPTOCOM_ENABLED=false BINANCE_API_KEY= BINANCE_API_SECRET= CRYPTOCOM_API_KEY= CRYPTOCOM_API_SECRET=
PAPER_STARTING_BALANCE_USDT=10000
POSTGRES_USER=cryptobot POSTGRES_PASSWORD=changeme POSTGRES_DB=cryptobot DATABASE_URL=postgresql+asyncpg://cryptobot:changeme@db:5432/cryptobot
MAX_POSITION_SIZE_PCT=10 STOP_LOSS_PCT=5 TAKE_PROFIT_PCT=10 MAX_DAILY_LOSS_PCT=5 MAX_CONCURRENT_POSITIONS=5
DASHBOARD_USERNAME=admin DASHBOARD_PASSWORD=changeme
DASHBOARD_PORT=8000 LOG_LEVEL=INFO docker-compose.yml:
services: db: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-cryptobot} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} POSTGRES_DB: ${POSTGRES_DB:-cryptobot} volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-cryptobot}"] interval: 5s timeout: 5s retries: 10
bot: image: pantelis98765/crypto-bot:latest restart: unless-stopped command: python -m cryptobot.main env_file: [.env] depends_on: db: condition: service_healthy
dashboard: image: pantelis98765/crypto-bot:latest restart: unless-stopped command: uvicorn cryptobot.dashboard.app:app --host 0.0.0.0 --port 8000 env_file: [.env] ports: ["${DASHBOARD_PORT:-8000}:8000"] depends_on: db: condition: service_healthy
volumes: pgdata: docker compose up -d Open http://localhost:8000 and log in with the DASHBOARD_USERNAME/DASHBOARD_PASSWORD you set.
What's inside bot — polls exchange prices on a fixed interval, runs your configured strategies, passes proposed trades through a risk manager, and executes approved trades (simulated in paper mode, real in live mode). dashboard — balances, positions, trade history, P&L, a kill-switch, a start/stop toggle, and a Settings page for editing trading config and exchange credentials. Protected by HTTP Basic Auth. db (not part of this image — pulled separately as postgres:16-alpine) — shared state: trades, positions, balances, kill-switch, run state, and live trading config. Strategies shipped grid — buy levels evenly spaced across a price range, sell one level up once filled. Suited to range-bound markets. dca — buys a fixed amount on a fixed schedule, regardless of price. Trading modes paper (default) — simulates fills against real market data. No API keys needed at all. live — places real orders. Requires TRADING_MODE=live and CONFIRM_LIVE_TRADING=yes together, a deliberate two-flag guard against accidentally going live. Before going live Run in paper mode first and check the dashboard's trade history and P&L make sense. Create exchange API keys with trading permissions only — disable withdrawals. Start with small risk limits until you trust the setup. Use a strong, unique DASHBOARD_PASSWORD — the dashboard can display and edit your exchange API keys. Tags latest — most recent build, multi-arch (amd64/arm64). Source Built from a private/local project; not currently linked to a public source repository.
Content type
Image
Digest
sha256:cbfd0c914…
Size
91.4 MB
Last updated
3 months ago
docker pull pantelis98765/crypto-bot