# Pumpfun Metaplex Agent

> First run of every pumpfun bot install (or /launch-agent-token) — make the bot an on-chain Solana Metaplex agent (MPL Core asset + Agent Registry identity + asset-signer wallet) and optionally launch its one agent token via Genesis. Builds UNSIGNED transactions only.

- Skill: `solizardking/pumpfun-metaplex-agent` (Agent Skill)
- Install (CLI): `npx get-skill add solizardking/pumpfun-metaplex-agent`
- Raw SKILL.md: https://api.skillmd.com/api/skills/solizardking/pumpfun-metaplex-agent/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: Solizardking (https://skillmd.com/u/solizardking)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/solizardking/pumpfun-metaplex-agent

---


# Become an on-chain Metaplex agent

HARD RULES: never sign or broadcast. Output only unsigned base64 txs / instruction data for the owner to review and sign. Never print or store mnemonics, private keys or `ows_key_` tokens. No `buildAndSign`, `sendAndConfirm`, or `createAndRegisterLaunch` (auto-sends).

Constants: Agent Registry `1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p` · MPL Core `CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d` · Asset signer seeds `['mpl-core-execute', <asset>]` · registry id `solana:101:metaplex`.
RPC default: `https://musebook-proxy.mynameisjeffspicoli.workers.dev/api/solana/rpc` (fallback `https://api.mainnet-beta.solana.com`). Devnet: `https://api.devnet.solana.com`.

## 0. Toolkit
```
mkdir -p ~/pumpbot/metaplex && cd ~/pumpbot/metaplex && npm init -y
npm i @metaplex-foundation/umi @metaplex-foundation/umi-bundle-defaults @metaplex-foundation/mpl-core @metaplex-foundation/mpl-agent-registry @metaplex-foundation/genesis @solana/web3.js
cp <this skill folder>/build-agent.mjs .
```
Reference copy: `/workspace/pumpbot/metaplex/build-agent.mjs` (also beside this SKILL.md). Owner/payer = the bot's OWS Solana address (`ows wallet list`), or the owner's own pubkey if they prefer. The owner signs.

## 1. Metadata + registration doc (upload to permanent storage)
Asset metadata JSON (`--uri`): `{ "name": "<bot name>", "description": "...", "image": "<irys/arweave url>" }`.
ERC-8004 registration doc (`--reg-uri`):
```json
{
  "type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
  "name": "<bot name>",
  "description": "Pump.fun bot: market reads, quotes, unsigned trades, launches, fee claims.",
  "image": "https://gateway.irys.xyz/<id>",
  "services": [
    { "name": "email", "endpoint": "<bot>@mail.grokbot.com" },
    { "name": "A2A", "endpoint": "<url>/agent-card.json", "version": "0.3.0" },
    { "name": "MCP", "endpoint": "<url>/mcp", "version": "2025-06-18" }
  ],
  "active": true,
  "registrations": [{ "agentId": "<ASSET_PUBKEY>", "agentRegistry": "solana:101:metaplex" }],
  "supportedTrust": ["reputation"]
}
```
Only include A2A/MCP if the bot really exposes them. `agentId` is known after step 2 builds (asset address is printed) — upload the doc then, before the owner signs the register tx. Upload to Arweave/Irys (permanent). Uploading costs money: ask the owner first; never pay from a key you can see.

## 2. Build mint + register txs (unsigned)
```
node build-agent.mjs --owner <OWS_SOL_PUBKEY> --uri <assetMetadataUrl> --reg-uri <erc8004Url> --name "<bot name>" [--rpc <url>]
```
Output JSON: `collection`, `asset`, `agentWallet_assetSignerPda`, `agentIdentityPda`, and `unsignedTxsBase64.{createCollection, createAsset, registerIdentity}`. Owner signs and sends them in order; each must confirm before the next. Blockhash expires in ~60–90s: rebuild if stale.
New-account signers: `createCollection`/`createAsset` also need the NEW collection/asset keypair's signature. By default (owner-approved 2026-10-15) the script presigns ONLY those new-account slots with throwaway keys, then discards them (never printed). The owner's wallet signature is never applied and nothing is broadcast. Pass `--no-presign` to leave those slots empty.
Core of the script (umi with a noop owner signer, build without signing):
```js
const umi = createUmi(RPC).use(mplCore()).use(mplAgentIdentity());
const owner = createNoopSigner(publicKey(OWNER)); umi.use(signerIdentity(owner));
const tx = createCollection(umi,{collection,name,uri,payer:owner,updateAuthority:owner.publicKey})
  .setBlockhash(blockhash).build(umi);                 // NOT buildAndSign
const b64 = base64.deserialize(umi.transactions.serialize(tx))[0];
// web3.js alternative: toWeb3JsTransaction(tx) from @metaplex-foundation/umi-web3js-adapters
registerIdentityV1(umi,{asset,collection,agentRegistrationUri,payer:owner,authority:owner})
```
Registration is one-time per asset; it creates the identity PDA and attaches the AgentIdentity plugin (Transfer/Update/Execute hooks).

## 3. Agent wallet
Agent wallet = `findAssetSignerPda(umi,{asset})` (= DAS `asset_signer`). Fund the PDA, NOT the asset address. Nobody holds its key: it only acts through Core `execute` instructions authorized by the asset owner (the OWS wallet). Creator fees from an agent token land there.

## 4. Verify (read-only)
```js
const id = await safeFetchAgentIdentityV1(umi, findAgentIdentityV1Pda(umi,{asset}));   // !== null
const a = await fetchAsset(umi, asset); a.agentIdentities?.[0]?.uri; // lifecycleChecks transfer/update/execute
```
DAS (Helius etc.): `getAsset {id: asset}` → `is_agent: true`, `asset_signer`, `agent_token` (only after a token is linked). Discover: `searchAssets {isAgent: true}` or filter `agentToken` / `assetSigner`. Indexer support varies by provider.

## 5. Agent token (/launch-agent-token)
One token per agent, forever. `setToken: true` is PERMANENT and irreversible. Default `setToken: false`; set true only after the owner explicitly confirms in words ("yes, permanently link this token").
Requirements: registered agent asset, Node 18+, Irys gateway URL for the image, SOL in payer for fees/first buy. Test first with `network: 'solana-devnet'` and the devnet RPC.
Use the two-step unsigned path (NOT `createAndRegisterLaunch`):
```js
// genesis 0.43.x (npm latest): root export; docs' 1.x uses '@metaplex-foundation/genesis/api'
import { createLaunch, registerLaunch } from '@metaplex-foundation/genesis';
const input = {
  wallet: OWNER, network: 'solana-mainnet',            // or 'solana-devnet'
  agent: { mint: AGENT_ASSET, setToken: false },
  token: { name, symbol, image: 'https://gateway.irys.xyz/<id>', description },
  launchType: 'bondingCurve',
  launch: { /* firstBuyAmount: 0.1  (optional, fee-free, set only at creation) */ },
};
const created = await createLaunch(umi, {}, input);  // returns UNSIGNED txs + mint
// hand created.transactions (base64) to the owner; after they confirm on-chain:
await registerLaunch(umi, {}, { ...created, /* signatures from owner */ });
```
Check exact field names against the installed `@metaplex-foundation/genesis` types (`node_modules/@metaplex-foundation/genesis/dist/**/*.d.ts`, grep createLaunch) before building. Txs are wrapped in Core execute so the agent PDA is creator and fee wallet. If registerLaunch fails after the create txs confirmed, the token exists but isn't listed on metaplex.com — retry registerLaunch.
Link an existing Genesis token later: `setAgentTokenV1` (Agent Registry) via a Core `execute` from the asset — also permanent; same confirmation rule.
Creator fees accrue in the bucket; claim (permissionless) with `claimBondingCurveCreatorFeeV2` (on curve) or `claimRaydiumCreatorFeeV2` (after graduation) — build unsigned, owner signs.

## 6. Report
Show asset, collection, agent wallet PDA, identity PDA, the unsigned txs, and what the owner must sign. Save the asset/PDA addresses (no secrets) to memory.
