Query editor
-- part of a query repo-- query name: wld_circulating_supply-- query link: https://dune.com/queries/4129347with all_cs_events as (select * from dune.world.result_wld_circulating_supply_events_by_day_metadata), delta_csupply_daily as (select"date", sum(amount) as amountfrom all_cs_eventsgroup by 1), csupply_daily as (select "date"-- 7.5e9 as the basis because:-- 1. 10e9 tokens were minted at inception. This shows up as a -10e9 value bogus emission in the events. (could be fixed SOMEDAY)-- 2. 2.5e9 team/investor tokens were locked up off-chain. These were minted directly to an external address. Their release is registered as an emission event., 7.5e9 + sum(amount) over (order by "date") as amount, amount as new_amountfrom delta_csupply_daily)select "date", amount, amount/1e6 as amount_counter, new_amount, new_amount/1e6 as new_amount_counter, new_amount / amount * 100 as new_amount_rel_pct, avg(new_amount/amount) over (order by "date" rows between 29 preceding and current row) * 100 as new_amount_rel_pct_30dfrom csupply_dailywhere "date" >= date '2023-07-24'and date <= current_dateorder by "date" desc