PR1: scaffold + paper/live DCA bot core, systemd units, tests #1

Merged
DasAoD merged 4 commits from feature/scaffold-and-dca into main 2026-08-28 15:40:10 +02:00
Owner

Erster von vier PRs. Baut das Grundger�st des DCA-Bots.

Inhalt

  • Packaging: pyproject.toml (src-Layout, Console-Script krypto-dca), requirements*.txt, .gitattributes
  • Bot-Kern src/krypto_dca/: validierter config.ini-Loader, SQLite-Layer (schema.sql, Unique-Index als Idempotenz-Garantie), ccxt-Kraken-Client + Paper-Fills, Strategie (Perioden-Key, gewichtete Kaufplanung, Spend-Caps), Snapshot-Recorder, CLI (init-db|buy|snapshot|status), Logging, Notifier-Stub
  • Deploy deploy/: systemd buy.{service,timer} (Mo 08:00 UTC), snapshot@.service + Preis-/Bestands-Timer, Hardening, User krypto-dca
  • Tests + Docs: 20 pytest-Tests (Paper-Mode, Fake-Exchange), docs/SETUP.md (VPS-Walkthrough), config.example.ini

Verifiziert

  • pytest -> 20 passed
  • pip install -e . + End-to-End im Paper-Mode gegen echte Kraken-Kurse: Kauf BTC+ETH, Trades/Snapshots geschrieben, zweiter buy derselben ISO-Woche = No-Op (Idempotenz)

Sicherheit

  • config.ini nie im Repo (nur config.example.ini), auf dem Server chmod 600
  • Kraken-Key ohne "Withdraw Funds" (dokumentiert in README/SETUP/config.example)
  • safety.max_total_spend als harter Cap, safety.max_quote_balance als Wrong-Key-Guard

Co-authored-by: Claude claude@anthropic.com

Erster von vier PRs. Baut das Grundger�st des DCA-Bots. ## Inhalt - **Packaging**: pyproject.toml (src-Layout, Console-Script `krypto-dca`), requirements*.txt, .gitattributes - **Bot-Kern** `src/krypto_dca/`: validierter config.ini-Loader, SQLite-Layer (schema.sql, Unique-Index als Idempotenz-Garantie), ccxt-Kraken-Client + Paper-Fills, Strategie (Perioden-Key, gewichtete Kaufplanung, Spend-Caps), Snapshot-Recorder, CLI (`init-db|buy|snapshot|status`), Logging, Notifier-Stub - **Deploy** `deploy/`: systemd buy.{service,timer} (Mo 08:00 UTC), snapshot@.service + Preis-/Bestands-Timer, Hardening, User `krypto-dca` - **Tests + Docs**: 20 pytest-Tests (Paper-Mode, Fake-Exchange), docs/SETUP.md (VPS-Walkthrough), config.example.ini ## Verifiziert - `pytest` -> 20 passed - `pip install -e .` + End-to-End im Paper-Mode gegen echte Kraken-Kurse: Kauf BTC+ETH, Trades/Snapshots geschrieben, zweiter `buy` derselben ISO-Woche = No-Op (Idempotenz) ## Sicherheit - config.ini nie im Repo (nur config.example.ini), auf dem Server chmod 600 - Kraken-Key ohne "Withdraw Funds" (dokumentiert in README/SETUP/config.example) - safety.max_total_spend als harter Cap, safety.max_quote_balance als Wrong-Key-Guard Co-authored-by: Claude <claude@anthropic.com>
- src-layout package with console script krypto-dca = krypto_dca.cli:main
- runtime dep ccxt; pytest as dev extra; pytest pythonpath = src
- normalise line endings to LF for the Linux target

Co-authored-by: Claude <claude@anthropic.com>
- config.py: typed config.ini loader with validation (mode, weights, live keys)
- db.py + schema.sql: SQLite layer, unique index enforces per-period idempotency
- kraken_client.py / paper.py: ccxt price feed, live cost-based market buy, simulated fills
- strategy.py: period keys, weighted buy planning, per-asset run with spend caps
- snapshot.py: price and balance time series for the dashboard
- cli.py: init-db | buy | snapshot | status; logging_setup.py; notifier.py stub

Co-authored-by: Claude <claude@anthropic.com>
- krypto-dca-buy.{service,timer}: weekly DCA buy, Mon 08:00 UTC
- krypto-dca-snapshot@.service with hourly price and daily balance timers
- oneshot services run as krypto-dca user with systemd hardening

Co-authored-by: Claude <claude@anthropic.com>
- pytest suite for config, db, strategy, snapshot and CLI (paper mode, fake exchange)
- SETUP.md: VPS walkthrough (Kraken key, venv, config, timers, going live)
- config.example.ini: annotated template, never commit the real config.ini

Co-authored-by: Claude <claude@anthropic.com>
DasAoD merged commit 983aa7569c into main 2026-08-28 15:40:10 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DasAoD/krypto-dca-bot!1
No description provided.