Query editor
withtxs as (selectel.tx_hash,m.module_address,max(el.block_date) as block_date -- their is always just one datefromdune.manboy.result_ethereum_zodiac_modules as m -- modulesinner join ethereum.logs as el on el.topic0 = 0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8 -- event ExecutionFromModuleSuccessand substring(el.topic1FROM13 FOR 20) = m.module_addressgroup by1,2)selecttxs.tx_hash,txs.block_date,txs.module_address,sum(et.value) as native_token_transfer_amount_raw,(selectAPPROX_PERCENTILE(price, 0.5) as pricefromprices.usdwheresymbol = 'ETH'and contract_address IS NULLand CAST(minute AS date) = txs.block_date) as native_token_price_in_usd, -- will be the "average" price throughout the daysum(et.value) / cast(1e18 as double) * (selectAPPROX_PERCENTILE(price, 0.5) as pricefromprices.usdwheresymbol = 'ETH'and contract_address IS NULLand CAST(minute AS date) = txs.block_date) as usd_valuefromtxsleft join ethereum.traces as et on et.tx_hash = txs.tx_hashgroup by1,2,3