Query editor
withpepebuy as (selectdate_trunc('day',block_time) as day1,sum(token_bought_amount_raw) as sum_b_row,sum(amount_usd) as sum_usd_bfromdex.tradeswheretoken_bought_address = 0x6982508145454ce325ddbe47a25d4ec3d2311933 -- pepeand tx_from = 0xaf2358e98683265cbd3a48509123d390ddf54534 -- whalegroup by 1),pepesell as (selectdate_trunc('day',block_time) as day2,sum(token_sold_amount_raw) as sum_s_row,sum(amount_usd) as sum_usd_sfromdex.tradeswheretoken_sold_address = 0x6982508145454ce325ddbe47a25d4ec3d2311933 -- pepeand tx_from = 0xaf2358e98683265cbd3a48509123d390ddf54534 -- whalegroup by 1),price as (select date_trunc('day', hour) as day ,AVG(median_price) as price1 from dex.priceswhere contract_address = 0x6982508145454ce325ddbe47a25d4ec3d2311933--PEPEgroup by 1order by 1 desc)selectday,price1,(sum_b_row/1e9) as sum_b_row,sum_usd_b,-(sum_s_row/1e9) as sum_s_row,-(sum_usd_s) as sum_usd_sfrompriceleft join pepebuy on day1 = dayleft join pepesell on day2 = dayorder by 1 desc