Query editor
withethTransactionsDaily AS (-- outbound transfersSELECT DISTINCT-- date_trunc('day', block_time) AS day,"from" AS address,SUM(-value / 1e18) AS tx_amountFROM ethereum.tracesWHERE-- "from" = {{address}}value <> 0AND successAND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null)group by "from"UNION ALL-- inbound transfersSELECT DISTINCT-- date_trunc('day', block_time) AS day,"to" AS address,SUM(value / 1e18) AS tx_amountFROM ethereum.tracesWHERE-- "to" = {{address}}value <> 0AND successAND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null)group by "to"UNION ALL-- gas costsSELECT DISTINCT"from" AS address,SUM((-gas_used/ 1e18) * gas_price)AS tx_amountFROM ethereum.transactions-- WHERE "from" ={{address}}group by "from"),user_eth_balance_usd_price as (selectaddress as user,sum(tx_amount*price) as amount_usdfromethTransactionsDailyLEFT JOIN (SELECTpriceFROM prices.usd_latestWHEREsymbol='WETH'andblockchain='{{blockchain}}') as pricesON 1=1group by address),tx as (SELECTaddress,token_address,