Query editor
With info as (select blockchain, version, block_time, token_bought_symbol, token_sold_symbol, token_pair, token_bought_amount, token_sold_amount, amount_usd, token_bought_address, token_sold_address, taker, maker,project_contract_address, tx_hashfrom dex.trades where project = 'uniswap'),tokens as (select date_trunc('month', block_time) month, token_bought_symbol symbol , amount_usd, tx_hash from infounion allselect date_trunc('month', block_time) month, token_sold_symbol symbol , amount_usd, tx_hash from info),RankedTokens AS (SELECTmonth,symbol,SUM(amount_usd) AS USD_Volume,approx_distinct(tx_hash) AS tx_count,ROW_NUMBER() OVER (PARTITION BY month ORDER BY SUM(amount_usd) DESC) AS rankFROMtokensWHEREmonth > DATE '2020-06-29'GROUP BYmonth, symbol),Top5 AS (SELECTmonth,symbol,USD_Volume,tx_countFROMRankedTokensWHERErank <= 5)SELECTmonth,symbol,USD_Volume,tx_countFROMTop5ORDER BYmonth, USD_Volume DESC;