Hello beancount community (beancounters?)

I have been struggling with how to manage retirement accounts in beancount. 
I think my problem may be primarily a conceptual one. Where I get 
particularly confused is in how to handle trades within retirement accounts 
for stocks/funds that have gained value. In these cases we havent realized 
income but there are trades that depend on the value gained for certain 
stocks/funds.

I've included a minimal ledger below where I have tried to create an 
example of where I get confused. In the case of a retirement account when 
the rebalance transaction is performed there are gains relative to the 
average cost of STOCK1. Right now this ledger will throw an error because 
the rebalance transaction lot selection is ambiguous. The ambiguity could 
be resolved with FIFO or LIFO bookkeeping but this is beside the point.

Say we set it to use FIFO bookkeeping. In this case the trade transaction 
as it is currently written does not balance. In beancount where should we 
say that $5 has come from? It isn't really income but it is necessary to 
balance the transaction. I thought about using Equity but then this becomes 
difficult to track the gains of the retirement account as a whole.

I'd appreciate guidance on how to best handle this. Thank you in advance! 
-Alex

option "operating_currency" "USD"

2024-01-01 open Assets:BankAccount
2024-01-01 open Equity:Opening-Balances

2024-01-02 pad Assets:BankAccount Equity:Opening-Balances
2024-01-03 balance Assets:BankAccount 100 USD

2024-12-31 open Assets:Broker:STOCK1 STOCK1 
2024-12-31 open Assets:Broker:STOCK2 STOCK2

2025-01-01 * "investment 1"
  Assets:Broker:STOCK1 10.00 STOCK1 {1.00 USD}
  Assets:BankAccount -10.00 USD

2025-01-02 price STOCK1 2.00 USD

2025-01-02 * "investment 2"
  Assets:Broker:STOCK1 10.00 STOCK1 {2.00 USD}
  Assets:BankAccount  -20.00 USD

2025-01-02 price STOCK2 10.00 USD

2025-01-03 * "trade"
    Assets:Broker:STOCK1 -5.00 STOCK1 {} @@ 10.00 USD
    Assets:Broker:STOCK2 1.00 STOCK2 {10.00 USD}

-- 
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 visit 
https://groups.google.com/d/msgid/beancount/111f010c-6a0b-42b7-9ee7-19c77dd3e131n%40googlegroups.com.

Reply via email to