Possibility to calculate SOPR for bitcoin

Hi,

I am trying to calculate the SOPR value for bitcoin. For this, I need to compare the prices of utxo-s when spent vs when created. Is this possible to be calculated using the bitquery api only?

I tried to go through the explorer and I am quite new into this, but could not find any reliable way to fetch the UTXOs. Or maybe one can infere utxo-s using the chainflow?

Best and thank you in advance!

You can get minted UXTOs transfer using our APIs…

for example - unspend utxo

Thank you for your reference @gaurav .

I am trying to understand how I can utilize the query you provided for my needs (and sorry if some of my questions have obvious answers which I am not aware of).

In order to be able to calculate SOPR (refering to https://academy.glassnode.com/indicators/sopr/sopr-spent-output-profit-ratio#how-is-it-measured), I need the value of utxo when spent vs when created. I think the query above gives me the value when utxo is being created from a transaction.

How do I get the value of this utxo when spent? I believe its not that straightforward, since multiple utxo-s with different creation times might be included in a transaction and that’s where the real trouble begins for me.

Thank you in advance for your help