📄️ Overview
Profit and Loss calculation in crypto is not easy to build. However, it is an important metric while evaluating the financial performance of an asset. In this tutorial, we will see how to build a simple profit and loss calculator in Javascript using Bitquery's DEXTrades API
📄️ Calculating Profit or Loss Over Time
This is the first step, where we calculate the Weighted Average of Buy Price(WABP) by getting all the buy trades of the token.