Query editor
WITH prices AS (SELECTDATE_TRUNC('hour', evt_block_time) AS time,cast(tokens_sold as double) / cast(tokens_bought as double) AS price, -- ETH per stETHcast(tokens_bought as double) / 1e18 AS amount_eth -- en ETH realesFROMcurvefi_ethereum.steth_swap_evt_TokenExchangeWHEREsold_id = 0AND tokens_bought > CAST(2750 AS DOUBLE) * 1e18 -- >2750 stETHUNIONSELECTDATE_TRUNC('hour', evt_block_time) AS time,cast(tokens_bought as double) / cast(tokens_sold as double) AS price, -- ETH per stETHcast(tokens_sold as double) / 1e18 AS amount_eth -- en ETH realesFROMcurvefi_ethereum.steth_swap_evt_TokenExchangeWHEREsold_id = 1AND tokens_sold > CAST(2750 AS DOUBLE) * 1e18 -- >2750 stETH)SELECTtime,SUM(price * amount_eth) / SUM(amount_eth) AS weight_avg_priceFROM pricesGROUP BY 1ORDER BY 1