3
  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?

3
  • I am voting to close this question because this question is not about Ethereum blockchain, but it is about Binance Smart Chain and belongs to a different forum. Mar 25 at 23:00
  • 2
    @Mikko Ohtamaa the Binance Smart Chain runs on the EVM like Ethereum...
    – Paulus
    Mar 25 at 23:02
  • 2
    I would agree with OP. Almost all questions relating to Ethereum apply to BSC, It makes no sense to have a separate stackexchange for BSC.
    – Undead8
    Mar 26 at 0:30
2

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

3
  • I can easily find Uniswap router address online, but I am not able to find PancakeSwap router address online, I want to use the router to swap a token from my ERC20 contract. Apr 28 at 14:05
  • 1
  • 2
    Please consider that they have recently migrated to V2 and therefore also created a new router and factory contract! -> New router contract: 0x10ED43C718714eb63d5aA57B78B54704E256024E -> New Factory contract: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73
    – Paulus
    Apr 30 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.