Query editor
WITHdaily_stats AS (SELECTDATE(block_time) as date,COUNT(*) as total_transactions,-- Count unique 'from' addresses (wallets that sent transactions)COUNT(DISTINCT "from") as unique_sender_wallets,-- Count unique 'to' addresses (wallets that received transactions)COUNT(DISTINCT "to") as unique_receiver_wallets,-- Count combined unique wallets (both senders and receivers)COUNT(DISTINCT CASEWHEN "to" IS NOT NULLAND "from" IS NOT NULL THEN CONCAT(CAST("from" AS VARCHAR), CAST("to" AS VARCHAR))END) as total_interactions,-- Sum of successful transactionsSUM(CASEWHEN success = true THEN 1ELSE 0END) as successful_transactions,-- Average gas usedAVG(gas_used) as avg_gas_usedFROMronin.transactionsWHERE-- Filter out null addresses and potential system transactions"from" IS NOT NULLAND "to" IS NOT NULLGROUP BYDATE(block_time))SELECTdate,total_transactions,unique_sender_wallets,unique_receiver_wallets,successful_transactions,ROUND(successful_transactions * 100.0 / NULLIF(total_transactions, 0),2) as success_rate,ROUND(avg_gas_used, 2) as average_gas_used,-- Calculate day-over-day growthROUND((total_transactions - LAG(total_transactions, 1) OVER (ORDER BYdate)) * 100.0 / NULLIF(LAG(total_transactions, 1) OVER (ORDER BYdate),0),2