Query editor
withcow_payouts as (selectevt_block_time,evt_tx_hash,sum(value / 10 ^ 18) as cow_outfrom cow_protocol."CowProtocolToken_evt_Transfer"where "from" = '\xa03be496e67ec29bc62f01a428683d7f9c204930' -- Rewards Payout Safegroup by evt_block_time, evt_tx_hash),eth_out as (selectblock_time,tx_hash,sum(value) / 10^18 as eth_outfrom ethereum.traces where tx_hash in (select evt_tx_hash from cow_payouts)group by tx_hash, block_time),weekly_totals as (select block_time, tx_hash, cow_out, eth_outfrom eth_outjoin cow_payoutson block_time = evt_block_timeand tx_hash = evt_tx_hashorder by block_time),realized_fees as (selectsum(atoms_bought) / 10^18 as realized_fees_ethfrom gnosis_protocol_v2."trades"where trader in (select addressfrom gnosis_protocol_v2."view_solvers"where name = 'Withdraw')and block_time > '2022-03-01'),incomming_eth_transactions as (-- WETH INselectdate(evt_block_time) as day,concat('0x', encode(evt_tx_hash, 'hex')) as tx_hash,"from",sum(value) / 10^18 as eth_infrom erc20."ERC20_evt_Transfer" transferswhere "to" = '\xa03be496e67ec29bc62f01a428683d7f9c204930'-- and "from" = "\x9008d19f58aabd9ed0d60971565aa8510560ab41" -- Excluding This: 0x524a0b35d0aac37bdf4501beffb6369497a4b14a9308d02b070447233d197f6eand contract_address = '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'group by evt_block_time, evt_tx_hash, "from"union-- Native ETH in (direct)selectdate(block_time) as day,concat('0x', encode(hash, 'hex')) as tx_hash,"from",sum(value) / 10 ^ 18 as eth_in