Query editor
withdaily_pepe_buyer_seller as(selectdate_trunc('hour',block_time) as block_time,-- case when token_bought_address = 0xfF836A5821E69066c87E268bC51b849FaB94240C then tx_from end as buyer,case when token_bought_address = 0xfF836A5821E69066c87E268bC51b849FaB94240C then amount_usd end as buy_amount,-- case when token_sold_address = 0xfF836A5821E69066c87E268bC51b849FaB94240C then tx_from end as seller,case when token_sold_address = 0xfF836A5821E69066c87E268bC51b849FaB94240C then amount_usd end as sell_amount-- *fromdex.tradeswheredate_trunc('hour',block_time)> TIMESTAMP '2023-04-13'),pepe_price_trending as(select hour,median_price as price from dex.prices where contract_address=0xfF836A5821E69066c87E268bC51b849FaB94240C)select t2.hour,sum(buy_amount) as daily_buy_amount,sum(sell_amount) as daily_sell_amount,min(price) as pricefrom daily_pepe_buyer_seller t1 right join pepe_price_trending t2 on t1.block_time = t2.hourgroup by t2.hour