Skip to content

custom program error: 2006 | A seeds constraint was violated in getBuyInstructions for creator_vault PDA #109

Description

@lxiiiixi

I'm encountering a custom program error: 2006 | A seeds constraint was violated when executing a transaction that combines token creation and buying using the Pump SDK's getBuyInstructions method. The error occurs in the Buy instruction of the Pump program (6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P), specifically related to the creator_vault account. The logs indicate a mismatch between the expected and provided seeds for the creator_vault PDA, with references to SysvarRent111111111111111111111111111111111 and an unexpected address (AK2V6xjrFH8s9e9wDk5dA7kcbzY1bbUKXYaxnia69w2a).
This issue appears after a requirement change where the buyer's private key is provided first, and the creator signs the transaction, instead of the creator signing first. The creator_vault PDA seems to be incorrectly derived or passed, potentially due to missing or incorrect seeds in the getBuyInstructions method.

Pump SDK Version: pumpdotfun-sdk@1.4.2
Solana Web3.js Version: @solana/web3.js@1.98.2
Anchor Version: @coral-xyz/anchor@0.30.1
Node.js Version: v23.4.0

I create a token using a createTx transaction, signed by mintTokenKeypair and tokenCreatorKeypair.
Call pumpSdk.getBuyInstructions to generate a Buy instruction with the following parameters:
const buyTx = await pumpSdk.getBuyInstructions(
tokenBuyerPublicKey,
mintTokenKeypair.publicKey,
globalAccount.feeRecipient,
buyAmount,
buyAmountWithSlippage
);

Combine createTx and buyTx instructions into a single transaction:
const instructions = [
ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1_000_000 }),
...createTx.instructions,
...buyTx.instructions,
];
const messageV0 = new TransactionMessage({
payerKey: tokenCreatorPublicKey,
recentBlockhash: blockhash,
instructions,
}).compileToV0Message();
const transaction = new VersionedTransaction(messageV0);
transaction.sign([mintTokenKeypair, tokenBuyerKeypair, tokenCreatorKeypair]);

Send the transaction, resulting in the error:Program log: AnchorError caused by account: creator_vault. Error Code: ConstraintSeeds. Error Number: 2006. Error Message: A seeds constraint was violated.
Program log: Left: SysvarRent111111111111111111111111111111111
Program log: Right: AK2V6xjrFH8s9e9wDk5dA7kcbzY1bbUKXYaxnia69w2a

Expected Behavior
The Buy instruction should execute successfully without the 2006 error, using the correct creator_vault PDA derived with the appropriate seeds (e.g., ["vault", tokenCreatorPublicKey, mint]). The transaction should allow the buyer to purchase tokens while respecting the new requirement where the buyer's private key is provided, and the creator signs the transaction.
Actual Behavior
The transaction fails with the 2006 error, indicating a seeds constraint violation for the creator_vault account (2Hj63JyK4qPR6E5DqEYe4spi2PCbdyfgGyEqBKM1t5yG). The logs suggest the program expected a different PDA, and SysvarRent111111111111111111111111111111111 is incorrectly referenced in the error context.

There is an example transaction:
https://solscan.io/tx/4WF6JT4XWjc4B9KSz95orrPqUHdvAUMjDZdeBpoxqhLKQ8t7fH2nySLGz6H4W8dz5Q5WAxypEnpnKfvQgzVKNfTi

Questions

What are the correct seeds for the creator_vault PDA in the Buy instruction? Should it include tokenCreatorPublicKey, mint, or other accounts?
Is SysvarRent111111111111111111111111111111111 expected in the Buy instruction, or is its presence a bug in the SDK?
How should getBuyInstructions be modified to support the new requirement (buyer provides private key, creator signs)? Should tokenCreatorPublicKey be passed explicitly?
Is there an updated SDK version or Anchor IDL that addresses this issue?

Any guidance on resolving this error or confirming the creator_vault PDA seeds would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions