I have been studying utxos on the mainnet and have run into some interesting inconsistencies.
If you run this query against cardano-db-sync's cexplorer database:
select sum(value)
from block
inner join tx on block.id = tx.block_id
inner join tx_out on tx.id = tx_out.tx_id
-- Get genesis block
where epoch_no is null
-- Filter "test ada" (idk ctrl f "test ada" here https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/interesting-queries.md)
-- FYI there is 100,000,000 lovelace worth of "test ada"
and tx_out.value <> 1000000
----------------------------
3111248464500000000
You will get 31,112,484,645 Ada which is one ada less than the 31,112,484,646 Ada the Cardano website claims was created in the genesis block.
Any insight behind this single extra Ada would be greatly appreciated!
On that same note, the discrepancy becomes 99 Ada if we don't remove the "Test Ada". From what I've seen, the "Test Ada" has been incorporated into the utxo set as if it is normal Ada. Really curious as to what's going on here! I'm building tools for measuring Ada distribution over time and would like to be precise about the accounting.
Anddd if you're feeling extra helpful, I don't understand the story behind why outputs are omitted from genesis after the Allegra hard fork.
Sorry for multiple questions, thanks in advance!