Query editor
WITH collection AS (SELECTDATE_TRUNC('day', created_at) AS day,contract,AVG(price_decimal) AS floor_ethFROM reservoir.collection_floor_ask_eventsWHEREcontract IN (0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d)AND created_at >= DATE_TRUNC('day', CURRENT_TIMESTAMP - INTERVAL '800' day)GROUP BY1,2), first_day_price AS (SELECTcontract,AVG(price_decimal) AS first_day_ethFROM reservoir.collection_floor_ask_eventsWHEREcontract IN (0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d)AND DATE_TRUNC('day', created_at) = (SELECTDATE_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 collectionJOIN first_day_priceON collection.contract = first_day_price.contractWHERENOT collection.day IN (DATE(TRY_CAST('2022-12-28' AS TIMESTAMP)), DATE(TRY_CAST('2022-09-13' AS TIMESTAMP)))ORDER BYcollection.day,collection.contract