Context
Managing a diversified investment portfolio often pits convenience against privacy. Cloud platforms offer seamless tracking but require uploading sensitive financial data to third-party servers. Finarius was designed to eliminate this compromise, offering a self-hosted alternative that rivals the analytical depth of premium services like Finary while keeping 100% of the data on the user's machine.
The project serves as a complete "Local-First" financial hub, capable of reconstructing historical performance and projecting future trends from raw transaction data and real-time market feeds.
Technical Architecture and Engineering
Finarius is built with a modular Python stack, using Streamlit for the interface, Pandas for data processing, and SQLite for local persistence.
Portfolio Engine
At the heart of Finarius is a custom engine designed to reconstruct a portfolio's state at any point in time. Unlike simple spreadsheets, the engine processes the entire transaction history to calculate:
- Historical Accuracy: Reconstructs positions at any date to generate "value over time" snapshots
- Cost Basis (PRU): Implements FIFO (First-In, First-Out) logic to calculate average unit cost, accounting for transaction fees for precise gain/loss reporting
- Asset Versatility: Supports multiple asset classes (stocks, ETFs, savings accounts) in various currencies and accounts
Integrated Market Data Pipeline
To provide professional-grade insights without manual entry, I integrated the Yahoo Finance (yfinance) API.
- Automated Sync: The system fetches historical and real-time prices to visualize progression before the app even launches
- Resilient Cache: To respect API rate limits and enable offline analysis, price data is cached in a local SQLite database with configurable expiry
Advanced Financial Analytics
Finarius differentiates itself by calculating complex risk and return metrics typically reserved for premium offerings.
Performance Indicators
The platform computes a suite of time-weighted and money-weighted returns for an objective view of performance:
- TWRR & IRR: Eliminates distortions caused by external cash flows (deposits/withdrawals) to measure true investment skill
- Risk Metrics: Calculates the Sharpe ratio for risk-adjusted returns and Max Drawdown to evaluate volatility and drawdowns
Technical Indicators
Beyond simple P&L, the system evaluates the portfolio's sensitivity to market movements by calculating Beta against benchmarks like the S&P 500, allowing users to understand exposure to broader market shifts.
Security and Data Sovereignty
The primary constraint of this project was absolute data privacy.
- Zero Telemetry: No tracking, no third-party analytics, no cloud sync. The only outbound network traffic is to the Yahoo Finance API for price updates
- Auditability: MIT-licensed open-source project; every calculation and database interaction can be audited by the user, ensuring no hidden vulnerabilities or data leaks
Takeaway
Finarius is a response to the "SaaS-ification" of personal finance. It demonstrates that professional-grade financial tools do not require sacrificing data privacy. By combining Python's flexibility with the robustness of local SQL storage, Finarius provides a scalable, private, and powerful framework for the investor.


