Query editor
with eth_transfer_raw as (select "from" as address, (-1) * cast(value as decimal(38, 0)) / 1e18 as amountfrom ethereum.traceswhere call_type = 'call'and success = trueand value > uint256 '0'and "from" is not nulland "to" is not nullunion allselect "to" as address, cast(value as decimal(38, 0)) / 1e18 as amountfrom ethereum.traceswhere call_type = 'call'and success = trueand value > uint256 '0'and "from" is not nulland "to" is not nullunion allselect "from" as address, (-1) * cast(gas_price as double) * gas_used / 1e18 as amountfrom ethereum.transactionswhere success = true),eth_balance as (selectaddress,case when eth_amount < 0.00001 then 0 else eth_amount end eth_balance_amount,case when u_amount < 0.00001 then 0 else u_amount end u_balance_amountfrom(select address,sum(amount) eth_amount,sum(amount) * (select price from prices.usd_latest where symbol = 'WETH' and blockchain = 'ethereum') as u_amountfrom eth_transfer_rawwhere address is not null -- exclude the null address datagroup by 1)),usdt_transfer as (selectevt_block_time block_time,"to" as address,cast(value as decimal(38, 0)) / 1e6 as tx_amt,evt_tx_hash tx_hashfrom erc20_ethereum.evt_Transferwhere contract_address = 0xdAC17F958D2ee523a2206206994597C13D831ec7union allselectevt_block_time block_time,"from" as address,-1 * cast(value as decimal(38, 0)) / 1e6 as tx_amt,evt_tx_hash tx_hashfrom erc20_ethereum.evt_Transferwhere contract_address = 0xdAC17F958D2ee523a2206206994597C13D831ec7),usdt_balance as (select