Query editor
WITH eth2_amounts as(SELECT('x' || substring(encode(amount::bytea, 'hex') from 15 for 2) ||substring(encode(amount::bytea, 'hex') from 13 for 2) ||substring(encode(amount::bytea, 'hex') from 11 for 2) ||substring(encode(amount::bytea, 'hex') from 9 for 2) ||substring(encode(amount::bytea, 'hex') from 7 for 2) ||substring(encode(amount::bytea, 'hex') from 5 for 2) ||substring(encode(amount::bytea, 'hex') from 3 for 2) ||substring(encode(amount::bytea, 'hex') from 1 for 2) )::bit(64)::bigint amount,evt_block_time,"withdrawal_credentials"frometh2."DepositContract_evt_DepositEvent"),lido_amounts as(SELECT amount, evt_block_time FROM eth2_amountsWHERE withdrawal_credentials IN ('\x010000000000000000000000b9d7934878b5fb9610b3fe8a5e441e8fad7e293f', '\x009690e5d4472c7c0dbdf490425d89862535d2a52fb686333f3a0a9ff5d2125e'))selecteth2_amounts.time,avg(COALESCE(lido_deposited, 0)) over (order by eth2_amounts.time rows between 3 preceding and CURRENT ROW) as ma_3d,avg(COALESCE(lido_deposited, 0)) over (order by eth2_amounts.time rows between 7 preceding and CURRENT ROW) as ma_1w,avg(COALESCE(lido_deposited, 0)) over (order by eth2_amounts.time rows between 30 preceding and CURRENT ROW) as ma_1mfrom(select date_trunc('day', evt_block_time) as time, sum(amount)/1e9 as total_depositedfrom eth2_amountsgroup by 1) eth2_amountsleft join(select date_trunc('day', evt_block_time) as time, sum(amount)/1e9 as lido_depositedfrom lido_amountsgroup by 1) lido_amountson lido_amounts.time = eth2_amounts.timeleft join(SELECTdate_trunc('day', evt_block_time) as time,SUM(amount)/1e18 as lido_submittedFROM lido."steth_evt_Submitted"GROUP BY 1) lido_submittedon lido_submitted.time = eth2_amounts.timeorder by 1