Query editor
selectblock_time,avg(price_1) over (order by block_time rows between 10 preceding and current row) as pricefrom (selectblock_time,coalesce(amount_usd, token_sold_amount * price) / token_bought_amount as price_1from dex.trades ajoin prices.usd b on a.token_sold_address = b.contract_address and date_trunc('minute', a.block_time) = b.minutewhere token_bought_address = 0x5F18ea482ad5cc6BC65803817C99f477043DcE85and a.blockchain = 'ethereum'unionselectblock_time,coalesce(amount_usd, token_bought_amount * price) / token_sold_amount as price_1from dex.trades ajoin prices.usd b on a.token_bought_address = b.contract_address and date_trunc('minute', a.block_time) = b.minutewhere token_sold_address = 0x5F18ea482ad5cc6BC65803817C99f477043DcE85and a.blockchain = 'ethereum')order by 1 desc