Upon further reading, it seems that rounding error should be considered one type of "commission," and beancount does not properly handle commissions as noted in the docs <https://docs.google.com/document/d/1WjARst_cSxNE-Lq6JnJ5CC41T3WndEsiMw4d46r2694/edit#heading=h.gy32bzj5jx1w>. There was a proposal to fix this from 2014, Inventory Booking Improvements <https://docs.google.com/document/d/1F8IJ_7fMHZ75XFPocMokLxVZczAhrBRBVN9uMhQFCZ4/>. Has any progress been made on that front? In the meantime, how do beancount users keep track of the actual, taxable capital gains?
On Fri, Feb 14, 2020 at 10:18 PM <[email protected]> wrote: > On Tuesday, February 11, 2020 at 11:50:02 PM UTC-5, Martin Blais wrote: >> >> Thanks Mark for the well-written question. >> I'm not sure if this relaxation always makes sense (e.g. for currencies), >> but it certainly seems like it would be sensible for investment commodities >> like this. >> I'd want the default to be full precision and only when you override the >> tolerance for VTSMX would it take effect (and relax the check). >> >> The real problem is that in general there's no balance check on the >> units, only on the "weight" of each posting. >> While in your simple example it seems trivial to compute the sum of the >> VTSMX equivalents, in general (> 2 postings, some in other currencies, >> etc.) it's not something that's already being calculated, and that's >> probably not an easy addition. >> >> Maybe we can come up with some other heuristic to relax the tolerance in >> terms of USD, so that the maximum of a list of tolerance values (in USD) >> gets used in the current check. I'd be inclined to consider even a >> per-transaction override. >> >>> >>> > Actually it ends up that this feature already exists! The > "infer_tolerance_from_cost" option has exactly the same effect as what I > proposed, except it does it using the currency of the cost/price. I found > this when trying to implement it myself. :) > > ...but... > > That said, I now believe that *my original transaction was wrong*. The > cost basis was *not* "25.99 USD per share" but simply "3,331.23 USD > for 128.174 units". From the IRS's perspective, if I later sell the entire > lot, the cost basis should be precisely 3,331.23 USD, not 3,331.24226 USD. > If I were to sell 100 units, the cost of those 100 units would be > round((3,331.23 USD / 128.174) * 100, 2) = 2,598.99 USD, and the remaining > cost would be 3,331.23 - 2,598.99 = "732.24 USD for 28.174 units". There is > a bogleheads thread > <https://www.bogleheads.org/forum/viewtopic.php?t=70368> about this. > > In other words, the rounding is an immediate unrealized capital gain or > loss. > > That said, it sounds like Vanguard may not keep track of the cost basis as > a 2-tuple (units, cost) but rather as a cost-per-share rounded (or > truncated?) to 4 (or 5?) decimal places. So, if I want to match Vanguard's > 1099-B, it sounds like I should use the following: > > 2009-09-14 * "Buy" > Assets:Checking -3,331.23 USD > Assets:Vanguard:VTSMX 128.174 VTSMX {25.9899 USD} > > This indeed balances. No need for the "infer_tolerance_from_cost" option. > So that is what I'll do. I'll let you know how it works out; it'll take me > some time. > > I'd also be interested to hear if anyone else has figured this out or if I > am incorrect. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Beancount" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/beancount/B2hxF6N7y6s/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/ce48b65a-7e09-44ed-b7c7-aafc16937b90%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/ce48b65a-7e09-44ed-b7c7-aafc16937b90%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAHREChhdq8f1oB6L1NvSrf9Y9Gqa725adB-KJioeWzQ37OoY_Q%40mail.gmail.com.
