Query editor
withdaily_dxy_buyer_seller as(selectdate_trunc('hour',block_time) as block_time,-- case when token_bought_address = 0x6900F7B42fb4abb615c938DB6a26d73a9AFbed69 then tx_from end as buyer,case when token_bought_address = 0x6900F7B42fb4abb615c938DB6a26d73a9AFbed69 then amount_usd end as buy_amount,-- case when token_sold_address = 0x6900F7B42fb4abb615c938DB6a26d73a9AFbed69 then tx_from end as seller,case when token_sold_address = 0x6900F7B42fb4abb615c938DB6a26d73a9AFbed69 then amount_usd end as sell_amount-- *fromdex.tradeswheredate_trunc('hour',block_time)> TIMESTAMP '2024-01-01'),dxy_price_trending as(select hour,median_price as price from dex.prices where contract_address=0x6900F7B42fb4abb615c938DB6a26d73a9AFbed69)select t2.hour,sum(buy_amount) as daily_buy_amount,sum(sell_amount) as daily_sell_amount,min(price) as pricefrom daily_dxy_buyer_seller t1 right join dxy_price_trending t2 on t1.block_time = t2.hourgroup by t2.hour