pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA. PumpSwap usa un programa AMM distinto del de la bonding curve de Pump.fun. Usa esta referencia para identificar el programa, decodificar trades o construir instrucciones de compra y venta a partir del IDL.
¿Necesitas swaps sin ensamblar cuentas del AMM? Usa la API de Raptor Swap, que enruta los tokens graduados de Pump.fun a través de PumpSwap y otros DEX.
IDs oficiales de programa
| Programa | Dirección | Función |
|---|---|---|
| Pump.fun AMM (PumpSwap) | pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA | Compra y venta, create_pool, deposit, withdraw |
| Pump.fun (bonding curve) | 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P | Curva previa a la graduación + migrate hacia el AMM |
| Pump Fees | pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ | Configuración de comisiones de compra y venta |
Cuentas conocidas
| Cuenta | Notas |
|---|---|
global_config | PDA con seeds ["global_config"]; suele ser ADyA8hdefvWN2dbGGWFotbzWxrAvLW83WG6QCVXvJKqw |
event_authority | PDA con seeds ["__event_authority"] en el programa AMM |
pool | Cuenta de pool por mercado (se pasa en buy y sell) |
| Quote mint (habitual) | So11111111111111111111111111111111111111112 (WSOL) |
migrate del programa de bonding curve crea el pool del AMM.
IDL de Anchor
Usa el IDL incluido o compáralo con el repositorio original de Pump.fun:- IDL en JSON: /idl/pump_amm.json
- Repositorio original: idl/pump_amm.json
import idl from "./idl/pump_amm.json" assert { type: "json" };
console.log(idl.address);
// pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA
Discriminadores de instrucciones
| Instrucción | Discriminador (bytes) | Hex |
|---|---|---|
buy | [102, 6, 61, 18, 1, 218, 235, 234] | 0x66063d1201daebea |
sell | [51, 230, 133, 164, 1, 127, 131, 173] | 0x33e685a4017f83ad |
buy_exact_quote_in | [198, 46, 21, 82, 180, 217, 232, 112] | 0xc62e1552b4d9e870 |
create_pool | [233, 146, 209, 142, 207, 104, 64, 188] | 0xe992d18ecf6840bc |
deposit | [242, 35, 198, 137, 82, 225, 242, 182] | 0xf223c68952e1f2b6 |
withdraw | [183, 18, 70, 156, 148, 109, 161, 34] | 0xb712469c946da122 |
buy / sell del AMM usan los mismos sighashes de Anchor que buy / sell de la bonding curve. Distínguelos por el ID del programa: pAMMBay… (AMM) frente a 6EF8rrecth… (curva).Detecta compras y ventas del AMM en Rust
const PUMP_AMM: &str = "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA";
const BUY: [u8; 8] = [102, 6, 61, 18, 1, 218, 235, 234];
const SELL: [u8; 8] = [51, 230, 133, 164, 1, 127, 131, 173];
fn is_amm_buy(program_id: &str, data: &[u8]) -> bool {
program_id == PUMP_AMM && data.get(..8) == Some(&BUY)
}
Instrucción buy
Argumentos
| Argumento | Tipo | Significado |
|---|---|---|
base_amount_out | u64 | Tokens que se reciben |
max_quote_amount_in | u64 | Máximo de quote a gastar (p. ej., lamports de WSOL) |
track_volume | OptionBool | { 0 } / { 1 } |
| # | Cuenta | Escribible | Firmante |
|---|---|---|---|
| 0 | pool | ✓ | |
| 1 | user | ✓ | ✓ |
| 2 | global_config | ||
| 3 | base_mint | ||
| 4 | quote_mint | ||
| 5 | user_base_token_account | ✓ | |
| 6 | user_quote_token_account | ✓ | |
| 7 | pool_base_token_account | ✓ | |
| 8 | pool_quote_token_account | ✓ | |
| 9 | protocol_fee_recipient | ||
| 10 | protocol_fee_recipient_token_account | ✓ | |
| 11 | base_token_program | ||
| 12 | quote_token_program | ||
| 13 | system_program | ||
| 14 | associated_token_program | ||
| 15 | event_authority | ||
| 16 | program | ||
| 17 | coin_creator_vault_ata | ✓ | |
| 18 | coin_creator_vault_authority | ||
| 19 | global_volume_accumulator | ||
| 20 | user_volume_accumulator | ✓ | |
| 21 | fee_config | ||
| 22 | fee_program |
Instrucción sell
Argumentos
| Argumento | Tipo | Significado |
|---|---|---|
base_amount_in | u64 | Tokens a vender |
min_quote_amount_out | u64 | Mínimo de quote a recibir (slippage) |
buy hasta coin_creator_vault_authority (índices 0–18), seguida de fee_config (19) y fee_program (20). La venta no pasa las cuentas del acumulador de volumen.
Compra y venta con @solana/web3.js
import {
PublicKey,
TransactionInstruction,
SystemProgram,
} from "@solana/web3.js";
import {
TOKEN_PROGRAM_ID,
ASSOCIATED_TOKEN_PROGRAM_ID,
getAssociatedTokenAddressSync,
} from "@solana/spl-token";
export const PUMP_AMM_PROGRAM_ID = new PublicKey(
"pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
);
export const PUMP_FEE_PROGRAM_ID = new PublicKey(
"pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
);
export const GLOBAL_CONFIG = new PublicKey(
"ADyA8hdefvWN2dbGGWFotbzWxrAvLW83WG6QCVXvJKqw"
);
const BUY_DISC = Buffer.from([102, 6, 61, 18, 1, 218, 235, 234]);
const SELL_DISC = Buffer.from([51, 230, 133, 164, 1, 127, 131, 173]);
function u64le(n) {
const b = Buffer.alloc(8);
b.writeBigUInt64LE(BigInt(n));
return b;
}
export function ammEventAuthority() {
return PublicKey.findProgramAddressSync(
[Buffer.from("__event_authority")],
PUMP_AMM_PROGRAM_ID
)[0];
}
export function ammFeeConfigPda() {
return PublicKey.findProgramAddressSync(
[Buffer.from("fee_config"), PUMP_AMM_PROGRAM_ID.toBuffer()],
PUMP_FEE_PROGRAM_ID
)[0];
}
export function coinCreatorVaultAuthority(coinCreator) {
return PublicKey.findProgramAddressSync(
[Buffer.from("creator_vault"), coinCreator.toBuffer()],
PUMP_AMM_PROGRAM_ID
)[0];
}
/**
* Minimal PumpSwap buy. Resolve pool vaults, fee recipient, and coin_creator
* from the pool account / a recent mainnet tx before production use.
*/
export function buildAmmBuyIx({
pool,
user,
baseMint,
quoteMint,
poolBaseTokenAccount,
poolQuoteTokenAccount,
protocolFeeRecipient,
coinCreator,
baseAmountOut,
maxQuoteAmountIn,
trackVolume = false,
baseTokenProgram = TOKEN_PROGRAM_ID,
quoteTokenProgram = TOKEN_PROGRAM_ID,
}) {
const userBase = getAssociatedTokenAddressSync(
baseMint,
user,
false,
baseTokenProgram
);
const userQuote = getAssociatedTokenAddressSync(
quoteMint,
user,
false,
quoteTokenProgram
);
const protocolFeeAta = getAssociatedTokenAddressSync(
quoteMint,
protocolFeeRecipient,
true,
quoteTokenProgram
);
const creatorAuthority = coinCreatorVaultAuthority(coinCreator);
const creatorAta = getAssociatedTokenAddressSync(
quoteMint,
creatorAuthority,
true,
quoteTokenProgram
);
const [globalVolume] = PublicKey.findProgramAddressSync(
[Buffer.from("global_volume_accumulator")],
PUMP_AMM_PROGRAM_ID
);
const [userVolume] = PublicKey.findProgramAddressSync(
[Buffer.from("user_volume_accumulator"), user.toBuffer()],
PUMP_AMM_PROGRAM_ID
);
const data = Buffer.concat([
BUY_DISC,
u64le(baseAmountOut),
u64le(maxQuoteAmountIn),
Buffer.from([trackVolume ? 1 : 0]),
]);
return new TransactionInstruction({
programId: PUMP_AMM_PROGRAM_ID,
keys: [
{ pubkey: pool, isSigner: false, isWritable: true },
{ pubkey: user, isSigner: true, isWritable: true },
{ pubkey: GLOBAL_CONFIG, isSigner: false, isWritable: false },
{ pubkey: baseMint, isSigner: false, isWritable: false },
{ pubkey: quoteMint, isSigner: false, isWritable: false },
{ pubkey: userBase, isSigner: false, isWritable: true },
{ pubkey: userQuote, isSigner: false, isWritable: true },
{ pubkey: poolBaseTokenAccount, isSigner: false, isWritable: true },
{ pubkey: poolQuoteTokenAccount, isSigner: false, isWritable: true },
{ pubkey: protocolFeeRecipient, isSigner: false, isWritable: false },
{ pubkey: protocolFeeAta, isSigner: false, isWritable: true },
{ pubkey: baseTokenProgram, isSigner: false, isWritable: false },
{ pubkey: quoteTokenProgram, isSigner: false, isWritable: false },
{ pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
{ pubkey: ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
{ pubkey: ammEventAuthority(), isSigner: false, isWritable: false },
{ pubkey: PUMP_AMM_PROGRAM_ID, isSigner: false, isWritable: false },
{ pubkey: creatorAta, isSigner: false, isWritable: true },
{ pubkey: creatorAuthority, isSigner: false, isWritable: false },
{ pubkey: globalVolume, isSigner: false, isWritable: false },
{ pubkey: userVolume, isSigner: false, isWritable: true },
{ pubkey: ammFeeConfigPda(), isSigner: false, isWritable: false },
{ pubkey: PUMP_FEE_PROGRAM_ID, isSigner: false, isWritable: false },
],
data,
});
}
export function buildAmmSellIx({
pool,
user,
baseMint,
quoteMint,
poolBaseTokenAccount,
poolQuoteTokenAccount,
protocolFeeRecipient,
coinCreator,
baseAmountIn,
minQuoteAmountOut,
baseTokenProgram = TOKEN_PROGRAM_ID,
quoteTokenProgram = TOKEN_PROGRAM_ID,
}) {
const userBase = getAssociatedTokenAddressSync(
baseMint,
user,
false,
baseTokenProgram
);
const userQuote = getAssociatedTokenAddressSync(
quoteMint,
user,
false,
quoteTokenProgram
);
const protocolFeeAta = getAssociatedTokenAddressSync(
quoteMint,
protocolFeeRecipient,
true,
quoteTokenProgram
);
const creatorAuthority = coinCreatorVaultAuthority(coinCreator);
const creatorAta = getAssociatedTokenAddressSync(
quoteMint,
creatorAuthority,
true,
quoteTokenProgram
);
const data = Buffer.concat([
SELL_DISC,
u64le(baseAmountIn),
u64le(minQuoteAmountOut),
]);
return new TransactionInstruction({
programId: PUMP_AMM_PROGRAM_ID,
keys: [
{ pubkey: pool, isSigner: false, isWritable: true },
{ pubkey: user, isSigner: true, isWritable: true },
{ pubkey: GLOBAL_CONFIG, isSigner: false, isWritable: false },
{ pubkey: baseMint, isSigner: false, isWritable: false },
{ pubkey: quoteMint, isSigner: false, isWritable: false },
{ pubkey: userBase, isSigner: false, isWritable: true },
{ pubkey: userQuote, isSigner: false, isWritable: true },
{ pubkey: poolBaseTokenAccount, isSigner: false, isWritable: true },
{ pubkey: poolQuoteTokenAccount, isSigner: false, isWritable: true },
{ pubkey: protocolFeeRecipient, isSigner: false, isWritable: false },
{ pubkey: protocolFeeAta, isSigner: false, isWritable: true },
{ pubkey: baseTokenProgram, isSigner: false, isWritable: false },
{ pubkey: quoteTokenProgram, isSigner: false, isWritable: false },
{ pubkey: SystemProgram.programId, isSigner: false, isWritable: false },
{ pubkey: ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
{ pubkey: ammEventAuthority(), isSigner: false, isWritable: false },
{ pubkey: PUMP_AMM_PROGRAM_ID, isSigner: false, isWritable: false },
{ pubkey: creatorAta, isSigner: false, isWritable: true },
{ pubkey: creatorAuthority, isSigner: false, isWritable: false },
{ pubkey: ammFeeConfigPda(), isSigner: false, isWritable: false },
{ pubkey: PUMP_FEE_PROGRAM_ID, isSigner: false, isWritable: false },
],
data,
});
}
Las instrucciones
buy reales de PumpSwap suelen añadir cuentas restantes después de las 23 cuentas del IDL (se han observado +3 en mainnet). sell puede añadir +2. Los base mints suelen ser Token-2022 (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb), mientras que el quote es WSOL en el token program heredado. Decodifica el pool con /idl/pump_amm.json o copia las cuentas de un swap reciente exitoso antes de usarlo en mainnet.Alternativa más sencilla: Raptor + Data API
# Find graduated Pump.fun / PumpSwap markets
curl "https://data.solanatracker.io/search?market=pumpfun-amm&limit=20" \
-H "x-api-key: YOUR_API_KEY"
// Swap a graduated token (Raptor picks PumpSwap / best route)
await fetch("https://swap-v2.solanatracker.io/swap", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
wallet: "YOUR_WALLET_ADDRESS",
from: "TOKEN_MINT_ADDRESS",
to: "So11111111111111111111111111111111111111112",
amount: 1000000,
slippage: 15,
}),
});
Streaming e indexación con Solana Tracker
| Producto | Para qué sirve |
|---|---|
| Pump.fun API | Datos, trades y OHLCV de tokens graduados |
| Data API | market=pumpfun-amm, /tokens/multi/graduated |
| Datastream | Sala graduated + streams de trades por token |
| Memescope | Columna Migrated / PumpSwap en el feed en vivo |
| Raptor | Ejecuta compras y ventas en pools de PumpSwap |
| Yellowstone gRPC | Suscripción a las transacciones del programa pAMMBay… |
| Solana RPC | Lectura de cuentas de pools y confirmación de swaps |
- Programa de bonding curve de Pump.fun —
6EF8rrecth…buy/sell/create - Ciclo de vida de Pump.fun — descubrimiento → curva → graduación → swap
- Descubrir tokens — endpoints graduating y graduated
- Detección de compras y ventas con gRPC
Programa de bonding curve
ID del programa de bonding curve, IDL y discriminadores de create, buy y sell.
Lanzamientos y graduación
Sigue lanzamientos y graduaciones con las APIs de Solana Tracker.
Intercambiar tokens
Compra y vende sin construir instrucciones del AMM.
Memescope
Feed en vivo de tokens migrados y de PumpSwap.