Transaction structure
Instruction encoding, message structure, required signatures, and execution results.
Message and signatures
An instruction contains a program ID, ordered account metas, and serialized arguments. A message combines instructions with a fee payer and recent blockhash. Transaction signatures authorize that message.
Message::new preserves instruction execution order. Transaction::new signs the message with the supplied keypairs. bincode::serialize produces signed wire bytes. None of these calls executes the DEX action.
This excerpt mirrors the program’s client examples. action_instructions is the ordered instruction list. recent_blockhash is an input to the transaction. The creator is also the fee payer here. This signer list covers the DEX launch instruction; a preceding mint-creation instruction also requires its new mint keypair.
Required signers
The generated account metas mark each instruction signer. The fee payer also signs the transaction.
| Action | Instruction signers |
|---|---|
| Public curve launch | Creator and new user_lp account. |
| Direct AMM creation | Creator, new user_lp, and council when either mint is USDC or the quote configuration has no approved reference pool. |
| Model curve creation | Council as launch payer and required council signer, plus new user_lp. |
| Buy or sell | User who owns the input and output token accounts. |
| Add or remove liquidity | User who owns both token accounts and the LP token account. |
| Graduation | Configured pool.distributor as operator. |
| Fee collection | Owner of the selected accrued fees. |
Setup instructions can require additional signatures. A PDA authorizes transfers inside the program through its seeds. It does not have a client-side private key.
Atomic execution
The runtime executes instructions in message order. A launch followed by a buy makes the newly created pool available to that buy. If an instruction fails, state changes from the transaction roll back. Network fees remain separate from program state changes.
The signed instruction contains its amount and slippage limits. Execution evaluates those limits against the state at that time. Constructing or signing a transaction does not reserve a price.
Two separately signed swaps can be two independent actions. A signature identifies signed transaction bytes; a new blockhash changes the message. An unknown execution result does not establish that the earlier action failed.
Interpret the result
A successful execution result contains no transaction error. The signed message alone is not proof of execution. Account state and token transfers describe the resulting action.
A final curve buy can spend less than its requested input. A taxed output can be smaller than the vault debit. For a launch, the resulting pool, mint supply, revoked mint authority, mode, and initial reserves establish what was created. For liquidity, LP minting or burning and both transfers establish the change in ownership. Graduation changes status and records locked liquidity.
Transaction indexing explains how instruction positions distinguish several DEX calls in one transaction.