broker-sync/broker_sync
Viktor Barzin e83c5a0a8f ibkr: add Flex provider — Trade/Cash mapping + OpenPositions snapshot
Maps Trades (BUY/SELL) and CashTransactions (DIVIDEND, TAX, INTEREST, FEE,
DEPOSIT, WITHDRAWAL) from an IBKR Flex Activity Query to broker-sync
Activity objects. Adds canonical_symbol helper (LSE → .L suffix when
exchange=LSE* or currency=GBP). Exposes OpenPositions for the
reconciliation step that runs at the CLI layer.

Guards against wrong-account writes by checking
stmt.accountId == IBKR_ACCOUNT_ID_UPSTREAM before yielding any activities.

13 unit tests cover all the mappings + the mismatch guard.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 22:28:35 +00:00
..
providers ibkr: add Flex provider — Trade/Cash mapping + OpenPositions snapshot 2026-05-26 22:28:35 +00:00
sinks wealthfolio: add compute_position_qty for broker reconciliation 2026-05-26 22:26:24 +00:00
__init__.py Initial scaffold + canonical Activity model 2026-04-17 19:16:11 +00:00
cli.py fidelity: replace snapshot-push with delta gains-offset DEPOSITs 2026-05-17 00:35:17 +00:00
dedup.py Add SyncRecordStore for authoritative dedup 2026-04-17 19:17:12 +00:00
fx.py Add FxCache and convert_to_gbp core 2026-04-17 19:18:41 +00:00
fx_ecb.py Add ECB FX fetcher + cache population 2026-04-17 19:32:23 +00:00
metrics.py metrics: add Pushgateway client for broker-sync providers 2026-05-26 22:24:55 +00:00
models.py schwab: detect vest-confirmation emails + emit VestEvent 2026-04-19 18:27:58 +00:00
normaliser.py Add Provider protocol and normaliser 2026-04-17 19:20:12 +00:00
pipeline.py pipeline: emit matching DEPOSIT/WITHDRAWAL for every BUY/SELL 2026-04-18 19:12:49 +00:00