Query editor
/* Migration success :)There are some cases such as unnest/sequence and array/json functions the migrator won't take care of for you(but we have examples of in the docs linked below!)If you're still running into issues, check out the doc examples https://dune.com/docs/reference/dune-v2/query-engine/or reach out to us in the Dune discord in the #dune-sql channel.*/WITHavg_daily AS (SELECTDATE_TRUNC('day', minute) AS dt,symbol,AVG(price) AS priceFROMprices.usdWHEREsymbol = '{{symbol}}'GROUP BY1,2ORDER BY1 DESC)SELECTdt,symbol,price,AVG(price) OVER (ORDER BYdt rows BETWEEN {{window_size}} precedingAND current row) AS averageFROMavg_dailyORDER BY1 DESC