Query editor
with base_today as (SELECT*FROM dex.tradesWHEREblock_time > CURRENT_TIMESTAMP - INTERVAL '24' Hour),base_Ntoday as (SELECT*FROM dex.tradesWHEREblock_time < CURRENT_TIMESTAMP - INTERVAL '24' Hour andblock_time > CURRENT_TIMESTAMP - INTERVAL '48' Hour),today as (selectproject,count(distinct tx_hash) as tx_count_today,sum(amount_usd) as vol_sum_todayfrom base_todaywhere blockchain = '{{blockchain}}'group by 1),Ntoday as(selectproject,count(distinct tx_hash) as tx_count,sum(amount_usd) as vol_sumfrom base_Ntodaywhere blockchain = '{{blockchain}}'group by 1)select *, (a.tx_count_today-b.tx_count)*100/a.tx_count_today as tx_24Hr_change,(a.vol_sum_today-b.vol_sum)*100/a.vol_sum_today as vol_24Hr_changefrom today a join Ntoday b on a.project = b.projectwhere tx_count_today > 100 and vol_sum_today > 1000 and (a.vol_sum_today-b.vol_sum)*100/a.vol_sum_today>0Order by vol_24Hr_change desc