npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pumpsui/factory-sdk

v1.2.0

Published

Official TypeScript SDK for creating, providing liquidity, and swapping on PumpSui AMM pools on the Sui Blockchain

Readme

@pumpsui/factory-sdk

Official TypeScript SDK for programmatic AMM liquidity pool creation, liquidity management, token swapping, and on-chain state querying on PumpSui (Sui Blockchain).

npm version License: MIT


📦 Installation

npm install @pumpsui/factory-sdk @mysten/sui
# or
pnpm add @pumpsui/factory-sdk @mysten/sui
# or
yarn add @pumpsui/factory-sdk @mysten/sui

⚡ Quick Start

import { SuiClient } from '@mysten/sui/client';
import { PumpSuiFactorySDK, parseSUI } from '@pumpsui/factory-sdk';

// 1. Initialize client and SDK
const client = new SuiClient({ url: 'https://fullnode.mainnet.sui.io:443' });
const sdk = new PumpSuiFactorySDK(client, 'MAINNET');

// 2. Build Create Pool PTB (Atomically splits SUI from gas & handles canonical Move sorting)
const createPoolTx = sdk.createPoolTransaction({
  tokenAType: '0x2::sui::SUI',
  tokenBType: '0xYOUR_TOKEN_PACKAGE::my_coin::MY_COIN',
  tokenAAmount: parseSUI(100),              // 100 SUI seed liquidity
  tokenBAmount: 1_000_000_000_000n,          // 1M tokens
  senderAddress: '0xYourWalletAddress',
  coinB: '0xCoinObjectIdForTokenB',          // Or array of coin IDs to merge
});

// 3. Query on-chain pool info
const poolInfo = await sdk.getPoolInfo('0xPoolSharedObjectId');
console.log('Reserves:', poolInfo.reserveA, poolInfo.reserveB);

// 4. Calculate exact swap output (x * y = k formula with 1.5% fee)
const output = sdk.calculateSwapOutput(
  parseSUI(10), // 10 SUI in
  poolInfo.reserveA,
  poolInfo.reserveB
);
console.log('Estimated Output:', output);

🛠️ API Reference

PumpSuiFactorySDK

Constructor

constructor(client: SuiClient, options?: SDKConfigOptions | 'MAINNET' | 'TESTNET')

PTB Generator Methods

| Method | Parameters | Return | Description | | :--- | :--- | :--- | :--- | | createPoolTransaction | PoolCreationParams | Transaction | Initializes new AMM pair with initial liquidity and protocol fee. | | addLiquidityTransaction | AddLiquidityParams | Transaction | Deposits dual assets into existing pool, minting proportional LP tokens. Free protocol fees. | | removeLiquidityTransaction | RemoveLiquidityParams | Transaction | Burns LP tokens and returns underlying reserves to caller. | | burnLiquidityLockTransaction| BurnLiquidityLockParams | Transaction | Irrevocably burns/locks LP tokens into the pool for permanent rug-proof liquidity. | | swapTransaction | SwapParams | Transaction | Swaps tokens with slippage protection (minAmountOut), deadline, and optional referral rewards. |

On-Chain Query Methods

| Method | Parameters | Return | Description | | :--- | :--- | :--- | :--- | | getPoolInfo | poolId: string | Promise<PoolInfo \| null> | Fetches reserves, LP supply, locked LP, fees, and volume metrics. | | getPoolByPair | tokenA: string, tokenB: string | Promise<string \| null> | Resolves the shared pool object ID for a given token pair. |


🧮 Mathematical Engine & Utilities

import {
  calculateSwapOutput,
  quoteOptimalLiquidity,
  estimateLPMinted,
  calculatePriceImpact,
  sortTokenTypes,
  parseSUI,
  formatSUI
} from '@pumpsui/factory-sdk';

// Calculate output after 1.5% fee
const tokenOut = calculateSwapOutput(amountIn, reserveIn, reserveOut);

// Calculate optimal token B for balanced deposit
const optimalB = quoteOptimalLiquidity(amountA, reserveA, reserveB);

// Sort canonical Move token pair
const [sortedA, sortedB] = sortTokenTypes(tokenA, tokenB);

// Convert units
const mist = parseSUI(2.5); // 2500000000n
const display = formatSUI(mist); // "2.50"

🌐 On-Chain Configuration

Sui Mainnet (Verified V3)

  • Package ID: 0xd7aabe644acc2ef74377f7a0113189691dc7d031074bd4ec01af1023dc4c0686
  • Factory Object (Shared): 0xd8e9d4dfae7b2caa0c03b029772c74c3a9a9822d81b8ca773bbac063ec328b4e
  • Clock Object: 0x6
  • Fee Collector: 0x97d85ec54cc44892e8d0a34204ee080c60db55d2b9997e460b9c223791983b79

📖 Complete Documentation

Official developer portal and interactive guides:


📄 License

MIT © PumpSui