Currencies vs. bookable commodities

47 views
Skip to first unread message

nug get

unread,
Nov 24, 2022, 8:17:34 AM11/24/22
to bean...@googlegroups.com
Hi all
how does beancount differentiate between commodities where it keeps track of lots (shares) and those where it does not (currencies)?

For example, I have two commodities USD and VTI (neither is the ledger base currency).

Both are introduced the same way

1970-01-01 commodity USD
    name: "US Dollar"
  price: "CHF:yahoo/^CHFUSD=X"
1970-01-01 commodity VTI
    name: "VTI"
    price: "USD:yahoo/VTI"

accounts are opened the same way
1970-01-01 open Assets:Invest:IB:VTI     VTI
1970-01-01 open Assets:Invest:IB:USD     USD

but still beancount keeps track of VTI lots, but not of USD lots.

Where is the difference between them introduced? How can I control it?

Thanks!
Best,
Nugget

Martin Blais

unread,
Nov 24, 2022, 8:37:11 AM11/24/22
to Beancount
The answer will be surprising: it doesn't.
If you insert a commodity with a cost basis it is stored with the lot. If it doesn't have a cost basis the cost is a null value. You can think of that as a special lot with "no basis basis".

This may need to be revised to be less flexible following the updated booking rules design (the one I wrote a doc about, that supports futures and a simplified and more intuitive reduction syntax, the one that I'll probably have time to implement in 2050 or so)

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAHUjHhE%3DP5M2VK_OD%3DB%3D-d0PCDHXJVkJigKZ2myQ-iSfdNuGHQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages