Skip to content

createMintJito.ts Buy Transaction Fails – “Account does not exist or has no data ...” Error When Fetching Curve Account #13

@fu2025831

Description

@fu2025831

I’m using the logic in createMintJito.ts to create a new token and immediately buy it. However, when building the buy transaction, I consistently encounter this error:
Account does not exist or has no data GXufo3Fz1nE9RohCzsX1NoSD6po5nLWkMaYts3tpSMp1

Image

After tracing the source, it appears the failure comes from the getCurveAccount function:

`export async function getCurveAccount(
provider: BaseAnchorProvider,
mintAddress: string,
): Promise {
const [curveAccountKey] = PublicKey.findProgramAddressSync(
[Buffer.from('token'), new PublicKey(mintAddress).toBytes()],
provider.program.programId,
);

const curveAccount =
await (provider.program.account as any).curveAccount.fetch(
curveAccountKey,
provider.commitment,
);

if (curveAccount == null) {
throw new Error('Curve account data not found');
}
const account = convertBNtoBigInt(curveAccount) as CurveAccount;
return convertContractEnums(account);
}
`
The generated curveAccountKey is:
GXufo3Fz1nE9RohCzsX1NoSD6po5nLWkMaYts3tpSMp1

But fetching this account always fails with "account does not exist or has no data."

What I’ve Tried:###

  • Confirmed that mintAddress is the newly created token;

  • Checked on-chain and verified the curveAccountKey doesn’t exist or is uninitialized;

  • Suspect that the Curve account might not have been initialized at the time of buying

Questions:

  1. When exactly is the CurveAccount supposed to be created or initialized?

  2. Does createMintJito include the necessary steps to initialize the CurveAccount, or is this something that must be done manually before buying?

  3. Should I explicitly create or initialize the CurveAccount as part of the token creation process? If so, what’s the recommended approach?

Thanks for your great work on this project! I’d really appreciate clarification on the CurveAccount lifecycle and the correct initialization flow 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions