Query editor
withapriori_DP as (selectblock_time, tx_from as signer, bytearray_to_int256(varbinary_substring(data,1,32))/1e18 as amount_depositedfrom monad_testnet.logswhere tx_to = 0xb2f82d0f38dc453d596ad40a37799446cc89274aand topic0 = 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7and block_time between now() - interval '3' month and date_trunc('day', now()) - interval '1' second), apriori_WD as (selectblock_time, tx_from as signer, bytearray_to_int256(varbinary_substring(data,1,32))/1e18 as amount_burned--, bytearray_to_int256(from_hex(regexp_extract_all(cast(substr(data, 3) as varchar), '(.{64})', 1)[1])) / 1e18 as amount_redeemed--, amount_burned - amount_redeemed as platform_feefrom monad_testnet.logswhere tx_to = 0xb2f82d0f38dc453d596ad40a37799446cc89274aand topic0 = 0x8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bfand block_time between now() - interval '3' month and date_trunc('day', now()) - interval '1' second), fusion as (selectdate_trunc('day', coalesce(dp.block_time, wd.block_time)) as day, coalesce(dp.signer, wd.signer) as signer, amount_deposited, amount_burnedfrom apriori_DP dp full outer join apriori_WD wdon dp.block_time = wd.block_timeand dp.signer = wd.signer)selectday, count(distinct signer) as users, sum(amount_deposited) - sum(amount_burned) as apriori_net_flow, 3237000 + sum(sum(amount_deposited) - sum(amount_burned)) over (order by day asc) as apriori_circ_supplyfrom fusiongroup by 1order by 1