Query editor
selecttime,sum(price*amount)/sum(amount) as weight_avg_price--, avg(price) as avg_price, min(price) as min_price, max(price) as max_pricefrom (selectDATE_TRUNC('hour', evt_block_time) as time,"tokens_sold"/"tokens_bought" as price,"tokens_bought" as amountfrom curvefi."steth_swap_evt_TokenExchange"where sold_id = 0unionselectDATE_TRUNC('hour', evt_block_time) as time,"tokens_bought"/"tokens_sold" as price,"tokens_sold" as amountfrom curvefi."steth_swap_evt_TokenExchange"where sold_id = 1) price_bothgroup by 1order by 1