$npx -y skills add ya5huk/findash --skill fetch-investmentsUse when the user says "fetch investments", "fetch ibkr", "fetch interactive brokers", "pull portfolio", "fetch brokerage", "snapshot ibkr", or any portfolio-snapshot equivalent — and as the best-effort IBKR step inside daily-run. The connector authenticates only in interactive
| 1 | # fetch-investments |
| 2 | |
| 3 | You pull a live portfolio from Interactive Brokers (IBKR) via the official IBKR connector and write it **directly into SQLite**. The authoritative thing you ingest is the **trade history** — buys/sells go into the `trades` ledger on a **user-mapped account**, which is what powers holdings, the stocks-vs-S&P benchmark, and date-accurate cost basis. You *also* write a **positions snapshot** for reconciliation and new-user bootstrap. Unlike `fetch-bank-data` (which stages files locally for sync to ingest), there is **no document and no staged file** — IBKR is a live API source, written straight to the DB with `source_doc_id = NULL` (the deliberate audit-trail exception; see [`docs/live-sources.md`](../../docs/live-sources.md)). You never touch Drive: persistence is sync's weekly backup. |
| 4 | |
| 5 | **This replaces the old screenshot workflow for new activity.** Historically the user fed trades by dropping screenshots into Drive `dump/`; the connector's trade feed makes that unnecessary going forward. Existing screenshot trades are left untouched — you only ingest connector trades *after* the latest trade already on the mapped account (see [Trades](#3-trades-the-core-judgment-not-mechanics)). |
| 6 | |
| 7 | **One resolved account.** IBKR data attaches to **one findash account**, resolved automatically (see [§1](#1-preconditions--resolve-the-mapped-account)): an existing broker when the ledgers clearly match — for many users the IBKR portfolio is already tracked under another broker (e.g. an Israeli wrapper), and a second account would double-count net worth — or a newly created brokerage account for IBKR-only users. The choice persists as `accounts.live_source='ibkr'`, so it's made at most once. |
| 8 | |
| 9 | **Interactive auth, best-effort everywhere.** The IBKR connector is Anthropic's certified Interactive Brokers connector, added by the user through Claude's connector directory (it's a claude.ai connector, *not* a findash-declared MCP server). It authenticates only in an **interactive** Claude session. `daily-run` attempts this skill best-effort: an interactive daily run pulls fresh IBKR data; the unattended `run_daily.sh` run typically finds the connector unavailable and skips with a `⚠️` warning bullet. You can also run it by hand any time (then re-render). |
| 10 | |
| 11 | **Best-effort.** If the connector isn't connected (the user hasn't added it, or this is a headless session where it isn't available), **skip and report** — never abort. A user who doesn't use IBKR is just the normal skip case. |
| 12 | |
| 13 | ## Where things live |
| 14 | |
| 15 | - IBKR connector: the official **Interactive Brokers (IBKR)** connector, added once by the user via Claude's connector directory (`+` → Connectors → Add connector → Browse connectors → search "ibkr"). It's a **claude.ai connector**, so it is *not* declared in `plugin.json`, and its tool names are connector-specific (not `mcp__plugin_findash_ibkr__*`) — **discover them at run time**, don't hardcode. Confirm it's live with `/mcp` (should read `Interactive Brokers (IBKR) · connected`). |
| 16 | - Config: the `[ibkr]` section of `.secrets/findash`, read via `scripts/lib/findash_secrets.py` → `read_section('ibkr')`: |
| 17 | - `account_name` — **legacy override only.** The mapped account now lives in the DB (`accounts.live_source='ibkr'`); if this key is set it wins once and is backfilled into the marker (see [Resolve the mapped account](#1-preconditions--resolve-the-mapped-account)). New installs never set it. |
| 18 | - `account_ids` / `base_currency` — optional (multi-account subset; non-default base ccy, default `ILS`). |
| 19 | - Local DB: `data/finance.db` (the live working copy; run after a sync so it's current — typically `/findash:sync-finance-data` (or `/findash:daily-run`) first, then this skill, then re-render). |
| 20 | - SQLite schema + conventions: [`docs/sqlite-schema.md`](../../docs/sqlite-schema.md) — the `trades` table (incl. `external_id`), the `positions` table, and the `source_doc_id = NULL` live-source convention. |
| 21 | - IBKR source shape + judgment calls: [`docs/live-sources.md`](../../docs/live-sources.md). |
| 22 | |
| 23 | ## The IBKR connector tools |
| 24 | |
| 25 | The connector exposes ~21 tools under the stable namespace `mcp__claude_ai_Interactive_Brokers_IBKR__*` (a mix of read/snapshot and trading tools). The namespace derives from the connector's display name, so it's the same for every user. |