Hey everyone!
Iām currently working on a project using the EVM, and I encountered an issue with the following code snippet. When I run it, I get the response āInvalid exchange.ā Iām trying to fetch the address of a token pair on the Arbitrum chain using the Moralis EVM API. Hereās the code:
from moralis import evm_api
api_key = "APIKEY"
params = {
"chain": "arbitrum",
"to_block": "70734661",
"exchange": "uniswapv3",
"token0_address": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"token1_address": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8"
}
result = evm_api.defi.get_pair_address(
api_key=api_key,
params=params,
)
print(result)
Iām trying to fetch the address of a pair on the Uniswap V3 exchange on the Arbitrum chain, given the addresses of the two tokens involved. However, I keep getting the āInvalid exchangeā response. Iāve double-checked the API key and the token addresses, and they all seem to be correct.
I would greatly appreciate any insights or suggestions on why I might be getting this response. Is there something wrong with my code or the parameters Iām passing? Any help would be highly appreciated.
Thank you in advance for your assistance!