Hi folks,
I use a FIFO methodology for capital gains but with STRICT booking, inputting the lots I sell explicitly (relying heavily on vim-beancount's GetContext, but increasingly also automating this with importers that accept the prior entries).
I have two reasons: I'm affected by the "transfer lots with cost" issue discussed at length in crypto contexts, but a crypto transfer with a fee means increasing the cost base slightly while preserving the date. All things considered, this is safer to do explicitly so I can see what's going on. I also find it personally preferable for everything to be explicitly expressed in the text. It's aesthetically appealing and reassuring to me that I haven't misunderstood beancount if it's done explicitly.
Which brings me to my question: I have in mind a plugin that would check the transactions after all the parsing and processing is complete, and assert that the lots I've explicitly reduced are the ones that are consistent with a FIFO approach.
I think this is something useful and that I could reasonably write (and open-source) when I have time, but I wanted to ask if anyone's aware of an existing plugin that does this?
A further thought is that if I choose `option "booking_method" "FIFO"`, then it would be extremely cool if beancount would not just interpolate missing bookings according to FIFO but also consider it an error if I have explicitly booked a reduction that doesn't conform to FIFO. I'll leave it up to Martin to decide whether this validation is in the scope of `booking_method` or whether this belongs to a plugin.
Thanks for reading!