Query editor
SELECT month,protocol_revenue_events_eth,eth_forwarded_to_endowment,round(sum(protocol_revenue_events_eth) OVER (ORDER BY month),1) AS cumulative_revenue,round(sum(eth_forwarded_to_endowment) OVER (ORDER BY month),1) AS cumulative_to_endowmentFROM (-- Revenue reaching the DAO: registrar controller fees -> collector 0x6262 -> endowment.ensdao.eth-- Left: protocol revenue decoded from registration/renewal EVENTS.-- Right: actual ETH forwarded on-chain from the collector to endowment.ensdao.eth (traces).WITH revenue_events AS (SELECT block_time, (CAST(bytearray_to_uint256(bytearray_substring(data,33,32)) AS double)+CAST(bytearray_to_uint256(bytearray_substring(data,65,32)) AS double))/1e18 AS ethFROM ethereum.logsWHERE contract_address=0x59e16fccd424cc24e280be16e11bcd56fb0ce547AND topic0=0xc2240194853531f1ae318dcef227de79c6ad0fd9d1b0e4fe08568415be2e08a5AND block_time>=TIMESTAMP '2026-01-01' AND block_time<TIMESTAMP '2026-07-01'UNION ALLSELECT block_time, (CAST(bytearray_to_uint256(bytearray_substring(data,33,32)) AS double)+CAST(bytearray_to_uint256(bytearray_substring(data,65,32)) AS double))/1e18FROM ethereum.logsWHERE contract_address=0x253553366da8546fc250f225fe3d25d0c782303bAND topic0=0x69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf27AND block_time>=TIMESTAMP '2026-01-01' AND block_time<TIMESTAMP '2026-07-01'UNION ALLSELECT block_time, CAST(bytearray_to_uint256(bytearray_substring(data,33,32)) AS double)/1e18FROM ethereum.logsWHERE contract_address=0x59e16fccd424cc24e280be16e11bcd56fb0ce547AND topic0=0xfa956c3bce4cb4b01166868ecaf0620566bc7e33fc70b0b9c6aef61e37e50b94AND block_time>=TIMESTAMP '2026-01-01' AND block_time<TIMESTAMP '2026-07-01'UNION ALLSELECT block_time, CAST(bytearray_to_uint256(bytearray_substring(data,33,32)) AS double)/1e18FROM ethereum.logsWHERE contract_address=0x253553366da8546fc250f225fe3d25d0c782303bAND topic0=0x3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506aeAND block_time>=TIMESTAMP '2026-01-01' AND block_time<TIMESTAMP '2026-07-01'),ev AS (SELECT date_trunc('month',block_time) AS month, sum(eth) AS event_eth FROM revenue_events GROUP BY 1),flow AS (SELECT date_trunc('month',block_time) AS month, sum(CAST(value AS double)/1e18) AS endowment_ethFROM ethereum.tracesWHERE "from"=0x62627681d92e36b9aee1d9a6bf181373ccd42552AND to=0x4f2083f5fbede34c2714affb3105539775f7fe64AND success AND CAST(value AS double)>0AND block_time>=TIMESTAMP '2026-01-01' AND block_time<TIMESTAMP '2026-07-01'GROUP BY 1)SELECT ev.month,round(ev.event_eth,1) AS protocol_revenue_events_eth,round(coalesce(flow.endowment_eth,0),1) AS eth_forwarded_to_endowmentFROM ev LEFT JOIN flow ON flow.month=ev.month) xORDER BY month