UNPKG

pumpdotfun-sdk-repumped

Version:

Pumpfun SDK — create, buy, sell tokens with support for Jito bundles and multiple relayer integrations. Rebuilt and fixed pumpdotfun-sdk.

12 lines (10 loc) 479 B
const calculateWithSlippageBuy = (amount, basisPoints) => { return amount + (amount * basisPoints) / 10000n; }; function calculateWithSlippageSell(amount, slippageBasisPoints = 500n) { // Actually use the slippage basis points for calculation const reduction = Math.max(1, Number((amount * slippageBasisPoints) / 10000n)); return amount - BigInt(reduction); } export { calculateWithSlippageBuy, calculateWithSlippageSell }; //# sourceMappingURL=slippage.mjs.map