[Ethereum] Retrieve price data from PancakeSwap [BSC]

bscdecentralized-exchangeexchange-api

  1. Does PancakeSwap use the same constant product formula as Uniswap (x * y = k)? Because then I should be able to calculate a token pair exchange rate by just dividing the amount of token1 reserves by the amount of token2 reserves.

  2. Is there an API that could deliver me the wanted token pair exchange rates?

  3. Is there any other function in their contract to fetch price data from?

Best Answer

Pancake Swap uses the same formula as Uniswap, but they have a 0.2% fee instead of 0.3% fee, which affects the calculation.

Related Topic