Query editor
withsafes as (selectdistinct avo_safe as avo_safefrom (selectbytearray_ltrim(bytearray_substring(topic1, 13, 20)) as eoa, bytearray_ltrim(bytearray_substring(topic2, 13, 20)) as avo_safefrom evms.logswhere contract_address = 0x3adae9699029ab2953f607ae1f62372681d35978 --AvoFactoryProxyand topic0 = 0x0e2d0feff5e8ebc6a92c82e612b2eb241d5fc1f0c7b54ebd2637384f8a75d324 --AvoSafeDeployedand block_time > cast('2023-01-01 00:00:00' as TIMESTAMP))x)SELECTblock_time as date, CASEwhen blockchain = 'ethereum' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2when blockchain = 'optimism' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2when blockchain = 'arbitrum' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2when blockchain = 'polygon' then 0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0when blockchain = 'bnb' then 0xB8c77482e45F1F44dE1745F52C74426C631bDD52when blockchain = 'gnosis' then 0x6b175474e89094c44da98b954eedeac495271d0fwhen blockchain = 'avalanche_c' then 0x85f138bfee4ef8e540890cfb48f620571d67eda3when blockchain = 'base' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2end as contract_address, "from" AS avo_safe, blockchain, ((-1) * cast(tr.value as DECIMAL)) AS amount_raw, tx_hashFROM evms.traces trjoin safes son tr."from" = s.avo_safewhere block_time > cast('2023-01-15 00:00:00' as TIMESTAMP)AND successAND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null)UNION ALL-- inbound transfersSELECTblock_time as date, CASEwhen blockchain = 'ethereum' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2when blockchain = 'optimism' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2when blockchain = 'arbitrum' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2when blockchain = 'polygon' then 0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0when blockchain = 'bnb' then 0xB8c77482e45F1F44dE1745F52C74426C631bDD52when blockchain = 'gnosis' then 0x6b175474e89094c44da98b954eedeac495271d0fwhen blockchain = 'avalanche_c' then 0x85f138bfee4ef8e540890cfb48f620571d67eda3when blockchain = 'base' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2end as contract_address, to AS avo_safe, blockchain, (cast(value as DECIMAL)) AS amount_raw, tx_hashFROM evms.traces trjoin safes s