Skip to content

feat: USDC quote-mint support for the launch path (create_v2 + buy_v2)#8

Open
HankWyatt wants to merge 14 commits into
nirholas:mainfrom
HankWyatt:feat/usdc-create-buy-v2
Open

feat: USDC quote-mint support for the launch path (create_v2 + buy_v2)#8
HankWyatt wants to merge 14 commits into
nirholas:mainfrom
HankWyatt:feat/usdc-create-buy-v2

Conversation

@HankWyatt

Copy link
Copy Markdown

Summary

Adds USDC (non-native quote-mint) support to the launch path — createV2Instruction, a new buyV2 builder, and createV2AndBuyInstructions — mirroring the official @pump-fun/pump-sdk API shape. Motivated by pump.fun enabling USDC as a quote mint (2026-05-21) via the V2 instructions. The SDK already had read/display USDC support (channel-bot); this adds the minting / buying side.

Fully additive & backward-compatible: every new param defaults to wrapped SOL, so existing SOL callers are byte-identical — the entire existing test suite passes unchanged.

What's included

  • quoteMint? / quoteTokenProgram? (default wSOL / SPL Token) on createV2Instruction, buyInstructions, getBuyInstructionRaw, and createV2AndBuyInstructions (plus an explicit quoteAmount cap). For a non-native quote, createV2Instruction appends the 3 quote remaining accounts and the buy path routes to buy_v2.
  • New buyV2 builder (the 27-account V2 buy).
  • buy_v2 added to the bundled IDL (src/idl/pump.json + pump.ts) — it was missing.
  • New src/quoteMints.tsUSDC_MINT, QUOTE_MINTS, isNativeQuote.
  • BUYBACK_FEE_RECIPIENTS / pickBuybackFeeRecipient — a clarity alias over the existing breaking-recipient set (verified identical to the 8 official buyback recipients).
  • OnlinePumpSdk wrappers forward the quote params.
  • buyInstructions (USDC) prepends the user's base + quote ATA creates (the program does not init the user's ATAs).
  • 21 new offline unit tests (fixture-based, no RPC — per CONTRIBUTING): SOL byte-identity, the 3 create_v2 remaining accounts, the full 27-account buy_v2 layout, buy routing, ATA creation, the quoteAmount cap, and the tx-size/ALT constraint.
  • scripts/devnet-usdc-smoke.ts — a devnet/simulate verification harness.

Notes: the base mint stays Token-2022; the quote side uses the legacy SPL Token program (even for USDC). bondingCurve.ts is unchanged — the math is quote-agnostic.

Verified on devnet

  • create_v2 (USDC-paired) broadcast succeeded: tx → coin mint HADmcDGudvWyCTSBe5KKiw3KcMz7xuJnhePmh7CxdB5G.
  • buy_v2 (USDC) simulated against the live program: all 27 accounts accepted, the program init_if_needed-created the program-side quote ATAs, ran fee computation, and failed only at the quote TransferChecked with insufficient-funds (the test wallet held 0 quote token) — i.e. the account layout is correct.

Address Lookup Table note

A USDC createV2AndBuyInstructions transaction (~1361 bytes / 32 accounts) exceeds the 1232-byte single-transaction limit and must be sent as a v0 transaction with an Address Lookup Table (with one, it compiles to ~605 bytes; the smoke script demonstrates this). The SOL path fits without one. The builders return instructions; ALT assembly is left to the sender, matching the existing pattern.

Tests

npm test12 suites / 295 tests pass (21 new USDC tests; the existing suite is unchanged).

@HankWyatt HankWyatt requested a review from nirholas as a code owner June 4, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant