# StonkFun trades and creator claims

BLOCK CLI can quote and prepare Jupiter Metis swaps for a StonkFun-indexed token, and prepare a narrowly validated creator-fee claim. Keys stay in the agent runtime. No action signs or broadcasts.

## Trades

`stonkfun.quote` takes `mint`, `side` (`buy` or `sell`), a positive raw integer `amount`, optional `slippageBps` (1–500, default 50), and `maxPlatformFeeBps` (0–100, default 10). The official token record determines the quote mint: buying spends that asset, selling spends the requested token. The amount is always in the input asset's smallest units.

`stonkfun.build_swap` adds `wallet`, `maxNetworkFeeLamports`, and optional `priorityFeeLamports` (1,000–1,000,000, default 10,000). It retains the existing Jupiter preparation checks and validation limits. The result is a Jupiter route; it does not promise a direct StonkFun or LaunchLab pool fill. Route availability and Jupiter API access are required. The live validation environment could not obtain a Jupiter quote, so the routed StonkFun trade path has fixture coverage, not a successful live trade proof.

```sh
block-cli call stonkfun quote --params \
  '{"mint":"TOKEN_MINT","side":"buy","amount":"1000000","slippageBps":50}'
block-cli call stonkfun build_swap --file stonk-swap-params.json > stonk-swap.json
```

## Creator claims

`stonkfun.claimable` takes `mint`. It preserves explicit unavailable reasons and reports indexed raw base/quote estimates. LaunchLab creator quote vaults can aggregate fees from several launches. Automatically forwarded rewards are outside this claim path.

`stonkfun.prepare_claim` takes `mint`, `wallet`, `minBaseAmount`, `minQuoteAmount`, and `maxNetworkFeeLamports`. Minimums default to zero, but at least one must be positive. They are preparation-time checks against provider estimates, **not on-chain minimums**.

```sh
block-cli call stonkfun claimable --params '{"mint":"TOKEN_MINT"}'
block-cli call stonkfun prepare_claim --file stonk-claim-params.json > stonk-claim.json
block-cli tx inspect --chain solana --file stonk-claim.json --out stonk-review.json
block-cli wallet sign --file agent-wallet.json --review stonk-review.json \
  --approve REVIEW_DIGEST --max-fee 5000 --out stonk-signed.json
block-cli tx submit --file stonk-signed.json
```

Read the inspection and approve its exact digest only when the transaction matches the intended claim. Use a current measured fee within the agent's policy; the example ceiling is not a universal fee guarantee.

The adapter accepts only standard-mode, sole-wallet direct claims:

- Raydium CLMM lock collection for the requested indexed pool, base mint and quote mint.
- Raydium LaunchLab creator quote-vault collection with canonical authority/vault derivations.

It rejects extra instructions, additional signers, address lookup tables, unsupported reward modes, missing destination accounts, changed recipients, stale blockhashes, high fees and failed simulation. Destinations must be the wallet's existing canonical associated token accounts with no delegate or close authority. The official claim preparation's mint, creator, quote asset, intent and expiry must match.

The local CLI submits directly to Solana RPC. The hosted API never calls StonkFun's signed-claim submission endpoint. The provider intent expiry is advisory for direct submission; the recent blockhash determines on-chain validity. Prepare again when stale. A successful unsigned mainnet CLMM claim simulation consumed 80,542 compute units with a 5,000-lamport network fee; no funded claim or trade was broadcast.

## Launch scope

`stonkfun.launch_config` and `stonkfun.build_launch` implement the currently enabled standard untaxed LaunchLab mode. The separate [StonkFun launch guide](/guides/stonkfun-launches.md) covers the configuration approval hash, two local encrypted wallets and dedicated `stonk-launch` inspection policy. StandardV2, rewards, community modes, custom fee splits, vesting and initial buys are excluded. Launch signing does not permit arbitrary multisigner transactions.

Sources: [StonkFun developers](https://www.stonkfun.xyz/developers), [public OpenAPI](https://www.stonkfun.xyz/api/public/v1/openapi.json), [Raydium SDK CLMM instructions](https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/raydium/clmm/instrument.ts), [LaunchLab instructions](https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/raydium/launchpad/instrument.ts), [LaunchLab PDA derivations](https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/raydium/launchpad/pda.ts).
