Query editor
WITH time_range AS(selectdate_trunc('day',time) as timefrom ethereum.blockswhere date>=timestamp '2020-12-19'group by 1order by 1),ethereum_protocol_reward as(SELECTdate_trunc('day',block_time) as stat_date,tx_hash,tx_index,index,varbinary_to_uint256(varbinary_substring(data,1+32*1,32)) as amount,block_timeFROM ethereum.logswhere contract_address=0x9ac758ab77733b4150a901ebd659cbf8cb93ed66and topic0=0x315d9cdbc182c9118c140c78a121ebb9f24bf73f841339a8a41cdc3586c34e18) ,ethereum_queryFees_event as(SELECTdate_trunc('day',block_time) as stat_date,varbinary_to_uint256(varbinary_substring(data,1+32*5,32)) as queryFees,'RebateCollected' as event_nameFROM ethereum.logswhere contract_address=0xf55041e37e12cd407ad00ce2910b8269b01263b9and topic0=0xf5ded07502b6feba4c13b19a0c6646efd4b4119f439bcbd49076e4f0ed1eec4band block_time>timestamp'2023-09-01'union allSELECTdate_trunc('day',evt_block_time) as stat_date,rebateFees as queryFees,'AllocationCollected' as event_nameFROM thegraph_ethereum.Staking_evt_AllocationCollected),DelegationTransferredToL2_event as(SELECTfrom_hex(concat('0x',substr(cast(topic1 as varchar),27,40))) as delegator,from_hex(concat('0x',substr(cast(topic2 as varchar),27,40))) as l2Delegator,from_hex(concat('0x',substr(cast(topic3 as varchar),27,40))) as indexer,varbinary_to_uint256(varbinary_substring(data,1+32*1,32)) as transferredDelegationTokens,tx_hash,tx_from,tx_to,block_time as evt_block_time