Open source Β· Self-hosted Β· MIT license

Your portfolio. Your server.
Your rules.

pfm keeps all your investments β€” shares, ETFs, crypto and other holdings β€” in one place, running on your own machine. Daily prices, one base currency, real money-weighted returns, dividend & risk analytics, and Spanish tax tooling. Your data and keys never leave your server.

Python 3.13 FastAPI SQLite / PostgreSQL Docker PDT v2 compatible
localhost:8080 β€” pfm
pfm dashboard: portfolio value, total return, open positions, top holdings and an allocation donut

What it does

The metrics and tools I actually wanted from a portfolio tracker β€” without handing my financial data to anyone.

πŸ€–

LLM-powered import

Paste any broker statement β€” any language, any format β€” and a model extracts the trades and cash deposits/withdrawals. No column mapping. Plus ready-made CSV/XLSX importers for IndexaCapital, MyInvestor, Mintos (P2P), Coinbase and Portfolio Dividend Tracker.

🧩

Tracks what you hold

Stocks, ETFs, index funds, crypto, bonds, commodities and cash β€” across multiple broker "portfolios" β€” plus P2P/savings interest income and off-brokerage assets (cash, property, mortgage) for a true net-worth picture.

πŸ“ˆ

Real return metrics

Money-weighted IRR that accounts for when you added money, total return vs cost basis, and benchmark comparison against an index.

πŸ’Έ

Dividend analytics

Income by month and year, yield-on-cost, projected forward annual income per holding and an income-by-calendar-month view.

πŸ’¬

AI chat & research

Ask about your portfolio in plain language β€” it reads your real holdings and history. Plus a research workbench: fundamentals, a fair-value calculator, a sell calculator, and a downloadable report per ticker.

βš–οΈ

Risk & diversification

Allocation by type, sector and currency, a concentration index, plus maximum drawdown, volatility and the Sharpe ratio from daily snapshots.

🧾

Spanish income-tax tooling

FIFO realised gains per financial year and a Spanish IRPF savings-base (base del ahorro) estimate, plus a per-lot realised-gains report you can export to CSV β€” something no international tool does well.

πŸ”„

PDT & Google Sheets

Full compatibility with Portfolio Dividend Tracker (PDT) v2 β€” a popular dividend tracker that pulls from a handful of brokers or a Google Sheet. pfm reads and writes that same Google Sheet (and the PDT XLSX), so the two stay in sync.

🎯

Goals & watchlist

FIRE goal tracking with projections, a rebalancing calculator, a watchlist with price alerts and an LLM research agent.

πŸ”’

Private by design

Self-hosted. The code is public; your database, API keys and amounts stay in local, gitignored files that never get committed.

A look inside

Screens from the bundled demo account β€” fictional sample data, not a real portfolio. Click any to enlarge.

Dashboard β€” value, return, top holdings, allocation
Analytics β€” gain/loss, returns, dividends, risk & tax
Research β€” fundamentals, fair value & your position
Holdings β€” live value, cost basis, P&L
Import β€” LLM extraction, PDT, CSV, Sheets
Wealth simulator β€” Monte-Carlo (GBM) projection
Transactions β€” buy / sell / dividend history

Run it yourself

pfm ships with Docker Compose, so a self-hosted instance is a few commands away.

  1. Clone & configureGet the code and create your local secrets (never committed).
  2. Start itOne command brings up the API, web client and database.
  3. Open localhost:8080Log in with your API key, add a portfolio, and import your transactions from a file, pasted text, or a Google Sheet.
# 1 Β· clone + configure
git clone https://github.com/alexgoldhoorn/pfm.git
cd pfm
cp .env.example .env.local
# set SERVER_API_KEY and GEMINI_API_KEY in .env.local

# 2 Β· start
docker compose --profile dev up -d --build

# 3 Β· open http://localhost:8080
πŸ’‘ Just want to explore? python scripts/create_demo_account.py --fresh then docker compose -f docker-compose.demo.yml up -d spins up a full demo with realistic sample data at localhost:8081.

πŸ“– Full documentation   πŸ“ Read the write-up

Built on a documented REST API

Holdings, transactions, imports, analytics, tax reports, bookings, watchlist, goals and Google Sheets sync β€” everything the web client does runs through FastAPI. Browse the full, auto-generated reference.

Open the API reference β†’