Query editor
WITHeth_prices as (SELECTdate_trunc('day', minute) as price_time,AVG(price) as eth_priceFROMprices.usdWHEREsymbol = 'ETH'GROUP BY1),friend_tech_time AS (SELECT1 AS key_join,MIN(DATE_TRUNC('day', evt_block_time)) AS min_friendFROMfriendtech_base.FriendtechSharesV1_evt_Trade),friend AS (SELECT'Friend Tech' AS category,DATE_TRUNC('day', evt_block_time) AS date_time,COUNT(DISTINCT evt_tx_hash) AS total_tx,COUNT(DISTINCT trader) AS number_of_buyers,SUM(ethAmount / 1e18) AS volume,SUM(ethAmount / 1e18 * eth_price) as volume_usdFROMfriendtech_base.FriendtechSharesV1_evt_TradeLEFT JOIN eth_prices ON DATE_TRUNC('day', evt_block_time) = price_timeGROUP BY1,2),new_friends as (SELECTbirth_date,COUNT(DISTINCT (trader)) as new_users,SUM(COUNT(DISTINCT (trader))) OVER (ORDER BYbirth_date) as total_usersFROM(SELECTtrader,MIN(DATE(evt_block_time)) as birth_dateFROMfriendtech_base.FriendtechSharesV1_evt_TradeGROUP BY 1) GROUP BY 1)SELECT*,SUM(volume) OVER (PARTITION BYcategoryORDER BYdate_time) AS cumulative_volume,