The Pump.fun module provides comprehensive integration with the Pump.fun platform and PumpSwap AMM, enabling users to launch meme tokens, trade on bonding curves, and participate in automated market making.

Core Functionalities

Token Launching

Create and launch new tokens on Pump.fun with metadata upload, social links, and initial liquidity

Bonding Curve Trading

Buy and sell tokens using Pump.fun’s bonding curve mechanism with automatic Raydium migration

AMM Operations

Full PumpSwap AMM integration with swapping, liquidity management, and pool creation

RugCheck Integration

Automatic token verification submission to RugCheck for community safety

Installation & Setup

1

Backend Configuration

Ensure your backend server is running for metadata uploads and PumpSwap SDK:

SERVER_URL=http://localhost:8080/api
2

Environment Variables

Configure required environment variables in .env.local:

SERVER_URL=your_backend_server_url
HELIUS_STAKED_URL=your_helius_rpc_endpoint
COMMISSION_WALLET=your_commission_wallet_address
3

Import Module

Import the components and services you need:

import { 
  PumpfunLaunchSection,
  PumpfunBuySection,
  PumpSwapScreen,
  usePumpFun 
} from '@/modules/pump-fun';

Backend Dependency: This module requires a backend service for metadata uploads and PumpSwap SDK interactions. Ensure proper server configuration.

Module Architecture

src/modules/pump-fun/
├── components/             # UI components for both platforms
│   ├── pump-swap/         # PumpSwap AMM specific components
│   ├── PumpfunBuySection.tsx
│   ├── PumpfunLaunchSection.tsx
│   └── PumpfunSellSection.tsx
├── hooks/                 # React hooks for interactions
├── navigation/            # PumpSwap navigation setup
├── screens/               # Complete screen implementations
├── services/              # API integration and business logic
├── types/                 # TypeScript definitions
└── utils/                 # Helper functions and utilities

Core Components

PumpfunLaunchSection - Complete token creation interface

import { PumpfunLaunchSection } from '@/modules/pump-fun';

function TokenLaunchScreen() {
  const handleTokenLaunched = (tokenData) => {
    console.log('Token launched:', tokenData);
    // Handle success (navigation, notifications, etc.)
  };
  
  return (
    <PumpfunLaunchSection
      onTokenLaunched={handleTokenLaunched}
      containerStyle={styles.launchContainer}
      enableSocialLinks={true}
      enableRugCheckSubmission={true}
    />
  );
}

Features:

  • Token metadata input (name, symbol, description)
  • Image upload and processing
  • Social media links integration
  • Initial buy amount configuration
  • Automatic metadata upload to IPFS
  • RugCheck verification submission

Core Hook: usePumpFun

The primary hook for Pump.fun interactions:

import { usePumpFun } from '@/modules/pump-fun';
import { useWallet } from '@/modules/wallet-providers';

function PumpfunTradingComponent() {
  const { wallet } = useWallet();
  const { 
    launchToken, 
    buyToken, 
    sellToken, 
    submitTokenForVerification,
    loading,
    error 
  } = usePumpFun();

  const handleLaunchToken = async (tokenData) => {
    try {
      const result = await launchToken({
        name: tokenData.name,
        symbol: tokenData.symbol,
        description: tokenData.description,
        image: tokenData.image,
        socialLinks: tokenData.socialLinks,
        initialBuy: tokenData.initialBuy
      });
      
      console.log('Token launched:', result);
      
      // Automatically submit for verification
      await submitTokenForVerification(result.mint);
    } catch (error) {
      console.error('Launch failed:', error);
    }
  };

  const handleBuyToken = async (mint, amount) => {
    try {
      const result = await buyToken(mint, amount);
      console.log('Purchase successful:', result);
    } catch (error) {
      console.error('Buy failed:', error);
    }
  };

  return (
    <View>
      <TokenLaunchForm onSubmit={handleLaunchToken} />
      <TokenTradingInterface onBuy={handleBuyToken} />
    </View>
  );
}

Hook Functions:

  • launchToken(params) - Create and launch new token
  • buyToken(mint, amount) - Purchase tokens
  • sellToken(mint, amount) - Sell tokens
  • submitTokenForVerification(mint) - Submit to RugCheck

Services Overview

Quick Start Examples

import { usePumpFun } from '@/modules/pump-fun';
import { useWallet } from '@/modules/wallet-providers';

function MemeLaunchPlatform() {
  const { wallet } = useWallet();
  const { launchToken, submitTokenForVerification } = usePumpFun();
  const [launching, setLaunching] = useState(false);

  const handleLaunchMeme = async (formData) => {
    if (!wallet) return;
    
    setLaunching(true);
    try {
      // Launch the token
      const result = await launchToken({
        name: formData.name,
        symbol: formData.symbol,
        description: formData.description,
        image: formData.image,
        website: formData.website,
        twitter: formData.twitter,
        telegram: formData.telegram,
        initialBuy: formData.initialBuy || 0.1
      });
      
      console.log('🚀 Token launched:', result);
      
      // Submit for RugCheck verification
      await submitTokenForVerification(result.mint);
      
      Alert.alert(
        'Success!', 
        `${formData.name} launched successfully!\nMint: ${result.mint}`
      );
      
    } catch (error) {
      Alert.alert('Launch Failed', error.message);
    } finally {
      setLaunching(false);
    }
  };

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Launch Your Meme Token</Text>
      
      <TokenLaunchForm
        onSubmit={handleLaunchMeme}
        loading={launching}
        disabled={!wallet}
      />
      
      {!wallet && (
        <ConnectWalletPrompt message="Connect wallet to launch tokens" />
      )}
    </View>
  );
}

Advanced Features

Intelligent Token Routing

The module automatically detects whether tokens are on Pump.fun bonding curves or have migrated to Raydium:

function useIntelligentTrading() {
  const { buyToken } = usePumpFun();

  const smartBuy = async (tokenMint, amount) => {
    try {
      // Service automatically checks:
      // 1. Is token still on Pump.fun bonding curve?
      // 2. Has it migrated to Raydium?
      // 3. Routes to appropriate platform
      
      const result = await buyToken(tokenMint, amount);
      
      console.log(`Purchased via ${result.platform}:`, result);
      return result;
    } catch (error) {
      console.error('Smart buy failed:', error);
      throw error;
    }
  };

  return { smartBuy };
}

Bonding Curve Visualization

function BondingCurveChart({ tokenMint }) {
  const [curveData, setCurveData] = useState(null);

  useEffect(() => {
    loadBondingCurveData();
  }, [tokenMint]);

  const loadBondingCurveData = async () => {
    try {
      const data = await pumpfunService.getBondingCurveData(tokenMint);
      setCurveData(data);
    } catch (error) {
      console.error('Failed to load bonding curve:', error);
    }
  };

  return (
    <View style={styles.chartContainer}>
      <Text style={styles.chartTitle}>Bonding Curve Progress</Text>
      
      {curveData && (
        <View>
          <ProgressBar 
            progress={curveData.progress} 
            style={styles.progressBar}
          />
          <Text style={styles.progressText}>
            {(curveData.progress * 100).toFixed(1)}% to Raydium migration
          </Text>
          <Text style={styles.priceText}>
            Current Price: {curveData.currentPrice} SOL
          </Text>
        </View>
      )}
    </View>
  );
}

Social Integration & Verification

function useSocialTokenLaunch() {
  const { launchToken, submitTokenForVerification } = usePumpFun();
  const { createPost } = useThread();

  const launchAndAnnounce = async (tokenData) => {
    try {
      // Launch the token
      const result = await launchToken(tokenData);
      
      // Submit for verification
      await submitTokenForVerification(result.mint);
      
      // Create social post
      await createPost({
        content: `🚀 Just launched ${tokenData.name} ($${tokenData.symbol})!\n\n${tokenData.description}`,
        type: 'token_launch',
        attachments: [
          {
            type: 'token',
            mint: result.mint,
            name: tokenData.name,
            symbol: tokenData.symbol,
            image: tokenData.image
          }
        ]
      });
      
      return result;
    } catch (error) {
      console.error('Launch and announce failed:', error);
      throw error;
    }
  };

  return { launchAndAnnounce };
}

Utility Functions

utility_functions
object

Integration with Other Modules

Combined Workflow Example

import { useWallet } from '@/modules/wallet-providers';
import { useFetchTokens } from '@/modules/data-module';
import { useThread } from '@/core/thread';
import { usePumpFun } from '@/modules/pump-fun';

function IntegratedMemeplatform() {
  const { wallet } = useWallet();
  const { refetch: refetchTokens } = useFetchTokens(wallet?.address);
  const { createPost } = useThread();
  const { launchToken, submitTokenForVerification } = usePumpFun();

  const handleMemeLaunch = async (tokenData) => {
    try {
      // Launch token
      const result = await launchToken(tokenData);
      
      // Refresh user's portfolio
      await refetchTokens();
      
      // Submit for verification
      await submitTokenForVerification(result.mint);
      
      // Create announcement post
      await createPost({
        content: `🚀 Just launched my meme token ${tokenData.name}! Who's ready to pump it? 📈`,
        type: 'token_launch',
        sections: [
          {
            type: 'trade',
            data: {
              tokenAddress: result.mint,
              action: 'buy',
              platform: 'pump.fun'
            }
          }
        ]
      });
      
      return result;
    } catch (error) {
      console.error('Integrated launch failed:', error);
      throw error;
    }
  };

  return <MemeLaunchInterface onLaunch={handleMemeLaunch} />;
}

Error Handling & Troubleshooting

common_issues
object
function RobustPumpfunOperations() {
  const [retryCount, setRetryCount] = useState(0);
  const maxRetries = 3;

  const safeOperation = async (operation, params) => {
    try {
      return await operation(params);
    } catch (error) {
      console.error('Operation failed:', error);
      
      if (retryCount < maxRetries && error.message.includes('network')) {
        setRetryCount(prev => prev + 1);
        await new Promise(resolve => setTimeout(resolve, 1000 * retryCount));
        return safeOperation(operation, params);
      }
      
      throw error;
    }
  };

  return { safeOperation };
}

Performance Considerations

Backend Optimization: Use backend services for heavy SDK operations to improve mobile app performance and reduce bundle size.

Rate Limits: Be mindful of API rate limits when making frequent price updates or metadata requests.

API Reference

For detailed API documentation, see:


The Pump.fun module provides everything needed to build a complete meme token ecosystem, from viral token launches to sophisticated AMM trading, all with built-in social features and community verification.