Query editor
WITHt as (SELECTblock_time,block_date,tx_hash,amount,symbol,amount_usd,"from",to,CASEWHEN "from" = 0xb584D4bE1A5470CA1a8778E9B86c81e165204599 THEN 'OUT'WHEN to = 0xb584D4bE1A5470CA1a8778E9B86c81e165204599 THEN 'IN'ELSE NULLEND as flowFROMtokens_ethereum.transfersWHEREblock_time >= (current_date - interval '7' day)AND symbol = 'ETH'AND ("from" = 0xb584D4bE1A5470CA1a8778E9B86c81e165204599OR to = 0xb584D4bE1A5470CA1a8778E9B86c81e165204599)AND amount_usd <= 50 /* excluding token withdrawls */)SELECTblock_date,flow,count(tx_hash) as tx_count,sum(amount) as total_amount,sum(amount_usd) as total_amount_usd,avg(amount_usd) as avg_amount_usdFROMtGROUP BY 1, 2ORDER BY 2 DESC, 1 DESC