Query editor
selecttoken_pair, tx_hash, block_date,case when token_bought_address = 0xEcE7B98bD817ee5B1F2f536dAf34D0B6af8Bb542then amount_usd / token_bought_amountelse amount_usd / token_sold_amountend pricefrom (select *, rank() over (partition by block_date order by block_time desc) as rnkfrom dex.tradeswhere blockchain = 'base'and (token_bought_address = 0xEcE7B98bD817ee5B1F2f536dAf34D0B6af8Bb542 or token_sold_address = 0xEcE7B98bD817ee5B1F2f536dAf34D0B6af8Bb542)and amount_usd is not null) twhere t.rnk = 1order by block_date desc