raydium-io / raydium-sdk-V2-demo

Open-source Typescript SDK demos
48 stars 31 forks source link

Slippage do not calc correct #72

Closed dexweb3 closed 2 months ago

dexweb3 commented 2 months ago

https://github.com/raydium-io/raydium-sdk-V2-demo/blob/a7c35e51c33ebf4b04df06dbf6b095c44d84c83b/src/amm/swap.ts#L52

After update to new version from 0.1.22 I got that all my general trx do not works with slippage error

Sleppage value - 0.99

Logs: console.log(Number(out.amountOut)); // 10490900 console.log(Number(out.minAmountOut)); // 20876891

if market price 10490900 -- how is it possible that after set 0.99 (99%) slippage I got this value - 20876891 ?

cruzshia commented 2 months ago

fixed in commit https://github.com/raydium-io/raydium-sdk-V2-demo/commit/80cd553728e176b4370cfb41e7a1ad06d6ae3280