Query editor
WITH friends AS (SELECT subject, evt_block_time, ethAmount, shareAmount, CAST(ethAmount AS DOUBLE)/1e18 AS Volume, (CAST(ethAmount AS DOUBLE)/CAST(shareAmount AS DOUBLE))/1e18 AS PriceFROM friendtech_base.FriendtechSharesV1_evt_TradeWHERE CAST(shareAmount AS DOUBLE) > 0),Price AS (SELECTDATE_TRUNC('day', evt_block_time) AS DATE, subject, MAX(Price) as Prix, SUM(Volume) AS H1_VolumeFROM friendsGROUP BY 1,2)SELECTsubject as address,sum(H1_Volume) as sum_volumefrom Pricegroup by 1order by sum_volume desc