Query editor
-- =====================================================================-- QUERY: cirBTC - Validation - Supply Reconciliation and Label Coverage-- PURPOSE: Two checks in one query:-- 1. Computed supply (sum mints - sum burns) -- cross-check this number-- against the live totalSupply() on Etherscan for the contract.-- 2. Label coverage -- how many distinct addresses are still falling-- into Unknown Wallet/Unknown Contract vs labeled. At current scale-- (single digits of addresses) this should be ~0% unlabeled once-- the manual override table is seeded; today, before seeding, it-- will show ~100% Unknown, which is expected and not a bug.-- =====================================================================with supply_check as (selectsum(case when is_mint then amount else 0 end) as total_minted,sum(case when is_burn then amount else 0 end) as total_burned,sum(case when is_mint then amount else 0 end) - sum(case when is_burn then amount else 0 end) as computed_supplyfrom dune.koition.result_cirbtc_base_transfers),distinct_addrs as (select "from" as addr, from_label_type as label_type from dune.koition.result_cirbtc_base_transfersunionselect "to" as addr, to_label_type as label_type from dune.koition.result_cirbtc_base_transfers),label_coverage as (selectlabel_type,count(*) as num_addressesfrom distinct_addrsgroup by 1)select(select computed_supply from supply_check) as computed_circulating_supply,(select total_minted from supply_check) as total_minted_alltime,(select total_burned from supply_check) as total_burned_alltime,label_type,num_addresses,num_addresses * 100.0 / (select count(*) from distinct_addrs) as pct_of_addressesfrom label_coverageorder by num_addresses desc