Query editor
with token_type_dim as(select*from query_2469029)selectif(num_rank>=10,'Other',Meme_symbol) as Meme_symbol,sum(volume) as volumefrom(selectMeme_symbol-- pair,volume,row_number()over(order by volume desc ) as num_rankfrom(selectMeme_symbol,sum(volume) as volumefrom(select-- pair-- ,contract_pairMeme_symbol,volumefrom(select-- stat_date-- CASE WHEN token_bought_symbol < token_sold_symbol THEN CONCAT(token_bought_symbol, '-', token_sold_symbol) ELSE CONCAT(token_sold_symbol, '-', token_bought_symbol) END AS pair-- ,CASE WHEN token_bought_address < token_sold_address THEN CONCAT(token_bought_address, '-', token_sold_address) ELSE CONCAT(token_sold_address, '-', token_bought_address) END AS contract_pairMeme_symbol,round(sum(amount_usd),2) as volumefrom(selectproject,casewhen bought_token_type_dim.token_type in ('Meme') or sold_token_type_dim.token_type in ('Meme') then 'Meme Pair'when bought_token_type_dim.token_type in ('Stable Coin') or sold_token_type_dim.token_type in ('Stable Coin') then 'Stable Coin Pair'when bought_token_type_dim.token_type in ('Staked ETH') or sold_token_type_dim.token_type in ('Staked ETH') then 'Staked ETH Pair'when bought_token_type_dim.token_type in ('WBTC') or sold_token_type_dim.token_type in ('WBTC') then 'WBTC Pair'else 'Other'end as erc20_type,amount_usd,cast(token_bought_address as varchar) as token_bought_address,cast(token_sold_address as varchar) as token_sold_address,bought_token_type_dim.token_type as buy_token_type,sold_token_type_dim.token_type as sold_token_type,token_bought_symbol,token_sold_symbol,stat_date,tx_from,casewhen bought_token_type_dim.token_type ='Meme' then token_bought_symbolwhen sold_token_type_dim.token_type ='Meme' then token_sold_symbol