Calculating realized cap for bitcoin


I am trying to calculate some on-chain metrics using bitquery API. I am starting with MVRV, for which I need the Market Cap and Realized Cap.

For market cap I already found some resources on this forum, but I yet do not know how to calculate realized cap. Reminder: realized cap is the sum of all utxo-s last moved price, while I am having difficulties finding utxo-s as is.

Any ideas?