# StonkFun standard launches

`stonkfun.launch_config` reads the official launchable quote pairs and current LaunchLab pricing, then verifies the corresponding on-chain configuration. `stonkfun.build_launch` prepares and simulates one standard untaxed Token-2022 launch. The agent creates and controls both signing keys locally: its existing payer and a fresh mint wallet. The hosted API receives public addresses only.

## Review the current configuration

Choose a quote mint from `stonkfun.pairs` with both `launchable` and `launchLabReady` true:

```sh
block-cli call stonkfun pairs --params '{"launchable":true,"launchLabReady":true}'
block-cli call stonkfun launch_config --params '{"quoteMint":"QUOTE_MINT"}'
```

Replace `QUOTE_MINT` with a returned mint. The response includes raw token supply, raw amount offered on the curve, raw quote fundraising target, quote decimals, fee rates, fee recipients, liquidity distribution scales, metadata update authority and `configurationHash`. Fees and scales use a denominator of 1,000,000. A platform share of 1,000,000 means the entire configured share belongs to that platform recipient; do not assume it belongs to the launching wallet.

The hash binds the current global/platform/allow/rule/quote account bytes and the exact curve terms. Save it only after approving those economics. Preparation fetches current official pricing again; a different hash requires a fresh review. The local signing policy independently reads the on-chain accounts and compares the same hash. It does not depend on arbitrary caller-supplied fee recipients.

## Prepare a launch

Create a separate encrypted Solana mint wallet. Its address must be unused and must differ from the payer. Do not fund it.

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

Configure both passwords through the agent runtime's secret store. This command uses the mint password to create its keystore; normal payer signing continues to use `AGENT_CRYPTO_WALLET_PASSWORD`.

Save the following parameters as `work/stonk-launch-params.json`, replacing the public-address and approved-hash placeholders:

```json
{
  "wallet": "PAYER_PUBLIC_ADDRESS",
  "mint": "FRESH_MINT_PUBLIC_ADDRESS",
  "quoteMint": "QUOTE_MINT",
  "configurationHash": "APPROVED_64_CHARACTER_CONFIGURATION_HASH",
  "name": "Token name",
  "symbol": "TOKEN",
  "uri": "https://example.com/published-token-metadata.json",
  "maxNetworkFeeLamports": "100000",
  "maxRentLamports": "20000000",
  "priorityFeeMicroLamports": 0,
  "commitment": "confirmed"
}
```

`name` allows 1–32 UTF-8 bytes and `symbol` 1–10, without control characters. `uri` must be HTTPS or IPFS and at most 200 UTF-8 bytes. Publish the intended metadata first; the builder neither fetches nor uploads that content. Network fee and rent ceilings are raw lamport strings; rent may be zero. Priority price is an integer from zero to 1,000,000 micro-lamports per compute unit. Choose limits within the agent's own spending policy.

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

## Sign locally and submit

Review the exact mint, creator, metadata, quote asset, curve terms, platform configuration, fee/rent estimate and approval digest. The `stonk-launch` policy reconstructs the entire message: one fixed compute limit, an optional bounded compute price, one configuration-hash memo, and one standard `initializeWithToken2022` instruction. It rejects additional instructions, account privileges, lookup tables, arbitrary signers and pre-existing signatures.

After independently approving the review digest:

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

Signing rechecks the unused mint and derived pool/vault addresses, configuration hash, exact two keypairs, current fees and simulated account state before producing either signature. Post-state checks cover Token-2022 mint supply and metadata, revoked mint/freeze authorities, pool terms and creator, full supply in the canonical base vault, an empty quote vault, and exact payer debit equal to account rent plus network fee. Both signatures are verified locally before submission. The signed artifact is written with private file permissions and is not printed.

## Supported scope and limits

This creates a six-decimal, untaxed standard LaunchLab mint with a constant curve and CPMM migration. The pinned standard platform is `4E876qZTE9FJMrBzgVtBrSrzz2TLivB5Y5QXPjB4gZL7`. StandardV2, rewards/community modes, initial buys, vesting, transfer taxes and custom fee splits are excluded. Current protocol configuration determines platform economics.

The metadata update authority is the LaunchLab authority PDA. Metadata is **not claimed immutable**. The supplied URI can also point to mutable content. The creator is the payer, but that does not imply the creator receives all trading fees or migration liquidity.

The configuration hash is a local signing check carried in a signed memo; the LaunchLab program does not enforce that hash. A configuration change after signing can change protocol behavior before execution. Fee and rent ceilings are checked during preparation and signing; the launch instruction has no on-chain rent ceiling. Prepare and review again when state or the recent blockhash changes.

On-chain confirmation proves the transaction result, not StonkFun's indexing or adoption. Query `stonkfun.token` separately after confirmation. A subsequent buy is a separate transaction requiring a new quote and approval.

## Verification

The actual adapter completed a successful unsigned mainnet simulation at slot `459331324`: 132,641 compute units, 974 serialized bytes, two required signatures, 8,417,560 lamports of simulated rent and a 10,000-lamport network fee. Public inputs and detailed evidence are in `stonk-launch-live-v0.12.0.json`. No key for the public payer was loaded, no signature produced, and nothing broadcast.

Seven focused tests cover configuration approval, exact instruction/account reconstruction, extra or changed privileges, stale or occupied accounts, altered mint/pool/vault state, fee/rent limits and rejected unsupported modes. An actual builder response also completes the two encrypted local keystore CLI inspection/signing/submission/status flow against a mock RPC, using throwaway keys only.

Primary sources: [StonkFun developers](https://www.stonkfun.xyz/developers), [public OpenAPI](https://www.stonkfun.xyz/api/public/v1/openapi.json), [Raydium LaunchLab instructions](https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/raydium/launchpad/instrument.ts), [LaunchLab account layouts](https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/raydium/launchpad/layout.ts), and [LaunchLab PDA derivations](https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/raydium/launchpad/pda.ts).
