Delivered remotely for a business based in Geneva, Switzerland. Names withheld by agreement.
Project Overview
Private banks and independent asset managers in Geneva routinely oversee client mandates spread across multiple Swiss and international custodians, spanning equities, sovereign debt, structured notes, private funds, and multi-currency cash accounts. Consolidating those positions in manual spreadsheets hides the real drivers of performance: currency translation swings get confused with security selection, dividend accruals go missing, and large client capital injections distort naive return percentages.
We built an investment portfolio dashboard using Python, React, and PostgreSQL to give portfolio managers and risk analysts one authoritative lens across fragmented custodians. Python executes deterministic Time-Weighted Return (TWRR), Money-Weighted Return (MWRR), and multi-currency attribution models, PostgreSQL maintains a corporate-action-adjusted security master, and React renders responsive cross-mandate drill-downs.
Consolidated Analytics Challenges
Consolidating institutional and high-net-worth portfolios surfaces subtle data-engineering problems that generic charting dashboards overlook:
- Custodian format fragmentation: Separate custodian banks deliver holdings and cash-flow statements across incompatible CSV layouts, REST schemas, and settlement-date conventions.
- Cash-flow distortion: Without true sub-period TWRR linking, external deposits or redemptions make portfolio performance appear artificially inflated or depressed.
- Currency-effect opacity: Reporting a USD equity sleeve inside a CHF mandate without separating local price movement from USD/CHF spot shifts misleads allocation reviews.
- Corporate-action breakage: Stock splits, reverse splits, and return-of-capital distributions corrupt historical drawdown and benchmark comparisons if not applied retroactively across positions.
Architectural Strategy
We structured the platform around a single reconciled security master feeding a vectorized Python analytics layer. Incoming custodian files normalize first into canonical position, transaction, and cash-flow ledgers inside PostgreSQL, tagged with both trade date and settlement date.
Rather than pre-baking static return numbers per dashboard widget, FastAPI slices daily valuation series from partitioned PostgreSQL tables into Apache Arrow and NumPy arrays. That design allows portfolio managers to re-aggregate holdings dynamically by custom taxonomy—geography, GICS sector, credit rating, liquidity bucket, or reporting currency—while every calculated return stays tied to one verified ledger.
Core Capabilities
- Multi-Custodian Consolidation: Normalizes positions, accruals, and cash movements across bank custodians into unified household or institutional mandates.
- TWRR, MWRR & Benchmark Attribution: Computes geometric Time-Weighted returns, internal rates of return, and multi-currency Brinson-Fachler selection versus allocation effects.
- Interactive Allocation Drill-Downs: React treemaps, stacked exposure bars, and correlation matrices let advisors click from consolidated mandates down to individual CUSIP/ISIN tax lots.
- Risk & Drawdown Diagnostics: Tracks rolling annualized volatility, Sharpe/Sortino ratios, maximum underwater drawdowns, and historical Value-at-Risk scenarios.
- Mandate Limit & Drift Alerts: Flags concentration breaches, currency exposure limits, or cash-drag thresholds against written Investment Policy Statements.
Technical Architecture
Custodian ingestion pipelines parse scheduled bank feeds, validate reconciliation checksums (opening market value plus net flows and P&L equals closing market value), and commit immutable ledger events into PostgreSQL. A dedicated corporate-action processor applies split multipliers and dividend ex-date adjustments across affected security time series.
Flow: Custodian Feeds → Python Reconciliation & Security Master Updater → PostgreSQL Partitioned Valuations → FastAPI Vectorized Engine (Apache Arrow / NumPy) + Redis Slice Cache → React Analytics Workspace
When an analyst opens a mandate in React and toggles reporting currency from CHF to EUR or changes the benchmark window from YTD to five-year rolling, FastAPI checks Redis for an exact hash of (mandate_id, range, currency, taxonomy). Cache misses execute vectorized matrix operations in Python within milliseconds and return compact chart-ready payloads to React.
Technology Stack
| Category | Technology detail |
|---|---|
| Interactive Frontend | React and TypeScript dashboard with drill-down allocation trees and benchmark charts |
| Analytics Engine | Python FastAPI executing TWRR, IRR, Brinson attribution, and drawdown risk routines |
| Columnar Transport | Apache Arrow & NumPy accelerating vectorized portfolio time-series slicing in Python |
| Relational Core | PostgreSQL storing partitioned daily valuations, security master records, and FX tables |
| Computation Cache | Redis caching pre-computed benchmark series and composite mandate attribution slices |
| Custodian Ingestion | Automated parsers normalizing SWIFT/FIX, CSV, and REST custodian position statements |
| Corporate Actions | Deterministic Python handlers adjusting historical shares and prices for splits and dividends |
| Client Reporting | Template-driven quarterly mandate PDFs exporting verified tables and attribution charts |
| Access Governance | Mandate-level RBAC scoping portfolio visibility across advisors and client families |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Computing complex multi-currency attribution on the fly across thousands of daily rows | Pulled daily valuations via Apache Arrow into vectorized NumPy routines and cached common date/currency slices in Redis, trading modest memory consumption for interactive React filtering. |
| Custodian feeds occasionally restate prior-week valuations or cancel settled trades | Implemented versioned ingestion batches with automatic backward recomputation from the earliest restated date, preventing stale cached returns at the cost of targeted background re-runs. |
| Unlisted private equity and real-estate holdings lack daily market prices | Integrated carry-forward valuation policies and lagged NAV interpolation flags inside PostgreSQL, clearly distinguishing marked-to-market public assets from appraisal-valued sleeves. |
| Complex nested family-office ownership structures complicate permission checks | Modeled hierarchical entity-mandate graphs in PostgreSQL materialized paths, keeping React view scoping crisp while requiring controlled updates on entity restructures. |
Security & Mandate Confidentiality
Swiss wealth analytics carries stringent client confidentiality expectations. Every mandate and underlying custodian account number is isolated inside PostgreSQL behind strict role-based access rules verified at the FastAPI dependency layer, ensuring relationship managers view only assigned client books.
Sensitive client identifiers remain decoupled from anonymized instrument codes inside analytical caches, and downloadable quarterly PDF reports carry configurable watermarking and short-lived encrypted retrieval links rather than static shared URLs.
Analytical Performance & Scaling
Daily valuation tables grow steadily across multi-year mandates holding hundreds of securities. Partitioning valuation tables in PostgreSQL by valuation month keeps index footprints compact and enables rapid sequential scans when Python hydrates historical return matrices.
Stateless FastAPI analytics workers scale independently from ingestion parsers, allowing heavy morning custodian reconciliation batches to finish cleanly without slowing down portfolio managers presenting live allocation views in React during client meetings.
Operational Outcomes
Consolidating custodian feeds, corporate actions, and attribution mathematics into a unified Python, React, and PostgreSQL platform modernized portfolio oversight across advisory teams:
- Clear attribution of returns: Advisors separate market beta, active asset selection, and foreign-exchange impact accurately across multi-currency mandates.
- Early reconciliation hygiene: Automated custodian balance checks catch missing dividends or unbooked fees before quarterly client reviews.
- Interactive mandate conversations: Portfolio managers explore stress scenarios, benchmark tilts, and asset-class drill-downs live in React instead of circulating static spreadsheets.
- Consistent institutional governance: Unified valuation logic guarantees that dashboard metrics, risk alerts, and exported quarterly client packs always reconcile.