Query editor
SELECTCASEWHEN token_bought_address = 0x3ed9acaac7bd974eb83a8ea6432a239e3c829d5d AND token_bought_amount IS NOT NULL THEN amount_usd / NULLIF(token_bought_amount, 0)WHEN token_sold_address = 0x3ed9acaac7bd974eb83a8ea6432a239e3c829d5d AND token_sold_amount IS NOT NULL THEN amount_usd / NULLIF(token_sold_amount, 0)ELSE NULLEND AS token_price_usdFROM velodrome_optimism.tradesWHERE(token_bought_address = 0x3ed9acaac7bd974eb83a8ea6432a239e3c829d5d OR token_sold_address = 0x3ed9acaac7bd974eb83a8ea6432a239e3c829d5d)AND amount_usd IS NOT NULLORDER BY block_time DESCLIMIT 1;