Query editor
WITH cte AS (SELECT*,amount_usd / token_bought_amount AS token_bought_usd_price,(amount_usd / token_sold_amount) AS token_sold_usd_priceFROM uniswap.tradesWHEREblock_date BETWEEN TRY_CAST('2020-08-01' AS TIMESTAMP WITH TIME ZONE) AND TRY_CAST('2020-08-30' AS TIMESTAMP WITH TIME ZONE))SELECTtoken_pair,ROUND(SUM(amount_usd) / (SELECTSUM(amount_usd)FROM cte),2) AS volume_shareFROM cteGROUP BYtoken_pairORDER BYvolume_share DESCLIMIT 50