Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/select project_name,COALESCE(sum(t_24h_txnum),0) as t_24h_tx_num,COALESCE(count(distinct t_24h_address),0) as t_24h_user_num,COALESCE(sum(t_7d_txnum),0) as t_7d_tx_num,COALESCE(count(distinct t_7d_address),0) as t_7d_user_num,COALESCE(sum(t_30d_txnum),0) as t_30d_tx_num,COALESCE(count(distinct t_30d_address),0) as t_30d_user_num,COALESCE(sum(t_90d_txnum),0) as t_90d_tx_num,COALESCE(count(distinct t_90d_address),0) as t_90d_user_num--,--COALESCE(sum(num),0) as t_2022_tx_num,COALESCE(count(distinct "from"),0) as t_2022_user_numfrom(select t1.*,t2."from",COALESCE(t2.num,0) as num,t_24h_address,t_24h_txnum,t_7d_address,t_7d_txnum,t_30d_address,t_30d_txnum,t_90d_address,t_90d_txnum from(select * from query_2069848) t1join(select *,1 as num, date_trunc('day',block_time) as day,case when block_time>=date_trunc('hour', now())- interval '24' hour then "from" end as t_24h_address,case when block_time>=date_trunc('hour', now())- interval '24' hour then 1 else 0 end as t_24h_txnum,case when block_time>=date_trunc('hour', now())- interval '168' hour then "from" end as t_7d_address,case when block_time>=date_trunc('hour', now())- interval '168' hour then 1 else 0 end as t_7d_txnum,case when block_time>=date_trunc('hour', now())- interval '720' hour then "from" end as t_30d_address,case when block_time>=date_trunc('hour', now())- interval '720' hour then 1 else 0 end as t_30d_txnum,case when block_time>=date_trunc('hour', now())- interval '2160' hour then "from" end as t_90d_address,case when block_time>=date_trunc('hour', now())- interval '2160' hour then 1 else 0 end as t_90d_txnumfrom bnb.transactions where block_time>=date_trunc('day', now())- interval '2160' hour and success = True-- and substring(data from 1 for 4) not in (0x41c20811,0xb00b52f1,0x0a5936f1)) t2on t1.contract_address=t2.to) tgroup by project_nameorder by t_24h_tx_num desc,t_24h_user_num desc