swap

Build pump.fun swap transactions for bonding curve or AMM tokens.

5|Updated May 2, 2026
One-click install
npx skills add https://github.com/nirholas/three-ui --skill swap-nirholas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swap
Source: https://github.com/nirholas/three-ui/tree/main/pump-fun-skills/swap
Command: npx skills add https://github.com/nirholas/three-ui --skill swap-nirholas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @pump-fun/pump-sdk, @pump-fun/pump-swap-sdk, @solana/spl-token, @solana/web3.js, bn.js, and includes scripts (resource) components.

What problem does it solve?

This Skill builds buy and sell transactions for pump.fun tokens, sparing you from manually handling bonding-curve vs AMM routing, quoting, slippage, and transaction encoding details.

Core Features & Use Cases

  • Auto-detect routing (bonding curve vs AMM): Uses the fun-block API to choose the correct swap path depending on whether the coin has graduated.
  • Buy & sell support: Buy with SOL using NATIVE_MINT, sell tokens back to SOL using NATIVE_MINT.
  • MEV protection option (Jito-only submission): When enabled, adds a Jito tip and instructs you to send the signed transaction only to Jito endpoints to avoid public mempool leakage.
  • Balance/coin introspection helpers: Includes scripts to fetch coin state and print wallet balances (including optional pump profile API data).
  • Safety guardrails: Enforces critical user confirmations (RPC, signer pubkey, operation type, mint, amount, optional front-runner protection) before proceeding, and recommends verifying token program on-chain.

Quick Start

Ask the skill to build a buy or sell swap transaction for the provided coin mint and signer wallet using the fun-block API, with your confirmed RPC URL, operation type, and exact amount.

Frequently Asked Questions about swap

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a pump.fun swap transaction for buying and selling tokens?

To build a pump.fun swap transaction, you provide the target coin mint, signer wallet, RPC URL, operation type, and exact amount. The Skill auto-detects whether the coin is on the bonding curve or graduated AMM to route the transaction correctly.

How does MEV front-running protection work for Solana token trading?

MEV front-running protection uses Jito-only submission to prevent public mempool leakage. When enabled, it adds a Jito tip and requires sending the signed transaction exclusively to Jito endpoints, bypassing standard public mempools to secure the swap.

Do I need to manually route pump.fun swaps between bonding curve and AMM?

No, manual routing is not required. The Skill uses the fun-block API to auto-detect whether a coin has graduated and automatically chooses the correct swap path between the bonding curve and the AMM.

What parameters do I need to confirm before executing a pump.fun token swap?

Before executing a pump.fun token swap, you must confirm your RPC URL, signer pubkey, operation type (buy or sell), mint address, exact amount, and whether to enable optional Jito front-runner protection. It also recommends verifying the token program on-chain.

Can I sell pump.fun tokens back to SOL using this transaction builder?

Yes, you can sell pump.fun tokens back to SOL. The transaction builder supports token-to-SOL sells using NATIVE_MINT, alongside SOL-to-token buys, handling the base64 VersionedTransaction encoding for both operations.

What are the limitations of using Jito-only submission for DeFi swaps?

The limitation of Jito-only submission is that it requires sending signed transactions exclusively to Jito endpoints with an attached tip. This avoids public mempool leakage but may incur additional costs and requires endpoint availability for successful execution.