Welcome! This guide will get you up and running with the pump.fun SDK in just a few minutes.
# Clone the repository
git clone <your-repo-url>
cd pumpdotfun-sdk
# Run the automatic setup script
./scripts/setup.shThe setup script will:
- Install Solana CLI (if needed)
- Create a devnet wallet
- Fund it with 2 SOL for testing
- Configure everything for you
# Build the project
cargo build
# Run the simple example
cargo run --bin simple_example🎉 That's it! You just created a token and bought some on pump.fun devnet!
The simple example:
- ✅ Connected to Solana devnet
- 🪙 Created a new token called "Test Pump Token" (TEST)
- 💰 Bought 0.1 tokens using your devnet SOL
- 📋 Displayed the transaction signatures
You can verify the transactions on Solana Explorer by pasting the transaction IDs.
After running the example, you'll see output like:
✅ Token created! Mint: AbC1234... | TX: def5678...
✅ Tokens purchased! TX: ghi9012...
Copy those transaction IDs and view them on Solana Explorer (Devnet).
cargo run --bin pump_fun_exampleThis example shows token creation, buying, AND selling.
Check out the code structure:
src/lib.rs- Main SDKexamples/simple_example.rs- Basic usageexamples/pump_fun_example.rs- Advanced usage
Add to your Cargo.toml:
[dependencies]
pumpdotfun-sdk = { path = "path/to/pumpdotfun-sdk" }
solana-client = "2.3.4"
solana-sdk = "2.3.1"let sdk = PumpDotFunSdk::new(rpc_client);
let instruction = sdk.create(accounts, args);let instructions = sdk.buy(accounts, buy_args)?;let instructions = sdk.sell(accounts, sell_args)?;When you run the examples, you'll see:
- Wallet address: Your devnet wallet public key
- Balance: Your SOL balance (should be ~2 SOL after setup)
- Mint address: The new token's unique identifier
- Transaction IDs: Blockchain transaction signatures
- This is DEVNET: Use fake SOL, no real money involved
- Slippage: We use 10% slippage for safety (price can vary ±10%)
- Gas fees: Each transaction costs a tiny amount of SOL (~0.00025 SOL)
- Token decimals: Tokens typically use 9 decimal places
# The setup script should create this, but if needed:
solana-keygen new --outfile ~/.config/solana/devnet-wallet.json# Get more devnet SOL:
solana airdrop 2 --url devnet- Wait a moment and try again (devnet can be slow)
- Check your internet connection
# Update Rust:
rustup update
# Clean and rebuild:
cargo clean && cargo build- Read the full README.md for detailed documentation
- Explore the examples/ directory for more code samples
- Check the src/ directory to understand the SDK internals
- Create an issue in this repository
- Check the Solana documentation
- Visit the Anchor documentation
Ready to build something awesome with pump.fun? 🚀