PumpFun Launch Bundler
Bundle token creation, liquidity addition, and initial buys into a single atomic transaction for fair launches.
Features
- Atomic Execution: All-or-nothing transaction bundling
- Fair Launch: Creation and the first buys land together in one bundle, so no one can buy between them
- Multi-Wallet Support: Distribute initial supply across wallets
- Instant Liquidity: Add liquidity in the same transaction
- MEV Protection: Sent through AllenHark Relay over private connections, not public gossip
Installation
npm install @allenhark/launch-bundlerConfiguration
{
"token": {
"name": "My Token",
"symbol": "MTK",
"decimals": 9,
"supply": 1000000000
},
"liquidity": {
"initialSOL": 5.0,
"initialTokens": 500000000
},
"distribution": [
{
"wallet": "wallet1_pubkey",
"amount": 100000000
},
{
"wallet": "wallet2_pubkey",
"amount": 100000000
}
]
}Usage
import { LaunchBundler } from '@allenhark/launch-bundler';
const bundler = new LaunchBundler({
rpcUrl: process.env.ALLENHARK_RPC_URL!,
relayUrl: process.env.ALLENHARK_RELAY_URL!,
wallet: loadWallet(),
});
// Create launch bundle
const bundle = await bundler.createBundle({
token: {
name: "My Token",
symbol: "MTK",
decimals: 9,
supply: 1_000_000_000,
},
liquidity: {
dex: 'raydium',
solAmount: 5.0,
tokenAmount: 500_000_000,
},
initialBuys: [
{ wallet: wallet1, amount: 0.1 },
{ wallet: wallet2, amount: 0.1 },
{ wallet: wallet3, amount: 0.1 },
],
});
// Execute bundle atomically
const result = await bundler.execute(bundle);
console.log('Token launched:', result.tokenMint);
console.log('Pool created:', result.poolAddress);Advanced Features
Custom Token Metadata
const bundle = await bundler.createBundle({
token: {
name: "My Token",
symbol: "MTK",
decimals: 9,
supply: 1_000_000_000,
metadata: {
uri: "https://arweave.net/metadata.json",
sellerFeeBasisPoints: 0,
creators: [
{
address: creatorWallet.publicKey,
verified: true,
share: 100,
},
],
},
},
// ... rest of config
});Multi-DEX Launch
// Launch on multiple DEXes simultaneously
const multiBundle = await bundler.createMultiDexBundle({
token: tokenConfig,
launches: [
{
dex: 'raydium',
solAmount: 3.0,
tokenAmount: 300_000_000,
},
{
dex: 'orca',
solAmount: 2.0,
tokenAmount: 200_000_000,
},
],
});Vesting Schedule
// Add vesting for team tokens
const bundle = await bundler.createBundle({
token: tokenConfig,
liquidity: liquidityConfig,
vesting: [
{
wallet: teamWallet,
amount: 100_000_000,
schedule: {
cliff: 30 * 24 * 60 * 60, // 30 days
duration: 365 * 24 * 60 * 60, // 1 year
slices: 12, // Monthly releases
},
},
],
});Security Features
Anti-Snipe Protection
bundler.setAntiSnipe({
enabled: true,
maxBuyPerWallet: 1.0, // SOL
cooldownPeriod: 60, // seconds
});Liquidity Lock
// Lock liquidity for specified duration
const bundle = await bundler.createBundle({
token: tokenConfig,
liquidity: {
...liquidityConfig,
lock: {
duration: 90 * 24 * 60 * 60, // 90 days
provider: 'allenhark-locker',
},
},
});Monitoring
// Monitor bundle status
bundler.on('bundleCreated', (bundle) => {
console.log('Bundle created:', bundle.id);
});
bundler.on('bundleExecuting', (bundle) => {
console.log('Executing bundle:', bundle.id);
});
bundler.on('bundleComplete', (result) => {
console.log('Launch complete!');
console.log('Token:', result.tokenMint);
console.log('Pool:', result.poolAddress);
console.log('Signature:', result.signature);
});Cost Estimation
const estimate = await bundler.estimateCosts({
token: tokenConfig,
liquidity: liquidityConfig,
initialBuys: buysConfig,
});
console.log({
rentExemption: estimate.rent,
transactionFees: estimate.fees,
totalCost: estimate.total,
});Best Practices
- Test on Devnet: Always test your bundle configuration first
- Use Private Relay: Prevent front-running with AllenHark Relay
- Verify Metadata: Double-check token metadata before launch
- Lock Liquidity: Build trust by locking LP tokens
- Fair Distribution: Avoid concentration in few wallets
