Buy V2

May 7, 2026 ยท View on GitHub

The buy_v2 instruction buys base tokens from a bonding curve using the curve's quote mint. Unlike the legacy buy instruction, all accounts are passed through a single unified interface for both SOL-paired and non-SOL-paired coins.

Accounts

#AccountSeeds / derivationinit_if_needed / SOL cost
1globalPump PDA: seeds [b"global"].-
2base_mintBase token mint for the coin being bought.-
3quote_mintQuote mint for the coin. For SOL-paired coins, pass wrapped SOL: So11111111111111111111111111111111111111112.-
4base_token_programToken program for base_mint. For create_v2 coins this is Token-2022: TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.-
5quote_token_programToken program for quote_mint. This is not necessarily the same as base_token_program.-
6associated_token_programAssociated Token Program: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL.-
7fee_recipientFee recipient selected from the global config.-
8associated_quote_fee_recipientAssociated token account for quote_mint, owned by fee_recipient, using quote_token_program.ATA rent if missing
9buyback_fee_recipientBuyback fee recipient checked against the global config.-
10associated_quote_buyback_fee_recipientAssociated token account for quote_mint, owned by buyback_fee_recipient, using quote_token_program.-
11bonding_curvePump PDA: seeds [b"bonding-curve", base_mint]. For SOL-paired coins, bonding_curve.quote_mint is Pubkey::default() and quote_mint should be wrapped SOL.Rent top-up to make the account data length 115 bytes if it is smaller
12associated_base_bonding_curveAssociated token account for base_mint, owned by bonding_curve, using base_token_program.-
13associated_quote_bonding_curveAssociated token account for quote_mint, owned by bonding_curve, using quote_token_program.-
14userTransaction signer and buyer.-
15associated_base_userUser's associated token account for base_mint, using base_token_program.-
16associated_quote_userUser's associated token account for quote_mint, using quote_token_program. For SOL-paired coins, this is seed constrained but native SOL is used for the transfer.-
17creator_vaultPump PDA: seeds [b"creator-vault", bonding_curve.creator].Rent-exempt top-up if needed
18associated_creator_vaultAssociated token account for quote_mint, owned by creator_vault, using quote_token_program.ATA rent if missing
19sharing_configPump Fees PDA: seeds [b"sharing-config", base_mint].-
20global_volume_accumulatorPump PDA: seeds [b"global_volume_accumulator"].-
21user_volume_accumulatorPump PDA: seeds [b"user_volume_accumulator", user]. Initialized if needed, paid by user.Rent for 137-byte account if missing: 0.0018444 SOL
22associated_user_volume_accumulatorAssociated token account for quote_mint, owned by user_volume_accumulator, using quote_token_program.ATA rent if missing
23fee_configPump Fees PDA: seeds [b"fee_config", pump_program_id].-
24fee_programPump Fees Program.-
25system_programSystem Program: 11111111111111111111111111111111.-
26event_authorityPump PDA: seeds [b"__event_authority"].-
27programPump program account.-

Instruction Data

The buy_v2 instruction takes the following instruction data arguments.

#ArgumentTypeDescription / validationOptional?
1amountu64Amount of base tokens to buy, in base token units. Must be greater than 0 and cannot exceed the bonding curve's real token reserves.No
2max_sol_costu64Maximum quote amount the buyer is willing to pay, including fees to the protocol and creatorNo

Fee Recipients

All buy_v2 calls need a feeRecipient and a buybackFeeRecipient.

  • For non-mayhem coins, choose one of the 8 normal fee recipients as feeRecipient.
  • For mayhem mode coins, choose one of the 8 reserved fee recipients as feeRecipient.
  • For all coins, choose one of the 8 buyback fee recipients as buybackFeeRecipient.

See Fee Recipients for the full address lists.

TS SDK

Buy SOL-Paired Coin

For SOL-paired coins, use wrapped SOL as the quoteMint.

import { PUMP_SDK } from "@pump-fun/pump-sdk";

const amount = new BN(100_000 * 10 ** 6);
const quoteAmount = new BN(1_000_000_000);
const quoteMint = NATIVE_MINT;
const quoteTokenProgram = TOKEN_PROGRAM_ID;

const buyInstruction = await PUMP_SDK.getBuyV2InstructionRaw({
  user,
  mint,
  creator,
  amount,
  quoteAmount,
  tokenProgram: TOKEN_2022_PROGRAM_ID,
  quoteMint,
  quoteTokenProgram,
  feeRecipient,
  buybackFeeRecipient,
});

Buy Legacy SOL-Paired Coin

For legacy coins where the base mint uses the legacy SPL Token Program, pass TOKEN_PROGRAM_ID as both the base tokenProgram and quoteTokenProgram.

import { PUMP_SDK } from "@pump-fun/pump-sdk";

const amount = new BN(100_000 * 10 ** 6);
const quoteAmount = new BN(1_000_000_000);
const quoteMint = NATIVE_MINT;
const quoteTokenProgram = TOKEN_PROGRAM_ID;

const buyInstruction = await PUMP_SDK.getBuyV2InstructionRaw({
  user,
  mint,
  creator,
  amount,
  quoteAmount,
  tokenProgram: TOKEN_PROGRAM_ID,
  quoteMint,
  quoteTokenProgram,
  feeRecipient,
  buybackFeeRecipient,
});

Buy USDC-Paired Coin

For USDC-paired coins, pass the USDC mint as quoteMint and the quote mint's token program as quoteTokenProgram.

import { PUMP_SDK } from "@pump-fun/pump-sdk";

const amount = new BN(100_000 * 10 ** 6);
const quoteAmount = new BN(1000 * 10 ** 6);
const quoteMint = new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
const quoteTokenProgram = TOKEN_PROGRAM_ID;

const buyInstruction = await PUMP_SDK.getBuyV2InstructionRaw({
  user,
  mint,
  creator,
  amount,
  quoteAmount,
  tokenProgram: TOKEN_2022_PROGRAM_ID,
  quoteMint,
  quoteTokenProgram,
  feeRecipient,
  buybackFeeRecipient,
});

Rust SDK

The Rust client exposes buy_v2_instructions, which prepends the user's base/quote ATA creates and emits the buy_v2 instruction. The fetched BondingCurve carries the coin's quote_mint, so the same builder works for SOL-paired and non-native quote coins; only quote_token_program needs to match the quote mint's token program.

use pump_rust_client::{constants, PumpSdk};

let sdk = PumpSdk::new();
let global = client.fetch_global().await.expect("fetch_global");
let bonding_curve = client
    .fetch_bonding_curve(&mint)
    .await
    .expect("fetch_bonding_curve");

let mut ixs = vec![ComputeBudgetInstruction::set_compute_unit_limit(400_000)];
ixs.extend(
    sdk.buy_v2_instructions(
        &global,
        &bonding_curve,
        mint,
        constants::SPL_TOKEN_PROGRAM_ID, // quote_token_program; For native sol pass SPL_TOKEN_PROGRAM_ID
        user.pubkey(),
        300_000_000,                     // amount (base token units, 6 decimals)
        LAMPORTS_PER_SOL,                // max_quote_tokens (slippage cap, quote base units)
    )
    .expect("buy_v2_instructions"),
);