Pancakeswap getReserves method returns a static/non up to date value.

From what I've learned after reading a few earlier discussions on this sub reddit, an efficient way of getting up to date pair prices on pancakeswap is by getting the reserve amounts of the coins in the pair from bsc directly and dividing the reserve amount of one coin by the reserve amount of the other. I have written code that does this however, this approach does not seem to be generating up to date prices because the reserve amounts returned after each call is always the same. I ran the function every 10 seconds for about 2 hours and for all 2 hours the reserve amounts stayed the same which I know couldn't have been true because I observed significant price changes for the pair on pancakeswap's website within that same period. The code I've written is below. In this case the pair was DOT/BUSD. Does anyone know why this may be happening and what I can maybe do to get around this? Thanks a lot!

reddit image

1 thought on “Pancakeswap getReserves method returns a static/non up to date value.”

  1. Please note that PancakeSwap (or any wallet service) DOES NOT provide support through direct messages.

    There are multiple scams targeting crypto users and you should NEVER, under any circumstances, share your wallet seed
    phrase or any personal information with anyone online!

    Keep yourself safe:

    1. Never click on any unverified links.
    2. Never share your private keys or seed phrases.
    3. Reporting all suspicious users.
    4. Be suspicious of everything – do your own research!

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

Comments are closed.