0

When Using Pancake Swap SDK

The Following Function

  const exactOut = new Trade.bestTradeExactOut(
          [pair_0_1],
          token0,
          new TokenAmount(token1, parseFloat(amountOut.toString(), 18)),
          { maxNumResults: 3, maxHops: 1 }
         
        )

we receive the following response

 outputAmount: TokenAmount {
    numerator: JSBI(1) [ 100, sign: false ],
    denominator: JSBI(2) [ 660865024, 931322574, sign: false ],
    currency: Token {
      decimals: 18,
      symbol: 't1',
      name: xxx,
      chainId: 56,
      address: 'xxx'
    },
    token: Token {
      decimals: 18,
      symbol: 't1',
      name: xxx,
      chainId: 56,
      address: 'xxx'
    }
  },

based on the above response how does one calculate the exact amounts of tokens one would receive out based on returning result from SDK call do we perform a calculation on?

denominator: JSBI(2) [ 660865024, 931322574, sign: false ]

1 Answer 1

0

One Needs To Use The Following Function

parseBigintIsh(denominator)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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