ETH/USDT Trading Bot Development

Job ID: 39764189

Budget: €30 – €250 EUR

Deliver a single ETH bot that trades ETH/USDT (spot) on Binance Testnet using my strategy: track running peak → buy on ATR-sized dip → sell only in profit after hover time.
Include a minimal Flask web dashboard + JSON API, and deploy 24/7 on Fly.io or Render with persistent storage. Code must be clean and structured so I can extend it later to 9 more bots.


---

Strategy (must match exactly)

Timeframe: 1-minute candles.

ATR: Lookback 14, multiplier k = 1.0 (UI-adjustable 1.0–1.1).

Gap clamp: Enforce configurable gap_min/gap_max (USD) for ETH to prevent unrealistic thresholds.

Entry: Maintain running peak; when (peak − current_low) ≥ ATR_gap (clamped) → market buy (respect precision/filters).

Exit (profit-only): Sell only if:

1. Hover time (minutes) satisfied and


2. price ≥ target where target covers fees + slippage + min profit.



Risk params (UI-editable): atr_lookback, atr_k, gap_min, gap_max, hover_minutes, max_open, cooldown_sec, min_profit_bps, taker_fee_bps, slip_bps.



---

Controls & Compounding

Per-bot capital (pool) and entry size (slot) — editable, persisted.

Start / Pause / Resume / Stop-after-sales (finish open positions, then stop).

Auto-compounding:

Combined intervals 30m, 1h, 1d, 1w, 1M (all active together).

30m-only mode as a separate toggle.

Compounding = move realized PnL → pool_usdt, reset realized PnL; persisted across restarts.




---

Dashboard & API (ETH only in Phase 1)

Flask single page (simple auth) showing:

Start/Pause/Resume/Stop-after-sales

Capital & Entry editors

ATR/fees/slippage/cooldown editors

Compounding toggles

Open positions count, realized PnL, link to logs


JSON API (ETH only):

GET /api/status

POST /api/start|pause|resume|stop_after_sales { "tag": "eth" }

POST /api/save_cap { "tag": "eth", "capital": 800, "entry": 40 }

POST /api/apply_intervals { "tag": "eth", "intervals": ["30m","1h","1d","1w","1M"] }

POST /api/save_atr (fields listed in Strategy section)




---

Reliability & Safety

Binance rate-limit respect; exponential backoff on HTTP-429; safe retries on transient errors.

Precision & min-size checks via exchange filters; never send orders that round to zero.

Optional auto-pause if request rate risks throttling.

Log all actions (without leaking secrets).



---

Deployment (24/7)

Python 3.12 + Flask + gunicorn container (Dockerfile).

Deploy to Fly.io (preferred) or Render:

Mount persistent volume at /data; symlink configs/ state/ control/ logs/.

Secrets (API keys, creds) via platform secret manager; no hard-coded keys.

Healthcheck and simple HTTP auth for dashboard.




---

Deliverables

1. Repo/ZIP with source, Dockerfile, entrypoint.sh, minimal UI, and code comments.


2. Running Testnet demo (Fly/Render) I can log into.


3. README covering local run, env vars, secrets, deploy, logs, update/rollback.


4. Postman collection (or curl examples) for the API.


5. Short video/screenshots: start/pause/resume/stop-after-sales, edit capital/entry & ATR, toggle compounding, and 1 buy + 1 sell on Testnet.




---

Milestones / Acceptance

M1 – Local/Testnet: UI + API work; edits persist; at least 1 buy & 1 sell on Testnet.

M2 – 24/7 Deploy: Live on Fly/Render with /data persistence; secrets set; restart/redeploy keeps state.

M3 – Handover: Final docs, code, and demo materials delivered.



---

Tech & Stack

Python 3.12, Flask, ccxt, pandas, gunicorn, Docker.

Optional: basic front-end (HTML/JS) for the single dashboard page.