Query editor
--Error: Unable to fully debug queryWITH collection AS (SELECTDATE_TRUNC('day', FROM_UNIXTIME(created_at / 1000.0)) AS day,contract,AVG(price_decimal) AS floor_ethFROM reservoir.collection_floor_ask_eventsWHEREcontract IN (FROM_HEX('bc4ca0eda7647a8ab7c2061c2e118a18a936f13d'))AND created_at >= ((CURRENT_TIMESTAMP - INTERVAL '1500' day))GROUP BY1,2), first_day_price AS (SELECTcontract,AVG(price_decimal) AS first_day_ethFROM reservoir.collection_floor_ask_eventsWHEREcontract = FROM_HEX('bc4ca0eda7647a8ab7c2061c2e118a18a936f13d')AND DATE_TRUNC('day', FROM_UNIXTIME(created_at / 1000.0)) = DATE_TRUNC('day', CURRENT_TIMESTAMP - INTERVAL '800' day)GROUP BYcontract)SELECTcollection.day,collection.contract,FORMAT('%.2f%%',(((collection.floor_eth - first_day_price.first_day_eth) / first_day_price.first_day_eth) * 100)) AS price_change_percentageFROM collectionLEFT JOIN first_day_priceON collection.contract = first_day_price.contractWHERENOT collection.day IN (TRY_CAST('2021-04-22' AS DATE), TRY_CAST('2024-09-13' AS DATE))ORDER BYcollection.day,collection.contract