feat: USDC quote-mint support for the launch path (create_v2 + buy_v2)#8
Open
HankWyatt wants to merge 14 commits into
Open
feat: USDC quote-mint support for the launch path (create_v2 + buy_v2)#8HankWyatt wants to merge 14 commits into
HankWyatt wants to merge 14 commits into
Conversation
…uote token program
… extends, wait for ALT warmup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds USDC (non-native quote-mint) support to the launch path —
createV2Instruction, a newbuyV2builder, andcreateV2AndBuyInstructions— mirroring the official@pump-fun/pump-sdkAPI 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) oncreateV2Instruction,buyInstructions,getBuyInstructionRaw, andcreateV2AndBuyInstructions(plus an explicitquoteAmountcap). For a non-native quote,createV2Instructionappends the 3 quote remaining accounts and the buy path routes tobuy_v2.buyV2builder (the 27-account V2 buy).buy_v2added to the bundled IDL (src/idl/pump.json+pump.ts) — it was missing.src/quoteMints.ts—USDC_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).OnlinePumpSdkwrappers forward the quote params.buyInstructions(USDC) prepends the user's base + quote ATA creates (the program does not init the user's ATAs).create_v2remaining accounts, the full 27-accountbuy_v2layout, buy routing, ATA creation, thequoteAmountcap, 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.tsis unchanged — the math is quote-agnostic.Verified on devnet
create_v2(USDC-paired) broadcast succeeded: tx → coin mintHADmcDGudvWyCTSBe5KKiw3KcMz7xuJnhePmh7CxdB5G.buy_v2(USDC) simulated against the live program: all 27 accounts accepted, the programinit_if_needed-created the program-side quote ATAs, ran fee computation, and failed only at the quoteTransferCheckedwith insufficient-funds (the test wallet held 0 quote token) — i.e. the account layout is correct.Address Lookup Table note
A USDC
createV2AndBuyInstructionstransaction (~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 test→ 12 suites / 295 tests pass (21 new USDC tests; the existing suite is unchanged).