Beyond Net Worth: True Wealth Tracking with Beancount (Unrealized Gains, Asset Allocation, Rebalancing)
Hey everyone,
I’ve been using Beancount for about 3 years now, and for the longest time, I obsessed over one number: my net worth. Every month, I’d run my queries, update my spreadsheet, and watch that number (hopefully) tick upward. It felt good—like I was winning the personal finance game.
But about six months ago, I had a wake-up call. My net worth had grown nicely thanks to a strong market run, but when I dug deeper, I realized my portfolio was completely out of whack. My tech stocks had ballooned to nearly 60% of my holdings (way above my 40% target), my bond allocation had drifted down to almost nothing, and I had no idea how much unrealized gain I was sitting on—or what it would cost me in taxes to rebalance.
Net worth alone doesn’t tell the full story. It’s like judging a car’s health by only looking at the odometer. You need to check the engine, the tire pressure, the oil—all the systems working together.
So I started building out what I call my “wealth health dashboard” in Beancount. Here’s what I track beyond just net worth:
1. Unrealized Gains/Losses: The Hidden Tax Liability
This is huge, especially in 2026. I recently read that navigating elevated unrealized gains has become a central portfolio theme this year, with tax implications that can seriously impact your rebalancing decisions.
In Beancount, I track this by maintaining accurate commodity prices and using custom queries to calculate the difference between current market value and cost basis for each holding:
SELECT
account,
cost(sum(position)) as cost_basis,
value(sum(position)) as market_value,
value(sum(position)) - cost(sum(position)) as unrealized_gain
WHERE account ~ 'Assets:Investments'
GROUP BY account
This tells me exactly which positions have significant gains (meaning high tax costs to sell) vs losses (potential tax-loss harvesting opportunities). For tax planning, I add metadata to track acquisition dates and specific lot information.
2. Asset Allocation Drift: The Silent Portfolio Killer
Here’s what I learned: a meaningful drift typically occurs when any asset class moves more than 5% away from its target weight. When markets make big moves (like 2024-2025), portfolios can drift significantly in a short period.
I created a target allocation in a separate file:
2020-01-01 * "Target Allocation"
Assets:Investments:Target:Stocks 40.00%
Assets:Investments:Target:Bonds 30.00%
Assets:Investments:Target:RealEstate 20.00%
Assets:Investments:Target:Cash 10.00%
Then I run monthly queries comparing my actual allocation to these targets. When I see something drift beyond 5%, I know it’s time to review. Sometimes that means rebalancing, but if the position has huge unrealized gains, I might add new contributions to underweight categories instead.
3. Tax-Loss Harvesting Opportunities
This is where Beancount really shines. With proper cost basis tracking and commodity prices updated regularly, I can identify positions sitting at losses that could offset my capital gains.
The key is respecting the wash sale rule—you can’t buy the same or “substantially identical” security within 30 days of selling at a loss. I’ve read that SEC enforcement has gotten serious about this in 2026, with robo-advisors getting fined for wash sale violations.
My approach:
- Track each purchase as a separate lot with metadata
- Flag any position showing unrealized losses
- Check a 30-day window before and after any planned sale
- Document everything in transaction comments
The big platforms automate this with AI now, but honestly, I like having full control and transparency with Beancount.
4. Quarterly Reviews: The Rhythm That Works
After experimenting with different frequencies, I settled on quarterly reviews for rebalancing decisions. Monthly felt too reactive to market noise, and annual wasn’t responsive enough. Quarterly hits the sweet spot—it’s the standard recommendation for long-term investors.
During each review, I generate:
- Current vs target allocation (pie charts in Fava)
- Unrealized gain/loss report
- Tax-loss harvesting opportunities
- Rebalancing recommendations with tax implications
5. The Fava Dashboard Dream
I’m currently building a custom Fava dashboard that displays all these metrics in one view. The goal is to see at a glance:
- Net worth trend (yes, still important!)
- Asset allocation drift heatmap
- Positions with significant unrealized gains/losses
- Tax-loss harvesting candidates
- Projected rebalancing costs
It’s a work in progress, but the plain text foundation of Beancount makes it all possible.
The Real Question: How Are You Tracking This?
I’m curious how others in the community approach wealth tracking beyond simple net worth. Do you:
- Track unrealized gains actively, or only worry about it at tax time?
- Have automated drift detection, or review manually?
- Use Beancount for tax-loss harvesting, or rely on your broker?
- Have custom queries or plugins you’d recommend?
The average high-net-worth investor holds half their portfolio in public equities, with significant complexity in private holdings and alternatives. For those of us managing serious portfolios in Beancount, having this detailed visibility feels essential.
Would love to hear your approaches, especially if you’ve built tools or queries that make this easier!
— Fred