Portfolio Accumulate Gain/Loss By Tokens, Daily History

I would like to replicate the query used to generate the underlying data for first chart on your website page: Blockchain Data APIs - Bitquery

The chart is titled ‘Portfolio Accumulated Gain/Loss by Token, Daily History’. I assume the underlying data was generated by one or more GraphQL queries. Can you share the queries used to create this chart?


This can be done using our balance history APIs. Example - Balance History of an address

You need USD data for these tokens to calculate P/L.

USD data can come through our DEX Trade APIs (Pancakeswap Liquidity, Price, ATH and ATL) or market data APIs from 3rd parties.