An automated Solana bot that bundles and executes token migration transactions from Pumpfun to Pumpswap using Jito bundles for optimal transaction sequencing and execution speed.
This bot automates the process of buying tokens on Pumpfun and migrating them to Pumpswap in a single atomic transaction bundle. By leveraging Jito's transaction bundling service, it ensures that both the buy and migration operations execute together, providing better transaction reliability and reduced risk of front-running.
- Atomic Bundling: Executes buy and migration as a single bundle using Jito
- Transaction Reliability: Ensures buy and migrate operations succeed or fail together
- MEV Protection: Uses Jito tip accounts for priority block inclusion
- Type-Safe: Built with TypeScript and Anchor program types
- Modular Architecture: Clean separation of concerns with organized code structure
- Buy Transaction: Creates a transaction to purchase tokens on Pumpfun's bonding curve
- Migration Transaction: Generates a transaction to migrate tokens from Pumpfun to Pumpswap
- Bundle Creation: Packages both transactions with a Jito tip into a single bundle
- Execution: Sends the bundle to Jito for atomic execution on Solana
The bot ensures that both operations either succeed together or fail together, preventing partial executions that could leave tokens in an undesirable state.
├── config/ # Configuration and constants
│ ├── constants.ts # Environment variables and settings
│ └── index.ts # Config exports
├── src/
│ ├── lib/ # Transaction builders
│ │ ├── pumpfun.ts # Pumpfun transaction creation
│ │ ├── swap.ts # Pumpswap transaction creation
│ │ └── index.ts # Library exports
│ └── bundler/ # Jito bundling logic
│ └── index.ts # Bundle sending functionality
├── contracts/ # Program IDLs and types
│ ├── pumpfun-idl.json
│ ├── pumpswap-idl.json
│ └── *.ts # TypeScript type definitions
├── utils/ # Utility functions
│ ├── utils.ts # Helper functions
│ └── index.ts # Utils exports
├── index.ts # Main entry point
└── package.json # Dependencies
- Node.js 18+ and npm
- Solana CLI tools
- Environment variables configured
npm installCreate a .env file with the following variables:
# Wallet
PRIVATE_KEY=your_base58_encoded_private_key
# RPC Endpoints
RPC_ENDPOINT=https://your-rpc-endpoint
RPC_WEBSOCKET_ENDPOINT=wss://your-websocket-endpoint
# Token Configuration
TOKEN_MINT=token_mint_address_to_migrate
# Optional Configuration
JITO_TIP=0.001
FEE_RECIPIENT=CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtPY2dH3w
# Pumpswap Configuration (required if using swap functions)
GLOBAL_CONFIG=global_config_address
PROTOCOL_FEE_RECIPIENT=protocol_fee_recipient_address
PUMP_AMM_PROGRAM_ID=pump_amm_program_idEnsure the following files are present in the contracts/ directory:
pumpfun-idl.json- Pumpfun program IDLpumpswap-idl.json- Pumpswap program IDLpumpfun-types.ts- TypeScript types for Pumpfunpumpswap-types.ts- TypeScript types for Pumpswappumpswap.ts- Pumpswap program type definitions
Run the migration bundler:
npm startThe bot will:
- Connect to the specified RPC endpoint
- Verify the bonding curve pool exists
- Create buy and migration transactions
- Bundle them with a Jito tip
- Send the bundle for execution
- Pumpfun Operations: Create buy and migrate transactions for Pumpfun tokens
- Pumpswap Operations: Create buy/sell transactions for Pumpswap AMM (available but not used in main flow)
Handles Jito bundle creation and submission, ensuring transactions are sent as atomic units.
Centralized configuration management with environment variable handling and type-safe constants.
- Modular Design: Separates transaction building, bundling, and configuration for maintainability
- Type Safety: Uses Anchor-generated types for program interactions
- Error Handling: Comprehensive error handling with null checks and transaction validation
- Jito Integration: Leverages Jito for reliable transaction bundling and MEV protection
- Private keys should never be committed to version control
- Use environment variables or secure key management systems
- Review all transactions before execution in production
- Ensure sufficient SOL balance for fees and Jito tips
Key dependencies include:
@solana/web3.js- Solana JavaScript SDK@coral-xyz/anchor- Anchor framework for Solana programsjito-ts- Jito transaction bundling SDK@solana/spl-token- SPL token program utilities
- Telegram: https://t.me/Kei4650
- Twitter: https://x.com/kei_4650