Query editor
WITH daily_stats AS (SELECTDATE_TRUNC('day', evt_block_time) as date,COUNT(*) as daily_attestations,COUNT(DISTINCT attester) as unique_attesters,COUNT(DISTINCT recipient) as active_recipients,COUNT(DISTINCT evt_tx_hash) as unique_transactions,-- Add running totalsSUM(COUNT(*)) OVER (ORDER BY DATE_TRUNC('day', evt_block_time)) as cumulative_attestations,SUM(COUNT(DISTINCT recipient)) OVER (ORDER BY DATE_TRUNC('day', evt_block_time)) as cumulative_recipients,-- Add week-over-week comparisonLAG(COUNT(*), 7) OVER (ORDER BY DATE_TRUNC('day', evt_block_time)) as attestations_week_ago,-- Activity by hour of dayCOUNT(DISTINCT DATE_TRUNC('hour', evt_block_time)) as active_hours_in_dayFROM polygon_eas_polygon.EAS_evt_AttestedWHERE contract_address = 0x5e634ef5355f45a855d02d66ecd687b1502af790AND schemaUID = 0xa8278db7606b3308241b9e12d10e49bb28f6a42f35dbad8495f0fae93eba2d62GROUP BY 1)SELECTdate,daily_attestations,unique_attesters,active_recipients,unique_transactions,cumulative_attestations,cumulative_recipients,CASEWHEN attestations_week_ago IS NOT NULLTHEN ((daily_attestations - attestations_week_ago) * 100.0 / NULLIF(attestations_week_ago, 0))ELSE NULLEND as week_over_week_growth,active_hours_in_dayFROM daily_statsWHERE daily_attestations > 0ORDER BY date DESCLIMIT 100