CryptoTracker icon indicating copy to clipboard operation
CryptoTracker copied to clipboard

Specify custom buy price

Open OnlyOnePro opened this issue 2 years ago • 1 comments

Currently when you register a new purchase, if the day you are registering the purchase is a previous day; the app takes the average of the price of the coin that day and writes it as the purchase price. ATM, some of my purchases in the portfolio are flagged as losses thanks to this.

Describe the solution you'd like: If you go into the coin page and edit a registry inside it, you should be able to modify the purchase price of the coin. It could be a good idea to make it editable by default and when the user specifies the date of purchase of the coin, launch a query to CoinGecko to specify the average of the coin that day as the default price (Right now it only launches this query when you add the Fiat invested amount, it should also launch this query when the DatePicker component changes the selected date).

Additional context: No additional context

OnlyOnePro avatar Apr 02 '22 10:04 OnlyOnePro

The current way of calculating the "buy price" of a purchase is by simply dividing the invested quantity by the amount of the asset bought (it does not get the price of the coin at the time of the purchase):

priceBought = InvestedQty / CryptoQty


Replying to your comment, yes, I do plan to add a way to manually set the purchase price of an asset. However, either the quantity or the cost of the purchase would be then calculated automatically, because the three of them must retain a relation.

My innitial thought is to let the user input the quantity and price, and calculate the cost accordingly (with fees added to it).

ismaelestalayo avatar Apr 03 '22 22:04 ismaelestalayo