Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Summary: I describe a simple method for accurately calculating the gain/loss for each coin in your portfolio in USD (or any other FIAT currency). I provide a spreadsheet document for the calculation. Also, I show you how you can use the free app, BitcoinCrazyness, to automatically do that for you.
Disclaimer: Iâm the developer of the BitcoinCrazyness app.
Let me begin by a quick example.
Example:
- You buy 1 BTC for $8,000
- A few days later, you buy 1 BTC for $6,000
- Then you buy 1 ETH for 0.07Â BTC
Suppose today, the prices are:
- ETH/USD: 935.448
- ETH/BTC: 0.0799
- BTC/USD: 11,837.5
How much is your gain/loss for ETH in USD?
For simplicity, assume there is no transaction fees.
Naive Calculation:
Your gain in BTCÂ is:
0.0799 - 0.07= 0.0099Â BTC
In order to convert your gain to USD, we multiply the gain in BTC to todayâs value of BTC in USD:
0.0099 x 11,837.5 =Â $117.19
However, this is not the true value of your gain, because the value of BTC changed from the day you bought it several times.
The above calculation completely ignores and is independent of the cost of BTC.
A More Accurate Calculation:
The average cost of each unit of BTC is $7,000 since you bought one unit at $8,000, and one at $6,000.
When you buy 1 ETH for 0.07 BTC, you really are paying:
0.07 Ă $7000 =Â $490
Since ETH/USD is now $935.45, your gain would be:
$935.45 - $490 =Â $445.45
So, your gain is really $445.45, not $117.19.
The following image shows the accurate values for each of your coins:
Explanation:
- You are left with 1.93 BTC, which you bought for an average unit price of $7,000. So the total cost of it is $13,510
- Your total BTC is now worth 22,846.375, so your profit on BTC is $9.336.38.
- Your ETH is now worth $935.448, which cost you $490. Therefore, your true gain is $445.45.
You can do similar calculations either using the free BitcoinCrazyness App, or using this spreadsheet.
A More Complicated Example
Now assume you use your ETH from the previous example and buy some more coins with it. In particular, assume the following is the summary of your transactions:
- You buy 1 BTC for $8,000
- You buy 1 BTC for $6,000
- You buy 1 ETH for 0.07Â BTC
- You buy 1 XMR for 0.33Â ETH
- You buy 1 LTC for 0.25Â ETH
What is the cost for XMR and LTC?
Solution: each ETH costs you $490. Therefore the cost for XMR and LTC in USD is 0.33 Ă 490 = $161.7 and 0.25 Ă $490 = $122.4 respectively.
You can see the gains for each currency in the following picture:
Gain Calculation for Each Coin in USD
In short, gain/loss calculation is not too complicated, but it should account for the average cost of each coin for each transaction. Moreover, it should account for transaction fees.
BitcoinCrazyness App
The BitcoinCrazyness app was started based on the above simple idea. It is a free app that calculates the average cost of each coin and therefore calculates the true gain/loss for each currency in USD and several other FIAT currencies.
In order to enter the transactions quickly, it accepts a CSV file. CSV stands for Comma Separated Value, which is a text file that can be generated from an excel sheet.
Screenshots for BitcoinCrazyness App
The CSV file for the above examples are given at the end of this article.
CSV File Format:
Each trade is specified in one row of the CSV file which has the following columns:
from,to,type,unitBuyPrice,quantity,useHolding,feeCost,feeCurrency
- âfromâ and âtoâ are the currencies for the trade, for example for BTC/USD, from is BTC, and to should be USD
- âtypeâ is the transaction type. It can be buy, sell, deposit or withdraw, which specifies if we are buying/selling the âfromâ part of the trade pair.
- âquantityâ is the quantity of the âfromâ that we are buying/selling.
- âuseHoldingâ specifies if the app should deduct the cost of the trade for your previous holdings
- âfeeCostâ is the transaction cost which can be 0 or higher.
- âfeeCurrencyâ specifies what currency the fee is in.
The following picture shows the output of the app for an even more complicated example with transaction fees:
from,to,type,unitBuyPrice,quantity,useHolding,feeCost,feeCurrencyUSD,USD,buy,1,100000,false,0,NABTC,USD,buy,14000,2,true,500,USDBTC,USD,buy,10000,2,true,500,USDBTC,BTC,buy,10000,2,false,0,NAREQ,BTC,buy,0.00001,20000,true,20,REQETH,BTC,buy,0.01,20,true,0.02,ETHTRX,BTC,buy,0.00001,45000,true,0.2,TRXBTC,BTC,sell,10000,0.1,true,0,NABTC,BTC,sell,10000,0.2,true,0,NAThe Gain/Loss Calculation with Transaction Fees using the BitcoinCrazyness app
Conclusions
Gain/loss calculation should account for the average cost of each coin for each transaction. The transactions should be entered in a chronological order.
If you liked this article please share, comment, and click on the clap icon. I would love to know how you calculate your gain and loss and if you have any feedback for the BitcoinCrazyness app.
Besides gain/loss calculations, the BitcoinCrazyness app provides advanced trailing delta price alerts, latest prices for thousands of coins, and advanced coin queries.
Appendix
The CSV files for the first example:
from,to,type,unitBuyPrice,quantity,useHolding,feeCost,feeCurrencyBTC,USD,buy,8000,1,false,0,USDBTC,USD,buy,6000,1,false,0,USDETH,BTC,buy,0.07,1,true,0,ETH
The CSV file for the second example:
from,to,type,unitBuyPrice,quantity,useHolding,feeCost,feeCurrencyBTC,USD,buy,8000,1,false,0,USDBTC,USD,buy,6000,1,false,0,USDETH,BTC,buy,0.07,1,true,0,NAXMR,ETH,buy,0.33,1,true,0,NALTC,ETH,buy,0.25,1,true,0,NA
Computing True Gain/Loss in Cryptocurrency Trading was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.