Query editor
WITH daily_metrics AS (SELECTb.date,COUNT(*) AS total_transactions,COUNT(DISTINCT TRY_CAST(t."from" AS VARCHAR)) AS unique_senders,COUNT(DISTINCT TRY_CAST(t."to" AS VARCHAR)) AS unique_receivers,AVG(t.gas_used) AS avg_gas_used,SUM(t.gas_used) AS total_gas_usedFROM ink.transactions AS tJOIN ink.blocks AS bON t.block_number = b.numberWHEREt.success = TRUE /* Only count successful transactions */GROUP BYb.dateORDER BYb.date DESC)SELECTdate,total_transactions,unique_senders,unique_receivers,ROUND(avg_gas_used, 2) AS avg_gas_used,total_gas_usedFROM daily_metrics