Query editor
with token_trades as(selectdate_trunc('hour', block_time) as hour,sum(amount_usd) as usd,count(distinct tx_from) as trader,count(1) as tradesfromdex.tradeswhereblock_date > date('2023-08-28')and project_contract_address = 0x99a65698566e757610d5aa2372f6a0c7df92ae9fgroup bydate_trunc('hour', block_time)),token_price as(selectavg(cast(amount_usd as double)/(token_bought_amount_raw/1e9)) as price,date_trunc('hour', block_time) as hourfromdex.tradeswhereblock_date > date('2023-08-28')and project_contract_address = 0x99a65698566e757610d5aa2372f6a0c7df92ae9fand token_bought_address = 0x0b0a8c7c34374c1d0c649917a97eee6c6c929b1band tx_hash <> 0x30c78e3392c594c5bad181b69f701f48cdb5d530817774e23391ef889ed1eae9group bydate_trunc('hour', block_time))selectt1.hour,t1.usd as vol,t1.trader,t1.trades,t2.pricefromtoken_trades t1 inner join token_price t2 on t1.hour = t2.hour