Query editor
WITH transaction_counts AS (SELECT'Ethereum' AS chain,DATE_TRUNC('month', block_time) AS active_month,COUNT(*) AS total_transactions,COUNT(DISTINCT "from") AS active_usersFROM ethereum.transactionsWHERE block_time >= NOW() - INTERVAL '12' month -- Limit to last 12 months for speedGROUP BY 1, 2UNION ALLSELECT'BNB' AS chain,DATE_TRUNC('month', block_time) AS active_month,COUNT(*) AS total_transactions,COUNT(DISTINCT "from") AS active_usersFROM bnb.transactionsWHERE block_time >= NOW() - INTERVAL '12' monthGROUP BY 1, 2UNION ALLSELECT'AVAX' AS chain,DATE_TRUNC('month', block_time) AS active_month,COUNT(*) AS total_transactions,COUNT(DISTINCT "from") AS active_usersFROM avalanche_c.transactionsWHERE block_time >= NOW() - INTERVAL '12' monthGROUP BY 1, 2UNION ALLSELECT'FTM' AS chain,DATE_TRUNC('month', block_time) AS active_month,COUNT(*) AS total_transactions,COUNT(DISTINCT "from") AS active_usersFROM fantom.transactionsWHERE block_time >= NOW() - INTERVAL '12' monthGROUP BY 1, 2)SELECTchain,active_month,total_transactions,active_users,ROUND(CAST(total_transactions AS DECIMAL) / NULLIF(active_users, 0), 2) AS avg_tx_per_userFROM transaction_countsORDER BY chain, active_month;