Risk controls, alerts, API token, more exchanges, presets #1

Merged
matitos merged 1 commits from feat/risk-notify-exchanges-presets into main 2026-09-18 21:39:07 +02:00
Owner

Summary

  • Risk controls / kill switch: RiskManager halts + flattens on max daily loss and drawdown, caps position size and trades/day. Manual POST /api/bot/kill.
  • Notifications: Telegram + generic webhook on trades, errors and halts (best-effort).
  • API token: optional bearer token on /api, injected server-side by the frontend nginx.
  • Exchanges: Kraken + Coinbase market data; Coinbase live broker. Unsupported live exchange now errors.
  • Presets: /api/presets CRUD + UI.
  • Fix: idempotent additive-column migration so existing SQLite DBs upgrade in place.

Testing

  • Backend: 67 tests pass, ruff clean.
  • Frontend: build + 5 tests pass.
  • Smoke-tested against live Binance/Kraken/Coinbase data and the kill switch.
## Summary - **Risk controls / kill switch**: `RiskManager` halts + flattens on max daily loss and drawdown, caps position size and trades/day. Manual `POST /api/bot/kill`. - **Notifications**: Telegram + generic webhook on trades, errors and halts (best-effort). - **API token**: optional bearer token on `/api`, injected server-side by the frontend nginx. - **Exchanges**: Kraken + Coinbase market data; Coinbase live broker. Unsupported live exchange now errors. - **Presets**: `/api/presets` CRUD + UI. - **Fix**: idempotent additive-column migration so existing SQLite DBs upgrade in place. ## Testing - Backend: 67 tests pass, ruff clean. - Frontend: build + 5 tests pass. - Smoke-tested against live Binance/Kraken/Coinbase data and the kill switch.
matitos added 1 commit 2026-09-18 21:27:31 +02:00
Risk controls, alerts, API token, more exchanges, presets
CI/CD / backend (pull_request) Successful in 6m18s
CI/CD / frontend (pull_request) Successful in 4m55s
CI/CD / build (pull_request) Skipped
CI/CD / deploy (pull_request) Skipped
CI/CD / cleanup (pull_request) Skipped
03dfa369e5
- RiskManager halts + flattens on max daily loss / drawdown, caps position
  size and trades per day; adds a manual kill switch (POST /api/bot/kill).
- Telegram and webhook notifications on trades, errors and halts.
- Optional API bearer token on /api, injected server-side by the frontend
  nginx so the browser never sees it.
- Kraken and Coinbase market data (public); Coinbase live broker. Live on an
  unsupported exchange now errors instead of silently falling back to paper.
- Strategy presets backed by the StrategyConfig table (CRUD API + UI).
- Idempotent additive-column migration so existing SQLite databases upgrade in
  place (fixes the new strategy_configs.name column).
matitos merged commit 186a6949ee into main 2026-09-18 21:39:07 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: matitos/crypto_trading#1