Query editor
with trade_analysis as (selecttoken_address,token_symbol,blockchain,date_diff('day', min(block_time), max(block_time)) as total_lifespan_daysfrom (selecttoken_bought_address as token_address,token_bought_symbol as token_symbol,block_time,blockchainfromdex.tradeswhere project = 'uniswap'union allselecttoken_sold_address as token_address,token_sold_symbol as token_symbol,block_time,blockchainfromdex.tradeswhere project = 'uniswap') as tradesgroup by token_address, token_symbol, blockchain),lifespan_categories as (selectblockchain,casewhen total_lifespan_days <= 30 then '0-30 days'when total_lifespan_days > 30 and total_lifespan_days <= 90 then '30-90 days'when total_lifespan_days > 90 and total_lifespan_days <= 180 then '90-180 days'when total_lifespan_days > 180 and total_lifespan_days <= 360 then '180-360 days'when total_lifespan_days > 360 and total_lifespan_days <= 730 then '1-2 years'else '2+ years'end as lifespan_category,token_addressfrom trade_analysis)selectblockchain,lifespan_category,count(token_address) as token_countfrom lifespan_categoriesgroup by blockchain, lifespan_categoryorder by blockchain, lifespan_category;