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 subject = 0xaf313530c9073abdff90f3e7d744035bde70ea42 --inversebrahAND CAST(shareAmount AS DOUBLE) > 0),Price AS (SELECTDATE_TRUNC('hour',evt_block_time) AS DATE, AVG(Price) AS Avg_Price, SUM(Volume) as VolumeFROM friendsGROUP BY 1)SELECT * FROM Price