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.

15 lines (12 loc) 554 B
'use strict'; 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); } exports.calculateWithSlippageBuy = calculateWithSlippageBuy; exports.calculateWithSlippageSell = calculateWithSlippageSell; //# sourceMappingURL=slippage.cjs.map