Query editor
selecttransaction_type,count(case when call_block_time >= current_date - interval '7' day then call_tx_hash end) as n_transactions_past_7d,count(case when call_block_time >= current_date - interval '90' day then call_tx_hash end) as n_transactions_past_3mo,count(*) as n_transactions,count(distinct case when call_block_time >= current_date - interval '7' day then address end) as n_addresses_past_7d,count(distinct case when call_block_time >= current_date - interval '90' day then address end) as n_addresses_past_3mo,count(distinct address) as n_addresses,sum(case when call_block_time >= current_date - interval '90' day then gas_fees_usd end) as total_gas_usd_past_3mo,sum(case when call_block_time >= current_date - interval '7' day then gas_fees_usd end) as total_gas_usd_past_7d,sum(gas_fees_usd) as total_gas_usd,avg(case when call_block_time >= current_date - interval '7' day then gas_fees_usd end) as avg_gas_usd_past_7d,avg(case when call_block_time >= current_date - interval '90' day then gas_fees_usd end) as avg_gas_usd_past_3mo,avg(gas_fees_usd) as avg_gas_usd,avg(num_signers) as avg_num_signersfrom query_3070579 twhere true-- and transaction_type IN ('eth_transfer_with_contract_interaction', 'contract_interaction', 'other')group by 1 order by n_addresses_past_7d desc