Query editor
with dws as (with deposits as (select block_time, bytearray_substring(topic2, 13, 32) as user,bytearray_substring(data, 13, 20) as token_contract_address,bytearray_to_uint256(bytearray_substring(data, 33, 32)) as token_raw_amountfrom ethereum.logswhere block_time >= timestamp '2023-03-23 20:18'and contract_address = 0x57891966931eb4bb6fb81430e6ce0a03aabde063and topic0 = 0xdd341179f4edc78148d894d0213a96d212af2cbaf223d19ef6d483bdd47ab81dunionselect block_time, bytearray_substring(data, 205, 20) as user,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 as token_contract_address,bytearray_to_uint256(bytearray_substring(data, 449, 32)) as token_raw_amountfrom ethereum.logswhere contract_address = 0x32400084c286cf3e17e7b677ea9583e60a000324and topic0 = 0x4531cd5795773d7101c17bdeb9f5ab7f47d7056017506f937083be5d6e77a382)select a.block_time, a.user, if(b.symbol = 'WETH', 'ETH', b.symbol) as symbol,cast(token_raw_amount as double) / power(10, b.decimals) as amount,b.price, a.token_contract_address, a.token_raw_amountfrom deposits a left join prices.usd bon b.minute >= timestamp '2023-2-14 10:11' and b.blockchain = 'ethereum'and a.token_contract_address = b.contract_address and date_trunc('minute', a.block_time) = b.minute)select sum(amount) from dws where symbol = 'ETH'/*select * from prices.usdwhere minute >= timestamp '2023-2-14 10:11' and symbol = 'WETH' limit 100*/