Closed akwaaad closed 6 months ago
Please provide your swap code
Issue was that I was putting amountToSwap with making a new BN instance
const swapResult = CurveCalculator.swap(
new BN(amountToSwap),
rpcData.baseReserve,
rpcData.quoteReserve,
rpcData.configInfo.tradeFeeRate
)
Getting error when using CurveCalculator.swap
https://github.com/raydium-io/raydium-sdk-V2-demo/blob/ca8615fce7d911eece0370d58f2d67b016482aa9/src/cpmm/swap.ts#L17
rpcData looking good