Encountered a Solana Error while handling Instruction 2: custom program error with code 0x1000078

While attempting to create an AMM Pool using the 'ammCreatePool.ts' script from the raydium-sdk repository, I encountered the following error message. I executed the script directly with ts-node src/ammCreatePool.ts and made modifications so that it accepts all necessary variables as arguments (token_program_id, mint_address, name, symbol). Unfortunately, I couldn't find any information regarding this error other than the fact that the first program id is associated with openbook and the second with raydium. Here is the output:

bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
(node:1282) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
/home/username/typescriptmakesmecry/Final/node_modules/@solana/web3.js/src/connection.ts:5921
      throw new SendTransactionError(
            ^
SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 2: custom program error: 0x1000078
    at Connection.sendEncodedTransaction (/home/username/typescriptmakesmecry/Final/node_modules/@solana/web3.js/src/connection.ts:5921:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Connection.sendRawTransaction (/home/username/typescriptmakesmecry/Final/node_modules/@solana/web3.js/src/connection.ts:5880:20)
    at async Connection.sendTransaction (/home/username/typescriptmakesmecry/Final/node_modules/@solana/web3.js/src/connection.ts:5829:14)
    at async sendTx (/home/username/typescriptmakesmecry/Final/src/util.ts:36:18)
    at async buildAndSendTx (/home/username/typescriptmakesmecry/Final/src/util.ts:64:10)
    at async ammCreatePool (/home/username/typescriptmakesmecry/Final/src/ammCreatePool.ts:91:19) {
  logs: [
    'Program 11111111111111111111111111111111 invoke [1]',
    'Program 11111111111111111111111111111111 success',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]',
    'Program log: Instruction: InitializeAccount',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3443 of 799850 compute units',
     ...
    ]
}

Answer №1

If you're in the same boat as me. The code provided in the demo is meant for use on the mainnet. Here are the key things you need to pay attention to.

Within config.ts

  1. Make sure to replace the secret key
  2. export const PROGRAMIDS = DEVNET_PROGRAM_ID;
  3. export const addLookupTableInfo = LOOKUP_TABLE_CACHE // only mainnet. other = undefined
    This is why you see the code 0x1000078

In the

makeCreatePoolV4InstructionV2Simple
function, replace feeDestinationID with
3XMrhbv989VxAMi3DErLV9eJht1pHppW5LbKxe9fkEFR
This address is for devnet

Lastly, pay attention to the targetMarketId. If you generate a new wallet as an example, you may encounter a different type of error. So, replace targetMarketId with a market ID created from

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it not possible to call this authentication expression in a Typescript file when using Next JS?

I am currently developing a sign-in method for my Next.js application and I have been referring to the GitHub repository's recommended documentation. However, upon reaching the authentication folder step, I encountered an error regarding the sign-in ...

Exploring TypeScript's Conditional Types

Consider this scenario: type TypeMapping = { Boolean: boolean, String: string, Number: number, ArrayOfString: Array<string>, ArrayOfBoolean: Array<boolean> } export interface ElemType { foo: keyof TypeMapping, default: valueof T ...

What are the best practices for utilizing an array of routes?

I'm new to working with react but I noticed something strange. My routes are currently set up like this: <Main> <Route exact path="/home" component={Home} /> <Route exact path="/home1" com ...

Convert image file to a React TypeScript module for export

Imagine a scenario where you have a folder containing an image file and an index file serving as a public API. Is there a method to rename the image file before reexporting it? Here is the structure of the folder: └── assets/ ├── index.t ...

Nextjs 13 brings exciting new features, one of which is the ability to call getStatic

I am working on a Next.js 13 application where I have organized my files in the 'app' directory instead of the usual 'pages'. All pages are statically generated during build time and data is fetched from an external API. https://i.sstat ...

Arrange photos in a grid using React Dropzone uploaders

I'm having trouble figuring out how to create a custom preview similar to an image set in a grid using the react-dropzone-uploader component for uploading multiple files. Currently, when I upload images, they are displayed as shown in my normal uploa ...

Having trouble with vscode compiling the typescript file?

Even though I diligently followed the tutorial provided by vscode on compiling typescript code, I encountered a problem. The configurations were set up as per the instructions in the tutorial, but when I tried to run the code without debugging, I received ...

After the rendering process, the React Component member goes back to a state of

One issue I encountered is related to a component that utilizes a separate client for making HTTP requests. Specifically, when trying to use the client within a click event handler, the call to this.client.getChannel() fails due to this.client being undefi ...

a guide to caching a TypeScript computed property

I have implemented a TypeScript getter memoization approach using a decorator and the memoizee package from npm. Here's how it looks: import { memoize } from '@app/decorators/memoize' export class MyComponent { @memoize() private stat ...

The function type '(state: State, action: AuthActionsUnion) => State' cannot be assigned to the argument

I have encountered a persistent error in my main.module.ts. The code snippet triggering the error is as follows: @NgModule({ declarations: [ PressComponent, LegalComponent, InviteComponent ], providers: [ AuthService ], imports: ...

TypeDoc is having trouble locating the Angular 2 modules

Currently, I am attempting to create documentation files using TypeDoc. When executing TypeDoc with the command below: /node_modules/.bin/typedoc --module system --target ES5 --exclude *.spec.ts* --experimentalDecorators --out typedoc app/ --ignoreCompile ...

Tips for passing the indexes of an array within nested ngFor loops in Angular

I have a 2D grid in my component that is created using nested ngFor loops, and I want to make certain grid elements clickable under specific conditions so they can call a function. Is there a way for me to pass the index of the clicked array element to the ...

Encountered a TypeScript error in Vue 3 when attempting to access state within the setup method: "TS error -

Currently, I am working with Vue 3 and TypeScript. In the Setup function, I have defined some states like this: export default defineComponent({ setup() { const isLoadingSendData = ref(false) return { isLoadingSendData } }, methods: { ...

What is the best method to eliminate a "0" entry from a javascript event array?

Hello, I've got an array structured as follows: let test = ["testOne:,O,U,0","testTwo:R,C,0","testTree:1.334","testFour:r,z"]; I'm looking to iterate through the array and remove any occurrences of the cha ...

Adjust the selected value in real-time using TypeScript

Hey there, I've got a piece of code that needs some tweaking: <div> <div *ngIf="!showInfo"> <div> <br> <table style="border: 0px; display: table; margin-right: auto; margin-left: auto; width: 155%;"& ...

Exploring the world of Typescript and Angular Filter functionalities

I am looking to utilize one of my Angular Filters in my controller as a function. I came across a solution on this page: How to use a filter in a controler The last answer provided exactly what I needed, so I implemented it in my JS code: var MyFunc ...

Injecting a component in Angular 2 using an HTML selector

When I tried to access a component created using a selector within some HTML, I misunderstood the hierarchical provider creation process. I thought providers would look for an existing instance and provide that when injected into another component. In my ...

What is the reason behind create-next-app generating .tsx files instead of .js files?

Whenever I include with-tailwindcss at the end of the command line, it appears to cause an issue. Is there any solution for this? npx create-next-app -e with-tailwindcss project_name ...

Tips for utilizing Provide/Inject in Vue.js while leveraging TypeScript

I am currently working with Vue.js and TypeScript along with the vue-property-decorator package. The documentation suggests that I can achieve something like this: import { Component, Inject, Provide, Vue } from 'vue-property-decorator' const s ...

Neglectful TypeScript null checks overlooking array.length verification

When TypeScript is compiled with strict null checks, the code snippet below does not pass type checking even though it appears to be correct: const arr: number[] = [1, 2, 3] const f = (n: number) => { } while (arr.length) { f(arr.pop()) } The comp ...