# Pump token launches and discovery

`pumpfun.build_launch` prepares an ordinary native-SOL Pump `createV2` transaction using the official pinned Pump SDK 4.1.0. It validates the current global configuration, unused mint and derived accounts, exact instruction accounts, network fee, and successful simulated mint/curve/vault state. The hosted API accepts public addresses only. Signing requires two encrypted local wallets: the payer and a fresh mint key.

## Prepare

Create a separate local mint keystore using the existing wallet command. Its public Solana address becomes the token mint. Do not fund the mint wallet: its on-chain address must be unused. `AGENT_CRYPTO_WALLET_PASSWORD` unlocks the payer; `AGENT_CRYPTO_MINT_PASSWORD` separately unlocks the mint during signing.

```sh
AGENT_CRYPTO_WALLET_PASSWORD="$AGENT_CRYPTO_MINT_PASSWORD" \
  block-cli wallet create --chain solana --out work/mint.enc.json
```

Set the two password environment variables through the agent runtime's secret store. The command above temporarily uses the mint password for mint-keystore creation; it does not change the payer's configured password.

Save launch parameters to a JSON file:

```json
{
  "wallet": "PAYER_PUBLIC_ADDRESS",
  "mint": "NEW_MINT_PUBLIC_ADDRESS",
  "name": "Token name",
  "symbol": "TOKEN",
  "uri": "https://example.com/published-token-metadata.json",
  "maxNetworkFeeLamports": "100000",
  "maxRentLamports": "10000000",
  "priorityFeeMicroLamports": 0,
  "commitment": "confirmed"
}
```

Replace both address placeholders with actual local public addresses. `name` allows 1–32 UTF-8 bytes; `symbol` allows 1–10. Neither accepts control characters. `uri` must be HTTPS or IPFS and at most 200 UTF-8 bytes. Publish the intended metadata before submitting. The API stores the supplied URI in the instruction and never uploads or fetches its contents. Limits are canonical integer strings in lamports; priority price is an integer from 0 to 1,000,000 micro-lamports per compute unit, default zero.

```sh
block-cli call pumpfun build_launch --file work/launch-params.json > work/launch-prepared.json
block-cli tx inspect --chain solana --mode pump-launch \
  --file work/launch-prepared.json --out work/launch-review.json
```

## Review, sign and submit

Review the mint, creator, exact name/symbol/URI, fee payer, accounts, limits and digest. The local `pump-launch` policy reconstructs the entire message with the official offline SDK. It permits exactly one createV2 with the payer as creator, one fixed compute budget and an optional bounded compute price. Extra instructions/accounts, address lookup tables, changed privileges and pre-existing signatures are rejected.

After independent approval of the review digest:

```sh
block-cli wallet sign --file work/payer.enc.json \
  --additional-wallet work/mint.enc.json \
  --review work/launch-review.json --approve "$APPROVED_DIGEST" \
  --max-fee 100000 --max-rent 10000000 --out work/launch-signed.json
block-cli tx submit --file work/launch-signed.json
block-cli tx status --file work/launch-signed.json
```

The signing step requires the exact two local keypairs, rechecks the mint is unused, and simulates the exact unsigned bytes again before producing either signature. It verifies the resulting immutable metadata, revoked mint/freeze authorities, curve state, full token supply in the canonical curve vault, and exact payer debit equal to the rent plus current network fee. Both signatures are verified locally before submission or status reads. The signed artifact is saved privately and never printed by the CLI.

Standard transaction inspection/signing keeps the single-wallet policy. It rejects the additional-wallet and rent options. Pump launch mode does not enable arbitrary multisignature transactions.

## Supported launch scope

This path creates a six-decimal Token-2022 mint with immutable metadata and a native-SOL bonding curve. The creator is the payer. Mayhem, cashback, holder rewards, custom creator fees, quote-token launches and an initial buy are disabled. After confirmed creation, use `pumpfun.quote` and `pumpfun.build_buy` as a separately reviewed transaction if the current curve is supported.

Rent and fee limits are checked during preparation and immediately before signing. The createV2 instruction itself has no encoded rent ceiling. State and blockhash changes can invalidate a prepared transaction; rebuild and independently approve new bytes. Submission acceptance and a successful simulation do not establish confirmed creation. No transaction was broadcast to test this feature.

## Event discovery

`pumpfun.recent_launches` reads a bounded page of signatures referencing the official Pump mint-authority PDA, then inspects successful transactions for current official `CreateEvent` records. Inputs are `scanLimit` (1–10, default 5), optional `before` signature, and `commitment` (`confirmed` or `finalized`). It returns events, per-transaction coverage, `nextBefore`, the discovery address and `completeIndex: false`.

```sh
block-cli call pumpfun recent_launches --params '{"scanLimit":10}'
block-cli call pumpfun launch_events --file work/launch-event-signature.json
```

`launch_events` takes a single transaction `signature` plus optional `commitment`. Event data is accepted only while the Solana runtime invocation stack identifies Pump as the emitting program. The reader verifies the transaction identity, current IDL encoding and canonical mint/curve PDA. Metadata is returned as untrusted text; remote URI content is never fetched. Raw reserves and timestamps are strings to preserve precision.

This is historical event discovery, not a complete name-search index or proof of current tradability. Pagination follows `nextBefore`; the RPC's retained history, unsupported historical event layouts and truncated logs limit coverage. Mayhem, token-paired and holder-reward launches can appear in discovery even though the ordinary launch/swap builders exclude those modes. History JSON reads support transaction versions through V1; execution preparation and signing remain the explicitly supported V0 path.

## Verification

A real unsigned createV2 preparation and local policy inspection succeeded on mainnet at slot `459324339`: 96,026 compute units, 851 serialized bytes, two required signatures, 5,521,960 lamports of simulated account rent and a 10,000-lamport network fee. The public payer was only used for simulation; no wallet key was loaded, no signature created, and nothing submitted. Exact public inputs and evidence are in `pump-launch-live-v0.12.0.json`.

Live discovery read ten public transactions referencing the mint-authority PDA and returned five current CreateEvents; an independent signature lookup matched the first result. The sanitized read-only results are in `pump-discovery-live-v0.12.0.json`. These arbitrary public tokens are fixtures, not endorsements.

Focused tests cover launch instruction reconstruction, wrong/extra signer keys, rejected launch modes, immutable metadata/state verification, fees/rent, expired blockhashes, failed simulations, malformed events and log spoofing. An actual builder response also completes the encrypted two-keystore CLI review/sign/submit/status flow against a local mock RPC. Both required signatures use test-only keys, and corrupted second signatures are rejected before RPC access.

Primary references: [official Pump public docs](https://github.com/pump-fun/pump-public-docs), [official Pump IDL](https://github.com/pump-fun/pump-public-docs/blob/main/idl/pump.json), [Solana getTransaction](https://solana.com/docs/rpc/http/gettransaction), and [Solana versioned transaction history](https://solana.com/docs/core/transactions/versioned-transactions).
