Query editor
-- This query has been migrated to run on DuneSQL. If you need to change back because you’re seeing issues, use the Query History view to restore the previous version. If you notice a regression, please email [email protected].SELECTe.created_at,price / 1e18 AS floor,AVG(e.price / 1e18) OVER (ORDER BYe.created_at ROWS BETWEEN 29 PRECEDINGAND CURRENT ROW) AS avg_30,DATE_TRUNC('day', e.created_at) AS day,sourceFROMreservoir.polygon_collection_floor_ask_events AS eINNER JOIN reservoir.polygon_collections AS c ON e.collection_id = c.idWHERE(TRY_CAST(e.created_at AS DATE) > NOW() - INTERVAL '{{days}}' day) = TRUEAND ('{{NFT Collection}}' = c.slugOR '{{NFT Collection}}' = collection_idOR '{{NFT Collection}}' = cast(c.contract as varchar))ORDER BY1 DESC