Get DEX token pair reserves

I am currently testing the ā€œGet DEX token pair reservesā€ endpoint, and in 80% of cases, the reserves data for Uni v3 pairs is not returned. Instead, I receive the following response:

{
ā€œmessageā€: ā€œNo reserves data found for pairā€
}

from moralis import evm_api

api_key = "My API KEY"
params = {
  "chain": "eth",
  "pair_address": "0x331399c614ca67dee86733e5a2fba40dbb16827c"
}

result = evm_api.defi.get_pair_reserves(
  api_key=api_key,
  params=params,
)

print(result)

Hi @bjolbordi

It seems that the address that you are testing with is not a token pair contract created by the uniswap v3 contract factory or it is using a different contract standard.

This is an example contract which is created by Uniswap v3 contract factory. You can compare the code and available functions.
https://etherscan.io/address/0xe0fca1c1f2e6b07a9096723ceac992e721a54e7c#readContract

This is an address for a pair from the Pepe fork. I can provide more pairs, but they also do not work. I have some code that finds reserves, but my function does not work perfectly on v3 because I am trying to use a Moralis endpoint for this, but it doesnā€™t work. I encounter the same issue across other base chains as well, with the same response:

{
ā€œmessageā€: ā€œNo reserves data found for pairā€
}

Hi @bjolbordi

Let me share it with the devs and get back to you. We are currently working on some improvements for the token pair endpoint. This could be resolved with that.

1 Like