Program Notes
Program Notes

Instructions: What the Program Is Asked to Do

An instruction is the smallest thing a Solana program can be asked to do. It carries a program id, an ordered list of account metas with signer and writable flags, and an opaque byte array the program decodes itself. Everything a launchpad bot does that matters is expressed in that structure, which is why this section starts there rather than with tooling.

The three notes below take the structure apart in the order it gets assembled: the whole loop, one buy in detail, and then the account list treated as its own subject, because the account list is where most failed transactions are decided.

Step What happens What the chain shows for it
01 The program id is chosen The first account in the compiled message header that the instruction points at. Everything downstream is that program deciding what your bytes mean.
02 The discriminator is written Anchor-built programs prefix instruction data with eight bytes derived from the instruction name, so a decoder can name the call without a schema.
03 Arguments are serialised A small fixed layout, commonly an amount and a slippage bound, encoded little-endian. Wrong widths produce a decode failure rather than a wrong trade.
04 Accounts are ordered Positional, not named. The program reads slot three as the curve because slot three is defined to be the curve, and a swapped pair usually ends in a constraint error.
05 A preamble is attached Compute budget instructions and, on a first purchase, an associated token account creation, all inside the same atomic transaction.
06 The program answers State is written and an event is logged, or the whole transaction is rolled back with a custom error code that names the constraint that failed.

3 notes in this section

The instruction layer: the discriminator that names a curve call, the account list it arrives with, the arguments it carries, and the state the program is allowed to change once it accepts them.

Pump.fun bot mechanics

What a launchpad bot is at the program level: one subscription, one decode, one instruction and one signature, and the four places that chain breaks.

IX-01 Open the note

Anatomy of a curve buy

A single buy taken apart: discriminator, arguments, the compute budget preamble, the token account that may have to be created first, and the balance deltas it leaves behind.

IX-02 Open the note

Accounts in a curve trade

Every account slot in a launchpad trade, what each one is for, which are writable, which are derived, and why the order of the list is part of the contract.

IX-03 Open the note

What this section refuses to publish

No assembled transaction builders, no snippets you could point at a market, and no claim that a particular account layout is permanent. Launchpad programs are deployed behind upgrade authorities, and a redeployment can add a slot, reorder the list or change a fee destination without any announcement. The notes describe how to read a layout from a confirmed transaction, which stays useful after the layout moves.

Covered here
Instruction naming, argument shape, account ordering, preamble instructions, and the error a program returns when a constraint fails
Covered in Behaviour
What the same transaction looks like from the outside: detection, trace patterns per bot class, and the writes a migration produces
Never published
Runnable builders, private program internals, or an account table presented as a permanent specification
Always stated
That a note describes one deployed version, and that a signature you can open yourself outranks anything written here