Query editor
withinflows as (selectdate_trunc('day', block_time) as time, 'WETH' as symbol, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 as contract_address, sum(cast(value as double) / pow(10,18)) as amountfrom ethereum.traceswhere to in (0x49048044D57e1C92A77f79988d21Fa8fAF74E97e, 0x3154Cf16ccdb4C6d922629664174b904d80F2C35)and successand (call_type not in ('delegatecall', 'callcode', 'staticcall') or call_type is null)group by 1,2,3union allselectdate_trunc('day', evt_block_time) as time, tk.symbol, tr.contract_address, sum(cast(tr.value as double) / pow(10,coalesce(tk.decimals,18))) as amountfrom erc20_ethereum.evt_Transfer trleft join tokens.erc20 tkon tk.contract_address = tr.contract_addressand tk.blockchain = 'ethereum'where to in (0x49048044D57e1C92A77f79988d21Fa8fAF74E97e, 0x3154Cf16ccdb4C6d922629664174b904d80F2C35)group by 1,2,3), outflows as (selectdate_trunc('day', block_time) as time, 'WETH' as symbol, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 as contract_address, sum(cast(value as double) / pow(10,18)) as amountfrom ethereum.traceswhere "from" in (0x49048044D57e1C92A77f79988d21Fa8fAF74E97e, 0x3154Cf16ccdb4C6d922629664174b904d80F2C35)and successand (call_type not in ('delegatecall', 'callcode', 'staticcall') or call_type is null)group by 1,2,3union allselectdate_trunc('day', evt_block_time) as time, tk.symbol, tr.contract_address, sum(cast(tr.value as double) / pow(10,coalesce(tk.decimals,18))) as amountfrom erc20_ethereum.evt_Transfer trleft join tokens.erc20 tkon tk.contract_address = tr.contract_addressand tk.blockchain = 'ethereum'where "from" in (0x49048044D57e1C92A77f79988d21Fa8fAF74E97e, 0x3154Cf16ccdb4C6d922629664174b904d80F2C35)group by 1,2,3), usd_prices as (