Hello, fellow PTAers!
I have been tracking (Brazilian) bonds and taxes in hledger and this post is intended as both my asking for tips and as a discussion on how to automate these records.
Here's my use case: when I go to my broker and look at a bond, it tells me both the gross rentability (how much my money grew) and the net rentability (total money minus due taxes at the expiration date). The gross amount increases daily at a variable rate, while the net amount equals
NetTotal = InitialAmount + GrossEarning*(1-Tax)
Where Tax
varies with how long I keep the money invested
- 22.5% until 6 months
- 20% until 1 year
- 17.5% until 2 years
- 15% thereafter
So the net amount increases steadily but gets a bump whenever we cross one of the boundaries.
What is a good way to keep track of both these amounts using hledger?
Right now, I am trying two ideas on how to model it and would be happy to hear your opinion on them!
Directly track the money
We can record all cash flows using these accounts
account assets:bond ; The total money
account liabilities:bond:tax ; How much taxes are due
account revenues:bond ; The money I earn
account expenses:tax ; The money I pay
Let's say I start the year buying $1000 on this bond.
2024-01-01 * Investment
assets:bond $ 1000
assets:bank $-1000
Although the earnings are daily, for the sake of my sanity, I can add a transaction at the end of each month recording the earnings. Let's say the end of January, the gross earnings are $100. I debit a revenue for it and pay the future taxes using the liability.
2024-01-31 * Investment earnings
assets:bond $ 100
assets:revenue $-100
; Due taxes
expenses:tax $ 22.5 ; To be paid on expiration date
liabilities:bond:tax $-22.5
This works ok, and I can assert the rentability with the values in my broker by checking
- Gross =
assets:bond
- Net =
assets:bond - liabilities:bond:tax
Finally, each time the tax rate changes, there is a transaction "taking back" from the expenses:tax
account. To be fair, I find it strange to debit an expense account, but it works nevertheless.
2024-07-01 * New tax rate
liabilities:bond:tax = $ 2500
expenses:tax
This approach works but I have to manually record everything, even though the rates and proportions are fixed. So, I've also been experimenting with using prices.
Bonds as commodities
I recently found out that I can download daily data from my broker about how much the bonds value. So, another idea is to automatically download this data (as one usually does with stocks, for example) and turn them into P directives.
We start with a 1 to 1 correspondence and then increase it.
commodity 1.00 "BOND"
P 2024-01-01 "BOND" $ 1
P 2024-01-02 "BOND" $ 1.001
P 2024-01-03 "BOND" $ 1.0013
From time to time, I can just go to my broker and an assertion for the total amount. And that's it. No more revenues nor expenses.
This is a lot less work! Nevertheless, I don't know how to keep track of the net rentability... Do you guys have any idea for also automating the rates?
I thought about keeping a liability account with a fraction of the total BOND due. But this seems strange.