Query editor
WITHsender as (SELECTtx."from" as account, tx.to as tx_to, tx.hash as tx_hash, ((tx.gas_limit*cast(tx.gas_price as double))/1e18) as fee, cast(tx.value as double)/1e18 as mon_valueFROM monad_testnet.transactions txWHERE tx.successAND tx.to NOT IN (SELECT addressFROM monad_testnet.creation_traces)AND tx."from" NOT IN (SELECT DISTINCT "from"FROM monad_testnet.transactionsWHERE to IN (SELECT DISTINCT addressFROM monad_testnet.creation_traces))AND tx."from" IN (SELECT accountFROM query_5652905)), agg_stat as (SELECTaccount, count(distinct tx_to) as address_sent_to, sum(fee) as total_gas_used, sum(mon_value) as total_mon_sentFROM senderGROUP BY 1), levl as (SELECTrow_number() over(ORDER BY total_mon_sent DESC) as rank, *, case when total_mon_sent < 100 then 'tier1' when total_mon_sent > 100 and total_mon_sent < 1000 then 'tier2' when total_mon_sent > 1000 and total_mon_sent < 10000 then 'tier3' when total_mon_sent > 10000 and total_mon_sent < 50000 then 'tier4' else 'tier5' end as levFROM agg_stat gWHERE total_mon_sent > 1AND address_sent_to >= 1ORDER BY total_mon_sent DESC), comb_ as (SELECTsum(case when lev = 'tier1' then 1 else 0 end) as tier1, sum(case when lev = 'tier2' then 1 else 0 end) as tier2, sum(case when lev = 'tier3' then 1 else 0 end) as tier3, sum(case when lev = 'tier4' then 1 else 0 end) as tier4, sum(case when lev = 'tier5' then 1 else 0 end) as tier5FROM levl), fstep as (SELECTrank, account, address_sent_to, total_gas_used, total_mon_sent, case when lev = 'tier1' then t.tier1 when lev = 'tier2' then t.tier2 when lev = 'tier3' then t.tier3