Query editor
WITH validator_cohorts AS (SELECTvalidator_index,DATE_TRUNC('quarter', MIN(block_time)) as cohort_quarter,COUNT(*) as withdrawals,SUM(CASE WHEN amount / 1e9 < 1 THEN amount / 1e9 ELSE 0 END) as rewards,MAX(amount / 1e9) as max_withdrawalFROM ethereum.withdrawalsWHERE address = 0xe3c44d4d25172ef2e0cdb9e09189a8ca4ed878f4GROUP BY 1)SELECTcohort_quarter as "Cohort (First Activity Quarter)",COUNT(*) as "Validators in Cohort",SUM(CASE WHEN max_withdrawal >= 30 THEN 1 ELSE 0 END) as "Exited",SUM(CASE WHEN max_withdrawal < 30 THEN 1 ELSE 0 END) as "Still Active",ROUND(SUM(rewards), 2) as "Total Rewards (ETH)",ROUND(AVG(rewards), 6) as "Avg Rewards per Validator",ROUND(AVG(withdrawals), 1) as "Avg Withdrawals per Validator",ROUND(SUM(rewards) / COUNT(*) / 32 * 100, 4) as "Avg ROI per Validator (%)"FROM validator_cohortsGROUP BY 1ORDER BY 1 DESC;