Query editor
WITH first_seen AS (SELECT"from" AS wallet,MIN(date_trunc('hour', block_time)) AS first_hourFROM arc.transactionsWHERE block_date >= CURRENT_DATE - INTERVAL '3' DAYGROUP BY 1),hourly AS (SELECTdate_trunc('hour', t.block_time) AS hour,COUNT(*) AS txs,COUNT(DISTINCT t."from") AS active_wallets,COUNT(DISTINCT CASE WHEN f.first_hour = date_trunc('hour', t.block_time)THEN t."from" END) AS new_wallets,COUNT(DISTINCT CASE WHEN f.first_hour < date_trunc('hour', t.block_time)THEN t."from" END) AS returning_walletsFROM arc.transactions tINNER JOIN first_seen f ON t."from" = f.walletWHERE t.block_date >= CURRENT_DATE - INTERVAL '3' DAYGROUP BY 1)SELECThour,txs,active_wallets,new_wallets,returning_wallets,SUM(new_wallets) OVER (ORDER BY hour) AS cumulative_walletsFROM hourlyORDER BY hour