Query editor
withraw_txs_forl1basefee_and_assertions as -- this cte is to prefilter the raw txs data for parent chains, used as part of the calculation the l1basefee (settlement) and also the assertions(selecthash ,block_time as block_timestamp,"from" as from_address,"to" as to_address,gas_price as receipt_effective_gas_price,gas_used as receipt_gas_used,null as receipt_l1_fee,data as input,bytearray_substring(data,1,4) as method_id,'ethereum' as parentchain_flag--, case when substring(input,1,10) = '0x8f111f3c' or substring(input,1,10) = '0x3e5aa082' or substring(input,1,10)= '0xe0bc9729' then 'l1basefee' else 'assertions' end as flagfromethereum.transactions tWHERE-- Second set of conditions: Fees paid to create and/or confirm assertions("to" IN ( --these are the rollupproxy sc addresses for Orbits of interest0x5073da9ca4810f3e0aa01c20c7d9d02c3f522e11, -- kinto0x448bbd134de1b23976073ab4f2915849b2dcd73a, -- reya0xf993af239770932a0edab88b6a5ba3708bd58239, -- gravity-- '0x6594085ca55a2b3a5fad1c57a270d060eea99877', -- parallel0xc4f7b37be2bbbcf07373f28c61b1a259dfe49d2a, -- real0x1ca12290d954cfe022323b6a6df92113ed6b1c98, -- alephzero0x6fa8b24c85409a4fcb541c9964766862aa007f39 -- alienx))),orbit_assertions_eth as (selectcontract_address as address, tx_from as from_address,tx_to as to_address, date_trunc('day', block_time) as block_dt,tx_hash as transaction_hashfromethereum.logswheretopic0 = 0x4f4caa9e67fb994e349dd35d1ad0ce23053d4323f83ce11dc817b5435031d096 -- node created-- '0x22ef0479a7ff660660d1c2fe35f1b632cf31675c2d9378db8cec95b00d8ffa3c' -- node confirmedand block_time > timestamp '2023-12-01'and block_number > 18687851and contract_address in (0x5073da9ca4810f3e0aa01c20c7d9d02c3f522e11,0x448bbd134de1b23976073ab4f2915849b2dcd73a, --these are the rollupproxy sc addresses for Orbits of interest0xf993af239770932a0edab88b6a5ba3708bd58239,0x6594085ca55a2b3a5fad1c57a270d060eea99877,0xc4f7b37be2bbbcf07373f28c61b1a259dfe49d2a,0x1ca12290d954cfe022323b6a6df92113ed6b1c98,0x6fa8b24c85409a4fcb541c9964766862aa007f39)--and transaction_hash in ('0x02de4a50c4394e00e9a00e7bad70ff1944c949f7d92fcc5a7a2ba213beab5397','0xd3690d476a576005e075890865ab9f8397c0eca50fa0cee439e048f0ba0000ff')),orbit_assertions_eth_totals as (select