Query editor
WITH withdrawal as (selectdate_trunc('day',block_time) as day-- how many validators exited (value/32 ),-1*sum(amount_full_withdrawn) as valuefrom staking_ethereum.flowsWHERE amount_full_withdrawn > 0and entity = 'Lido'group by 1),rewards as (selectdate_trunc('day',block_time) as day-- rewards for validators service,sum(amount_partial_withdrawn) as valuefrom staking_ethereum.flowsWHERE entity = 'Lido'and amount_partial_withdrawn > 0group by 1),deposits as (SELECTdate_trunc('day', block_time) as day--how many validator nodes created (value/32 ),SUM(amount_staked) AS valueFROM staking_ethereum.depositswhere 1=1and entity = 'Lido'group by 1),net_flow as (selectday,value,sum(value) over(order by day) as cum_valuefrom (selectday,sum(value) as valuefrom(select day,value from depositsunion allselect day,value from withdrawal) agroup by 1)a),mev_priority_rewards AS (SELECTdate_trunc('day', block_time) AS day