the query for current total supply given in the doc doesn't seem to work for me, is off a fraction of a million (according to pooltool.io) and the resulting value keeps rising with time indicating the amount of ADA that is in UTXOs rather than TotalSupply.
How do I query cardano-db-sync
for total supply?
---update:
I get that the above query only considers the UTxO set for unspent transaction outputs, to which I should add the rewards which haven't been withdrawn yet.. but I am not sure how to do that as the sum of all withdrawals is bigger than the sum of all rewards given:
cexplorer=# select sum(amount) / 1000000 from reward;
--------------------
554006568
cexplorer=# select sum(amount) / 1000000 from withdrawal;
--------------------
875322654
shouldn't all rewards given be bigger than all withdrawals?