fix: update IDL and buy/sell for current pump.fun program (Mar 2026)#129
Open
venkat22022202 wants to merge 1 commit into
Open
Conversation
…ogram The on-chain pump program has been updated multiple times since this SDK's last release, adding creator fees, fee program integration, volume tracking, cashback, and mayhem mode support. This broke all buy/sell/create operations. Changes: - Replace IDL with the official one from pump-fun/pump-public-docs (Mar 2026) - Update BondingCurveAccount: add creator, isMayhemMode, isCashbackCoin fields - Update GlobalAccount: add creatorFeeBasisPoints, feeRecipients, withdrawAuthority, enableMigrate, poolMigrationFee, setCreatorAuthority - Update buy instructions to pass all 16 required accounts: creator_vault, global_volume_accumulator, user_volume_accumulator, fee_config, fee_program - Update sell instructions to pass all 14 required accounts - Update sell price calculation to include creator fees - Add PDA derivation helpers for all new accounts - Fix browser compatibility (use Uint8Array instead of Buffer at module level) Fixes rckprtr#108, rckprtr#109, rckprtr#112, rckprtr#120 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
The pump.fun on-chain program has been updated multiple times since this SDK's last release. All buy, sell, and create operations are broken because the SDK passes an outdated set of accounts. This PR brings the SDK fully up to date with the current on-chain program (as of March 2026).
What changed on-chain (since this SDK was last updated)
creator_vaultPDA account required on buy/sellpfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ), requiresfee_configandfee_programaccountsglobal_volume_accumulatoranduser_volume_accumulatorPDAs required on buyis_cashback_coinfield on BondingCurveis_mayhem_modefield on BondingCurve, Token2022 support viacreate_v2buy_exact_sol_infor exact-SOL-input purchasesWhat this PR changes
IDL (
src/IDL/pump-fun.json)pump-fun/pump-public-docs(March 2026)BondingCurveAccount (
src/bondingCurveAccount.ts)creator(PublicKey),isMayhemMode(boolean),isCashbackCoin(boolean)fromBuffer()deserialization to read new fieldsGlobalAccount (
src/globalAccount.ts)withdrawAuthority,enableMigrate,poolMigrationFee,creatorFeeBasisPoints,feeRecipients(7 pubkeys),setCreatorAuthoritygetTotalFeeBasisPoints()helper (protocol + creator fees)fromBuffer()deserializationBuy instructions (
src/pumpfun.ts)track_volume: nullas third argument for backward compatibilitySell instructions (
src/pumpfun.ts)PDA helpers
getCreatorVaultPDA(),getEventAuthorityPDA(),getGlobalVolumeAccumulatorPDA(),getUserVolumeAccumulatorPDA(),getFeeConfigPDA(),getGlobalPDA()Browser compatibility
Uint8Arrayinstead ofBufferat module scope to avoid "Buffer is not defined" in browsersAccount ordering reference
The on-chain program uses different account orderings for buy and sell:
Buy (16 accounts):
Sell (14 accounts):
Note:
creator_vaultandtoken_programare swapped between buy (idx 8,9) and sell (idx 9,8).Test plan
npx tsc --noEmit)Fixes #108, #109, #112, #120
Supersedes #112 (which only added creator_vault but is missing fee_program, volume accumulators, and fee_config accounts added in later program updates)
🤖 Generated with Claude Code