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.*//* I apologize for hardcoding so many values in this query. Should have made it more modular */SELECT*,SUM(fees) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND unbounded following) AS fees_cumul,AVG(fees) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND 7 following) AS moving_avg_7d,AVG(pnl_5m_negative / (pnl_5m_negative + pnl_5m_positive)) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND 7 following) AS percent_toxic_flow_moving_avg_7d,AVG(pnl_1h_negative / (pnl_1h_negative + pnl_1h_positive)) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND 7 following) AS percent_toxic_flow_1h_moving_avg_7d,AVG(volume) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND 7 following) AS moving_avg_7d_volume,SUM(pnl_5m) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND unbounded following) AS markout_5m,SUM(pnl_24h) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND unbounded following) AS markout_24h,SUM(pnl_1h) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND unbounded following) AS markout_1h,SUM(pnl_7d) OVER (ORDER BYdate DESC NULLS FIRST rows BETWEEN current rowAND unbounded following) AS markout_7d,