Query editor
-- BEGIN CODEWITHcontracts as (SELECT * FROM query_2118328 -- Elephant Money Contracts-- SELECT * FROM query_1909117 -- Elephant Money Contracts),-- Net of TRUNK minting and burning grouped per wallettransfers AS --(SELECTDAY,SUM(amount) AS amountFROM(SELECTDATE_TRUNC('day', evt_block_time) AS DAY,-cast(value as double) AS amountFROM elephant_bnb.ElephantDollar_evt_Transfer trWHERE contains((select address from contracts where name = 'TRUNK'), contract_address) -- TRUNKAND ( contains((select address from contracts where name = 'TRUNKReserve'), to) -- TRUNK ReserveOR to = 0x0000000000000000000000000000000000000000)UNION ALLSELECTdate_trunc('day', evt_block_time) AS DAY,cast(value as double) AS amountFROM elephant_bnb.ElephantDollar_evt_Transfer trWHERE contains((select address from contracts where name = 'TRUNK'), contract_address) -- TRUNKAND ( contains((select address from contracts where name = 'TRUNKReserve'), "from") -- TRUNK ReserveOR "from" = 0x0000000000000000000000000000000000000000)) as tGROUP BY 1order by day asc),min_day AS (SELECT min(day) as d FROM transfers),max_day AS (SELECT max(day) as d FROM transfers),day_sequence AS (SELECT sequence((select cast(min_day.d as date) from min_day), (select cast(max_day.d as date) from max_day), interval '1' day) as seq),days AS(SELECT*FROM day_sequenceCROSS JOIN unnest(seq) as days(DAY)),-- Net of minting summed and grouped per daybalance_by_day as (SELECTd.day,sum(t1.amount/1e24) as value_M,sum(t1.amount/1e18) as value