Proposal on Cost Basis by Mark Lodato

107 views
Skip to first unread message

Martin Blais

unread,
Jul 21, 2020, 9:18:21 PM7/21/20
to Beancount
Just posting this a little more widely in case people missed the original thread.
Mark Lodato and I are having a design discussion on reviewing cost basis for v3 in order to handle commissions right (using the "adjusted" cost basis).
Multiple options being discussed:
http://furius.ca/beancount/doc/proposal-cost-basis

Feel free to add comments,

Andrzej Kotulski

unread,
Jul 22, 2020, 4:53:33 AM7/22/20
to bean...@googlegroups.com

Thank you for this email, I missed that document earlier.
As one point of data, I would like to track both adjusted and unadjusted cost basis (in scripts, so it can be some low level representation).

Context:
In Poland, on some tax report we need to give two numbers:
A=gains/losses during last tax year based on UNADJUSTED cost basis
B=costs we incurred during those transactions (ie. commissions). Commissions on bought lots are realized when selling (could be partially when the lot is sold partially).
Final tax = tax_rate*(A-B)
It means that the end result is the same as in using adjusted cost base, but we need to report both numbers separately.

I'd be great if I could extract that info from beancount (via some script/plugin/query that I write myself)
For a long time, I was planning to implement something like option#3 via some plugin but didn't find time to do it yet.
However, I think option#6 would might work even better.

--
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/CAK21%2BhPrTdaHeeZaHQoY7EMN2hBtV3wfRBOw5zU32D-ae2EVZA%40mail.gmail.com.

Justus Pendleton

unread,
Jul 22, 2020, 10:07:01 AM7/22/20
to Beancount
On Wednesday, July 22, 2020 at 3:53:33 PM UTC+7 Andrzej wrote:

As one point of data, I would like to track both adjusted and unadjusted cost basis (in scripts, so it can be some low level representation).

FWIW, I'm in a similar situation due to needing to deal with multiple tax jurisdictions, some of which allow for adjusted cost basis due to fees and some of which don't.

I've found ways to deal with that so it wouldn't be the end of the world if beancount v3 didn't support it.

Out of curiosity, is this adjust cost basis functionality going to be generalizable? What about, say, adjusting the cost basis of a building via depreciation? Would someone be able to enter a "C" (cost) directive that can adjust the basis of arbitrary assets?

Boyd Kelly

unread,
Jul 23, 2020, 3:04:06 AM7/23/20
to Beancount
Just a question here...  Why is the cost basis not simply calculated in a report instead of adding a bunch of cruft to transactions?   You loop through the transactions and recalculate the cost basis with every purchase (not sale).   I don't see this a part of the transaction, any more than the balance sheet or other reports...   Just a .02.

bk

Martin Blais

unread,
Jul 23, 2020, 6:43:07 PM7/23/20
to Beancount
I think both of these approaches are sensible.
Doing it at report time has the advantage of keeping the transactions free of cruft.
A con though is that you can't just leverage an aggregation (via SQL) to compute what you need.
Doing it by modifying transactions explicitly rebooks the bits and pieces of the P/L that are commissions and you can just choose the right accounts.
OTOH we'd have to automate the modifications to the transactions.

I'm not sure which is best. I'm tempted to make the one that modifies the transactions as a plugin and so selectable.e





--
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.

Martin Blais

unread,
Jul 23, 2020, 6:44:26 PM7/23/20
to Beancount
On Wed, Jul 22, 2020 at 10:07 AM Justus Pendleton <just...@gmail.com> wrote:
On Wednesday, July 22, 2020 at 3:53:33 PM UTC+7 Andrzej wrote:

As one point of data, I would like to track both adjusted and unadjusted cost basis (in scripts, so it can be some low level representation).

FWIW, I'm in a similar situation due to needing to deal with multiple tax jurisdictions, some of which allow for adjusted cost basis due to fees and some of which don't.

I've found ways to deal with that so it wouldn't be the end of the world if beancount v3 didn't support it.

Thanks for contributing this, I think it helps to know both costs must be supported as a goal.


Out of curiosity, is this adjust cost basis functionality going to be generalizable? What about, say, adjusting the cost basis of a building via depreciation? Would someone be able to enter a "C" (cost) directive that can adjust the basis of arbitrary assets?

That's a good question and the current method -- virtualling selling and rebuying at a different cost -- isn't super great.
I'm not sure.

 

--
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.

Martin Blais

unread,
Aug 13, 2020, 10:17:54 PM8/13/20
to Beancount
Doing some computation on my returns tonight, I was fixing a bunch of stuff - there's always inconsistencies to fix somehow - and I noticed that for a subset of accounts I was already doing something to handle the commisions / gains issue with a plugin:

(I should have moved this plugin to the public location but never got around to writing the unit tests for it.)

I've been doing this for just a subset of accounts because for those I'm trying to replicate the cost basis from the 1099 forms exactly (and succeeding). The problem I face there is that those accounts are for RSUs and since they vest regularly I'm subjected to the wash sale rule and so I have had to adjust the cost basis and reporting manually.

See the big docstring at the front of the file for an explanation of this particular solution.



Reply all
Reply to author
Forward
0 new messages