Query editor
with tokens_bought as (SELECTCAST(token_bought_address as varchar) as token,blockchain,MIN(block_time) as first_buyFROM dex.tradesGROUP BY 1,2UNION ALLSELECTtoken_bought_mint_address as token,'solana' as blockchain,MIN(block_time) as first_buyFROM dex_solana.tradesGROUP BY 1,2)SELECTdate_trunc('year',first_buy) as date_time,blockchain,COUNT(DISTINCT(token)) as total_tokens,SUM(COUNT(DISTINCT(token))) OVER (PARTITION BY blockchain ORDER BY date_trunc('year',first_buy)) as cumulative_tokensFROM tokens_boughtWHERE first_buy >= Timestamp '2021-01-01'GROUP BY 1,2ORDER BY 1 DESC