-
Notifications
You must be signed in to change notification settings - Fork 9
Description
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
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:
-
When exactly is the CurveAccount supposed to be created or initialized?
-
Does createMintJito include the necessary steps to initialize the CurveAccount, or is this something that must be done manually before buying?
-
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 🙏
