Skip to content

Latest commit

 

History

History
188 lines (148 loc) · 5.74 KB

File metadata and controls

188 lines (148 loc) · 5.74 KB

🎯 PumpSwap Provider Analysis & Recommendations

Current Status: Working but Limited

The pump-swap provider is currently functional but only supports pump.fun bonding curve tokens, not universal token swapping as the name suggests.

🔍 Problem Analysis

1. Misleading Name

// Current provider name suggests universal swapping
'pump-swap': {
  // But implementation only works for pump.fun tokens
}

2. Limited Token Support

  • Works: pump.fun bonding curve tokens (.pump addresses)
  • Fails: Standard SPL tokens (SOL, USDC, USDT, BONK, etc.)
  • Fails: Established meme coins not on pump.fun

3. API Constraint

// Uses PumpPortal API which is pump.fun specific
apiUrl: 'https://pumpportal.fun/api/trade-local'
body: {
  pool: 'pump'  // ❌ Hardcoded to pump.fun only
}

📊 Provider Comparison

Provider Token Support Use Case
Jupiter ✅ All SPL tokens Universal DEX aggregator
Solana Tracker ✅ All SPL tokens Analytics-based routing
DFlow ✅ All SPL tokens Intent-based trading
GMGN ✅ All SPL tokens Community-driven routing
pump-swap ❌ Only pump.fun tokens New token launches only

🎯 Three Solution Options

Option 1: Honest Renaming (Recommended)

Accept the current limitation and rename to reflect reality:

// 1. Update type system
export type TradeProvider = 'jupiter' | 'dflow' | 'solana-tracker' | 'gmgn' | 'pump-fun'

// 2. Update provider config
'pump-fun': {
  apiUrl: 'https://pumpportal.fun/api',
  scope: 'Pump.fun bonding curve tokens only',
  rpcUrl: 'https://pump-fe.helius-rpc.com/?api-key=...'
}

// 3. Update UI
case 'pump-fun': return '🚀'  // Keep same icon

Benefits:

  • ✅ Honest about capabilities
  • ✅ No breaking functionality
  • ✅ Clear user expectations
  • ✅ Fast implementation

Option 2: Hybrid Implementation

Create intelligent routing based on token type:

async function getPumpSwapQuote(request: TradeQuoteRequest): Promise<ProviderQuote> {
  // Detect if token is pump.fun bonding curve token
  if (isPumpFunToken(request.outputMint)) {
    return await getPumpFunQuote(request)  // Use PumpPortal API
  } else {
    return await getJupiterQuote(request)  // Use Jupiter for everything else
  }
}

function isPumpFunToken(mint: string): boolean {
  // Check if token address ends with "pump" or is known pump.fun token
  return mint.endsWith('pump') || KNOWN_PUMP_TOKENS.has(mint)
}

Benefits:

  • ✅ Universal token support
  • ✅ Specialized pump.fun handling
  • ✅ Maintains "pump-swap" name accuracy
  • ⚠️ Complex implementation

Option 3: Full Universal Implementation

Find or build a real universal PumpSwap AMM API:

'pump-swap': {
  // Hypothetical universal PumpSwap API
  apiUrl: 'https://api.pumpswap.com/v1',
  endpoints: {
    quote: '/quote',        // For any token pair
    pools: '/pools',        // Pool information
    routes: '/routes'       // Route optimization
  }
}

Challenges:

  • ❌ No known universal PumpSwap API exists
  • ❌ Would require building custom API
  • ❌ Significant development effort

💡 Immediate Recommendation: Option 1

The most pragmatic solution is Option 1: Honest Renaming

Implementation Steps:

  1. Rename Provider: 'pump-swap''pump-fun'
  2. Update Documentation: Clearly state "pump.fun tokens only"
  3. Maintain Functionality: Keep all current PumpPortal integration
  4. Add Token Detection: Warn users when trying non-pump.fun tokens

Code Changes Required:

// src/types/index.ts
export type TradeProvider = 'jupiter' | 'dflow' | 'solana-tracker' | 'gmgn' | 'pump-fun'

// src/utils/trade-comparison.ts
'pump-fun': {
  apiUrl: 'https://pumpportal.fun/api',
  rpcUrl: 'https://pump-fe.helius-rpc.com/?api-key=...',
  scope: 'Pump.fun bonding curve tokens only'
}

// src/components/TradeComparison.tsx
case 'pump-fun': return '🚀'

🚀 Future Enhancement: Option 2

Once Option 1 is complete, we can enhance with intelligent routing:

async function getUniversalPumpSwapQuote(request: TradeQuoteRequest): Promise<ProviderQuote> {
  try {
    // First, try pump.fun for bonding curve tokens
    if (isPumpFunToken(request.outputMint)) {
      const pumpQuote = await getPumpFunQuote(request)
      if (pumpQuote.success) return pumpQuote
    }
    
    // Fallback to Jupiter for all other tokens
    return await getJupiterQuote(request)
  } catch (error) {
    return createErrorQuote(request, error)
  }
}

📈 Expected Outcomes

With Option 1 (Honest Renaming):

  • ✅ Clear user expectations
  • ✅ No confused users trying SOL/USDC on pump-swap
  • ✅ Accurate provider naming
  • ✅ Maintained functionality for pump.fun tokens

With Future Option 2 (Hybrid):

  • ✅ Universal token support
  • ✅ Best-of-both-worlds approach
  • ✅ Specialized pump.fun optimization
  • ✅ Competitive with other providers

🎯 Conclusion

The current pump-swap provider is working correctly but misnamed. It's a specialized pump.fun provider, not a universal token swapper.

Immediate Action: Rename to pump-fun for honesty and clarity. Future Enhancement: Add intelligent routing for universal support.

This approach provides:

  1. Immediate clarity about capabilities
  2. Preserved functionality for pump.fun use cases
  3. Future path toward universal support
  4. Better user experience with accurate expectations

🎯 Bottom Line: The provider should be named pump-fun to accurately reflect its pump.fun-only capabilities, with future enhancement for universal token support.