Query editor
SELECTDATE_TRUNC('hour', block_time) as hour, AVG(amount_usd / CASE WHEN token_bought_address = 0x4e78011Ce80ee02d2c3e649Fb657E45898257815 THEN token_bought_amount ELSE token_sold_amount END) AS priceFROM dex.tradesWHERE blockchain = 'polygon'AND (token_bought_address = 0x4e78011Ce80ee02d2c3e649Fb657E45898257815OR token_sold_address = 0x4e78011Ce80ee02d2c3e649Fb657E45898257815)AND amount_usd > 0GROUP BY DATE_TRUNC('hour', block_time)ORDER BY hour DESC