ananthakumaran / paisa

Paisa – Personal Finance Manager. https://paisa.fyi demo: https://demo.paisa.fyi
https://paisa.fyi
GNU Affero General Public License v3.0
2.34k stars 117 forks source link

Net investment not calculated on FIFO basis #141

Open r-chaitanya opened 7 months ago

r-chaitanya commented 7 months ago

Graph before withdrawal: image

Withdrawal: image

Graph after withdrawal: image

Net investment goes from 17000 to 9700 after withdrawal of 7300. Instead we should be extinguishing units on FIFO basis and calculate Net investment remaining after that.

Cheers!

Thank you developing this.

ananthakumaran commented 7 months ago

Yes, as of today it's just an addition/subtraction on buy/sell. I assumed the net part would make that clear (I understand doing this way would make net investment go negative when you withdraw all money). I will have a look at it again and see if FIFO would make sense. If you have resources that talk about this stuff feel free to share the links here. I also don't know if FIFO could be applied universally. I do apply FIFO on tax harvesting page where the usage is clear.

r-chaitanya commented 7 months ago

That makes sense. I was trying to reconcile with the Kuvera app.

Mutual funds and stocks can have 2-3 prepectives to them - Realised, unrealised, and, total. It seems like we are looking at "total" aspect in the paisa app, except for the "Balance" amount which is unrealised only.

We can make some changes to labels to align with current industry standards (atleast in India).

For eg, (making these suggestion after looking at few bank apps and broker apps)

  1. "Balance" could become >> "Current Value" or "Market Value"
  2. Adding "Realised + Unrealised" subline for "Gain / Loss"
  3. I couldnt find equivalent term of "Net investment" as used currently in the paisa app. But most apps use some derivative of the word "Invested" to display (average price based on FIFO) x (units or shares). Not sure, but may be calling "Net investment" as "Principle Amount" or "Outstanding principle amount" makes more sense?
  4. In long term, it would be great to have realised, unrealised, and total aspects of equity seperated from each other.

What do you think?

ananthakumaran commented 7 months ago

Thanks for the feedback, let me take some time and think through it. Couple of things I have realized so far

1) Everyone attaches different meanings to words, probably it's better to document it somehow (tooltips or glossary page) and use it consistently. I am using Market Value in assets > balance page, but Balance in other places.

2) The vocabulary between banking and security investment seems to be different. I am kind of mixing them here and there. I need to use a consistent vocabulary. Bringing in the concept of realized/unrealized would make sense as well. Using FIFO for withdrawal instead of letting net investment go negative might also be better, let me think a bit. Some of the changes like realized/unrealized might make the charts complicated, in general, negative values are hard to visualize when you use an area chart.

sdhawade commented 4 months ago

I am seeing the same issue when I see XIRR calculated incorrectly where there are multiple buy and sell transactions for the same instrument. Using FIFO the XIRR is very different (as calculated by ZeroDha) vs what paisa shows. For all MF and equity instruments FIFO is the norm atleast in India so this can be an option for all calculations.