QUICKSTART GUIDE · POOL FACTORY INTEGRATION

Factory Integration Quickstart

Integrate automated liquidity pool instantiation into your Sui application in four clear steps.

STEP 01

Install the Factory SDK & Sui Client

Install modern Sui Move dependencies:

npm install @pumpsui/factory-sdk @mysten/sui @mysten/dapp-kit
STEP 02

Initialize Factory SDK Singleton

Create a centralized factory instance in src/lib/poolFactory.ts:

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

export const suiClient = new SuiClient({ 
  url: 'https://fullnode.mainnet.sui.io:443' 
});

export const factorySDK = new PumpSuiFactorySDK(suiClient, 'MAINNET');
export const POOL_CREATION_FEE_MIST = 800_000_000n; // 0.8 SUI in MIST
STEP 03

Create Pool Component

Build the interactive trigger component:

import React from 'react';
import { useSignAndExecuteTransaction } from '@mysten/dapp-kit';
import { factorySDK } from '@/lib/poolFactory';

export function CreatePoolButton({ 
  tokenType, 
  userAddress 
}: { 
  tokenType: string; 
  userAddress: string; 
}) {
  const { mutate: signAndExecute } = useSignAndExecuteTransaction();

  const handleCreatePool = async () => {
    try {
      const tx = factorySDK.createPoolTransaction({
        tokenAType: '0x2::sui::SUI',
        tokenBType: tokenType,
        tokenAAmount: 100_000_000_000n, // 100 SUI
        tokenBAmount: 1_000_000_000_000n, // 1,000,000 tokens (9 dec)
        senderAddress: userAddress,
      });

      signAndExecute(
        { transaction: tx },
        {
          onSuccess: (res) => alert(`Pool Created! Digest: ${res.digest}`),
          onError: (err) => alert(`Error: ${err.message}`),
        }
      );
    } catch (err: any) {
      console.error('Pool creation error:', err);
    }
  };

  return (
    <button
      onClick={handleCreatePool}
      className="px-5 py-2.5 bg-gradient-to-r from-cyan-400 to-blue-500 text-slate-950 font-mono font-bold text-xs rounded-xl"
    >
      Launch Liquidity Pool
    </button>
  );
}

Automated 0.8 SUI Fee Split

The SDK automatically injects the required 0.8 SUI (800_000_000 MIST) creation payment into the PTB by splitting the caller's primary gas coin. Adding and removing liquidity subsequent to pool creation carries zero protocol fees.

Consult the Complete Integration Guide

Read in-depth instructions on Move events, tick spacing, and concentrated liquidity.