Query editor
with mb as (select evt_block_date as day,case when "from" = 0x0000000000000000000000000000000000000000 then 1 else -1 end * cast(value as double) / 1e18 as sharesfrom erc20_ethereum.evt_Transferwhere contract_address = 0x86b5780b606940eb59a062aa85a07959518c0161and evt_block_date >= date '2026-06-01'and ("from" = 0x0000000000000000000000000000000000000000 or "to" = 0x0000000000000000000000000000000000000000)union allselect evt_block_date,case when "from" = 0x0000000000000000000000000000000000000000 then 1 else -1 end * cast(value as double) / 1e18from erc20_optimism.evt_Transferwhere contract_address = 0x86b5780b606940eb59a062aa85a07959518c0161and evt_block_date >= date '2026-06-01'and ("from" = 0x0000000000000000000000000000000000000000 or "to" = 0x0000000000000000000000000000000000000000)union allselect evt_block_date,case when "from" = 0x0000000000000000000000000000000000000000 then 1 else -1 end * cast(value as double) / 1e18from erc20_arbitrum.evt_Transferwhere contract_address = 0x86b5780b606940eb59a062aa85a07959518c0161and evt_block_date >= date '2026-06-01'and ("from" = 0x0000000000000000000000000000000000000000 or "to" = 0x0000000000000000000000000000000000000000)union allselect evt_block_date,case when "from" = 0x0000000000000000000000000000000000000000 then 1 else -1 end * cast(value as double) / 1e18from erc20_scroll.evt_Transferwhere contract_address = 0x86b5780b606940eb59a062aa85a07959518c0161and evt_block_date >= date '2026-06-01'and ("from" = 0x0000000000000000000000000000000000000000 or "to" = 0x0000000000000000000000000000000000000000)),rate as (select day, token_supply_underlying / nullif(token_supply, 0) as rfrom dune.ether_fi.result_etherfi_protocol_token_tvlwhere strategy_symbol = 'sETHFI'),staked as (select date_trunc('week', m.day) as week, sum(m.shares * rt.r) as net_new_ethfi_stakedfrom mb m join rate rt on rt.day = m.daygroup by 1),cb as (select cast(week as timestamp) as week, ethfi_bought, ethfi_distributed, -net_ethfi_weekly as cashback_deficitfrom query_9059186)selects.week,s.net_new_ethfi_staked,cb.ethfi_bought,cb.ethfi_distributed,cb.cashback_deficit,s.net_new_ethfi_staked - coalesce(cb.cashback_deficit, 0) as staking_minus_deficit,sum(case when s.week >= timestamp '2026-09-07' then s.net_new_ethfi_staked else 0 end) over (order by s.week) as cum_staked_since_sep7,sum(coalesce(cb.cashback_deficit, 0)) over (order by s.week) as cum_deficit_since_sep7from staked sleft join cb on cb.week = s.weekorder by s.week