Query editor
SELECT sum(cast(amount_usd as DOUBLE)) / sum(cast(token_bought_amount_raw as DOUBLE) / 1e18) as token_price, sum(cast(amount_usd as DOUBLE)) as dex_volume,date_trunc('hour', block_time) as hour , 38761781.67 * sum(cast(amount_usd as DOUBLE)) / sum(cast(token_bought_amount_raw as DOUBLE) / 1e18) as market_cap FROM dex.tradeswhere token_bought_address = 0xF1182229B71E79E504b1d2bF076C15a277311e05and blockchain = 'ethereum'and amount_usd IS NOT nullGROUP BY 3UNIONSELECT sum(cast(amount_usd as DOUBLE)) / sum(cast(token_sold_amount_raw as DOUBLE) / 1e18) as token_price, sum(cast(amount_usd as DOUBLE)) as dex_volume,date_trunc('hour', block_time) as hour, 38761781.67 * sum(cast(amount_usd as DOUBLE)) / sum(cast(token_sold_amount_raw as DOUBLE) / 1e18) as market_cap FROM dex.tradeswhere token_sold_address = 0xF1182229B71E79E504b1d2bF076C15a277311e05and blockchain = 'ethereum'and amount_usd IS NOT nullGROUP BY 3order by 3 DESC