Query editor
WITH Buyers AS (SELECT DISTINCTtrader AS Buyyer,MIN(evt_block_time) AS first_dateFROM friendtech_base.FriendtechSharesV1_evt_TradeWHERE isBuy = TRUE AND shareAmount > CAST(0 as uint256)GROUP BY 1 ),Seller AS (SELECT DISTINCTtrader AS Seller,MIN(evt_block_time) AS first_dateFROM friendtech_base.FriendtechSharesV1_evt_TradeWHERE isBuy = False AND shareAmount > CAST(0 as uint256)GROUP BY 1 ),uniq_buyers AS (SELECTDATE_TRUNC('day',first_date) AS DATE, COUNT(Buyyer) OVER (ORDER BY DATE_TRUNC('day',first_date)) AS cumulative_unique_buyyersFROM Buyers ) ,uniq_sellers AS (SELECTDATE_TRUNC('day',first_date) AS DATE, COUNT(Seller) OVER (ORDER BY DATE_TRUNC('day',first_date)) AS cumulative_unique_sellersFROM Seller)SELECT a.DATE , cumulative_unique_buyyers, cumulative_unique_sellersFROM uniq_buyers aLEFT JOIN uniq_sellers b ON a.DATE = b.DATEGROUP BY 1,2,3ORDER BY 1 DESC