Query editor
WITH monthly_deposits AS (SELECTDATE_TRUNC('month', block_time) as month,COUNT(*) as deposit_count,SUM(amount_staked) as eth_deposited,AVG(amount_staked) as avg_deposit_size,COUNT(DISTINCT tx_from) as unique_depositors,COUNT(DISTINCT entity) as unique_entities,MIN(block_time) as first_deposit_in_month,MAX(block_time) as last_deposit_in_monthFROM staking_ethereum.depositsWHERE withdrawal_address = 0xe3c44d4d25172ef2e0cdb9e09189a8ca4ed878f4GROUP BY 1)SELECTmonth as "Month",deposit_count as "Deposits",ROUND(eth_deposited, 2) as "ETH Deposited",unique_depositors as "Unique Depositors",unique_entities as "Unique Entities",ROUND(avg_deposit_size, 2) as "Avg Deposit Size",-- cumulativeROUND(SUM(eth_deposited) OVER (ORDER BY month), 2) as "Cumulative ETH",-- month-over-month growthLAG(eth_deposited) OVER (ORDER BY month) as "Previous Month ETH",ROUND(eth_deposited - LAG(eth_deposited) OVER (ORDER BY month), 2) as "MoM Change (ETH)",ROUND((eth_deposited - LAG(eth_deposited) OVER (ORDER BY month)) /NULLIF(LAG(eth_deposited) OVER (ORDER BY month), 0) * 100,2) as "MoM Growth %",-- year-over-year comparisonLAG(eth_deposited, 12) OVER (ORDER BY month) as "Same Month Last Year",ROUND((eth_deposited - LAG(eth_deposited, 12) OVER (ORDER BY month)) /NULLIF(LAG(eth_deposited, 12) OVER (ORDER BY month), 0) * 100,2) as "YoY Growth %",-- activity indicatorCASEWHEN eth_deposited > LAG(eth_deposited) OVER (ORDER BY month) THEN '📈 Increasing'WHEN eth_deposited < LAG(eth_deposited) OVER (ORDER BY month) THEN '📉 Decreasing'WHEN eth_deposited = LAG(eth_deposited) OVER (ORDER BY month) THEN '➡️ Stable'ELSE '🆕 First Month'END as "Trend"FROM monthly_depositsORDER BY month DESC;