Per-asset-class asset net worth split over time

57 views
Skip to first unread message

Denis I

unread,
Aug 28, 2023, 7:10:45 AM8/28/23
to Beancount
Hi all,

a beancount newbie here. Given that I have a standard assets accounts structure:
- Assets:BankA:Checking EUR
- Assets:BankB:Checking USD
- Assets:BrokerA:APPL APPL
- Assets:BrokerA:GOOG GOOG
- Assets:BrokerA:... (more shares, some potentially sold and closed)
- Assets:BrokerB:RSU
- Assets:Pension CHF

Is there a way to build a monthly graph that'd show EUR market values:
- a line per each bank account
- a single line per broker - e.g. Assets:BrokerA and Assets:BrokerB
- a line for Assets:Pension
- (optionally) a line for total assets
 
What I tried:

1. Looking at extensions like fava-dashboards, fava-portfolio-returns, fava_investor, beangrow - these seem to offer either point-in-time asset allocation structure or a single portfolio over time graph.

2. Custom query similar to `SELECT year, month, root(account, 2) as account, convert(units(sum(position)), "USD") AS Market WHERE account ~ "Assets:"` - the results do not sum up to the fava balancesheet report - I think that in that case postings contribute only to the respective months when they were done - which is not a full balance at a given month.

3. Hacking fava code - the "at market value" backend call returns aggregated <date;currency;value> tuples, one could try to create fake currencies like BrokerAUSD, but that'd require providing an explicit price information for these (tying them to USD would aggregete them to USD in the graph)

At this point I suspect that such a graph does not make sense or not useful for some (yet unknown to me) reason. My naive goal with such over-time asset group allocation is to understand what contributed to the growth/decline of my net assets over time - be it passive savings, passive/active investments or etc. Is there a better way to achieve that?


Red S

unread,
Sep 1, 2023, 7:26:37 AM9/1/23
to Beancount

You probably know this already, but a query similar to this will give you the market value for a single point in time:

SELECT root(account, 3), convert(sum(position), "EUR", 2019-12-31) where date <= 2019-12-31 and account ~ "^Assets:Invest"

You might need slightly different queries for your Banks and Pension accounts. Given all of that, the way I would produce the monthly graph is to write a very trivial python script to run this and your other queries and iterate across time. That will give you flexibility as you fine tune your report.

As for your “over-time asset group allocation”, beangrow is what I use for that. Rather than an asset allocation problem, I view it as a rate-of-return problem: how does my top-level rate-of-return (IRR) break down over my accounts and tickers? Is that what you are ultimately wanting, or did I perhaps not fully understand it?

Reply all
Reply to author
Forward
0 new messages