111 lines
3.0 KiB
Markdown
111 lines
3.0 KiB
Markdown
# scalable-sync
|
|
|
|
Synchronisiert Scalable Capital Broker-Transaktionen nach Wealthfolio.
|
|
|
|
## Voraussetzungen
|
|
|
|
- Docker + Docker Compose
|
|
- Wealthfolio mit MCP aktiviert (`WF_MCP_ENABLED=true`)
|
|
- Scalable Capital: Agentic Investing aktiviert (Profil → Sicherheit)
|
|
|
|
## Dateien
|
|
|
|
| Datei | Zweck |
|
|
|---|---|
|
|
| `Dockerfile` | Container-Image |
|
|
| `compose.yaml` | Docker Compose Config |
|
|
| `.env` | Alle Einstellungen |
|
|
| `scalable_sync.py` | Sync-Adapter |
|
|
| `requirements.txt` | Python-Abhängigkeiten |
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
# Dateien in ein Verzeichnis deiner Wahl kopieren, z. B.:
|
|
# /opt/scalable-sync/ oder ~/docker/scalable-sync/
|
|
|
|
docker compose build
|
|
|
|
# 1. Einmalig einloggen (Session wird im Volume gespeichert)
|
|
docker compose run --rm -it scalable-sync sc login --local-read-only
|
|
|
|
# 2. Test
|
|
docker compose run --rm scalable-sync sc whoami
|
|
docker compose run --rm scalable-sync sc broker holdings --json | jq .
|
|
|
|
# 3. Dry-Run
|
|
docker compose run --rm scalable-sync python /app/scalable_sync.py --once --dry-run
|
|
|
|
# 4. Start
|
|
docker compose up -d
|
|
```
|
|
|
|
## .env
|
|
|
|
```bash
|
|
# Wealthfolio
|
|
WF_MCP_URL=http://wealthfolio:8088/mcp
|
|
WF_MCP_TOKEN=wf_mcp_dein_token_hier
|
|
WF_ACCOUNT_ID=dein-konto-uuid
|
|
|
|
# Optional: Scalable Portfolio-ID (bei mehreren Portfolios)
|
|
SC_PORTFOLIO_ID=
|
|
|
|
# Sync
|
|
SYNC_INTERVAL_HOURS=6
|
|
SC_OVERLAP_DAYS=14
|
|
SC_SETTLED_ONLY=true
|
|
|
|
# ISIN → Wealthfolio-Symbol
|
|
ASSET_MAP={"IE00B4L5Y983":"EUNL.DE","IE00B3RBWM25":"VWCE.DE"}
|
|
|
|
# Container-User
|
|
PUID=1000
|
|
PGID=1000
|
|
```
|
|
|
|
### WF_ACCOUNT_ID finden
|
|
|
|
Wealthfolio → Accounts → Konto anklicken → ID aus der URL kopieren (`/accounts/abc123-def456/...`).
|
|
|
|
### ASSET_MAP
|
|
|
|
JSON-Objekt: `"ISIN": "SYMBOL"`. Wealthfolio-Symbol unter Assets suchen.
|
|
|
|
### SC_PORTFOLIO_ID
|
|
|
|
Nur bei mehreren Scalable-Portfolios nötig. Ermitteln mit:
|
|
```bash
|
|
docker compose run --rm scalable-sync sc broker context show --json
|
|
```
|
|
|
|
## Volumes
|
|
|
|
Docker legt diese Volumes automatisch an — kein manuelles `mkdir` nötig.
|
|
|
|
| Volume | Inhalt | Zweck |
|
|
|---|---|---|
|
|
| `scalable-sync-data` | state.db, audit.jsonl, dead-letter.jsonl | Sync-Status und Logs |
|
|
| `scalable-sync-config` | config.toml, session.json | Scalable CLI Session |
|
|
|
|
**Wichtig:** Ohne `scalable-sync-config` geht die Session bei `docker compose down` verloren.
|
|
|
|
## Befehle
|
|
|
|
| Befehl | Beschreibung |
|
|
|---|---|
|
|
| `docker compose run --rm scalable-sync python /app/scalable_sync.py --once --dry-run` | Testlauf ohne Schreiben |
|
|
| `docker compose run --rm scalable-sync python /app/scalable_sync.py --once` | Einmaliger Sync |
|
|
| `docker compose logs -f` | Logs anzeigen |
|
|
| `docker compose down && docker compose up -d` | Neustart (Session bleibt erhalten) |
|
|
|
|
## Troubleshooting
|
|
|
|
| Problem | Lösung |
|
|
|---|---|
|
|
| "Not logged in" | `docker compose run --rm -it scalable-sync sc login --local-read-only` |
|
|
| Keine Transaktionen | `SC_SETTLED_ONLY` und `SC_OVERLAP_DAYS` prüfen |
|
|
| Unmapped ISIN | ISIN in `ASSET_MAP` ergänzen |
|
|
| Mehrere Portfolios | `SC_PORTFOLIO_ID` setzen |
|
|
| Doppelte Activities | Prüfen ob `WF_ACCOUNT_ID` korrekt ist |
|
|
| Session nach Neustart weg | `scalable-sync-config` Volume in compose.yaml prüfen | |