Unable to fetch reserves for certain tokens

Hi, i am not able to get reserves for certains meme tokens. Cant find anything they share in common but here are two examples maybe you can find a way to be able to provide reserve data for them.

import Moralis from 'moralis';

try {
  await Moralis.start({
    apiKey: "YOUR_API_KEY"
  });

  const response = await Moralis.EvmApi.defi.getPairReserves({
    "chain": "0x1",
    "pairAddress": "0xdce93ed9ae7c53143e19cf799d156b72d1cc2777"
  });

  console.log(response.raw);
} catch (e) {
  console.error(e);
}
import Moralis from 'moralis';

try {
  await Moralis.start({
    apiKey: "YOUR_API_KEY"
  });

  const response = await Moralis.EvmApi.defi.getPairReserves({
    "chain": "0x1",
    "pairAddress": "0x6c4c7f46d9d4ef6bc5c9e155f011ad19fc4ef321"
  });

  console.log(response.raw);
} catch (e) {
  console.error(e);
}

Hey there, looks like the addresses you are providing are v3 pools, which currently we do not support. For now, it can only be used for v2 pools as explained in docs.

1 Like

Sorry i missed that part, 2 questions

  1. Is there an estimated date for when V3 reserves will be available?
  2. Are there any alternatives you can suggest while waiting?

Thank you

Hey @Jthopkins1986

No probs!

  1. There is no ETA for this at the moment
  2. You can always call this manually from the uniswap contracts as they have functions to fetch the reserves very easily. All you need is the address of the reserves/pool, which you can get with getPairAddress API here

Is this what you have in mind? Because its ok but faces lots of downtime used it before but switched to Moralis as Moralis is much more consistent and never fails to fetch v2 reserves, was hoping to use moralis for all reserves, if you know other option other from below subgraph, please share


{
  pair(id: "<pair_address>") {
    token0 {
      symbol
      name
    }
    token1 {
      symbol
      name
    }
    reserve0
    reserve1
  }
}

Hi @Jthopkins1986

Did you try the endpoint from this page? The code which you shared looks different than our API.

If the dex has any native api to get mode details about the token pairs then you can use their API.

yes, i get the pairAddresses, looking to get v3 reserves, went to uniswap subgraph to do so, wondering if there are any other methods

We have limited endpoints for this. Not sure about the options. I guess the best way is to use the API provided by dex. You can test alternate solutions.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.