reference: https://docs.moralis.io/web3-data-api/reference/get-token-price
my code is
import Moralis from ‘moralis’;
import { EvmChain } from ‘@moralisweb3/evm-utils’;
try {
const chain = EvmChain.ETHEREUM;
const address = ‘0x1234567890123456789012345678901234567890’;
await Moralis.start({
apiKey: ‘4324234’,
// …and any other configuration
});
const response = await Moralis.EvmApi.token.getTokenPrice({
address,
chain,
});
console.log(response?.result);
} catch (e) {
console.error(e);
}
response is zero.
but https://etherscan.io/dex/uniswapv3/0x7335118ece5464167ec940c4dba3291d1484e00f
is still alive
same exchange uniswap-v3