repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | { |
| #2 | "skillId": "pump-token-lifecycle", |
| #3 | "name": "pump-token-lifecycle", |
| #4 | "description": "Full token lifecycle from creation through bonding curve trading, graduation detection, AMM migration, fee collection, and volume tracking on Solana using PumpSdk and OnlinePumpSdk.", |
| #5 | "category": "pump-protocol", |
| #6 | "path": "pump-token-lifecycle/SKILL.md", |
| #7 | "url": "https://x402.wtf/api/skills/pump-token-lifecycle", |
| #8 | "tags": [ |
| #9 | "pump", |
| #10 | "solana", |
| #11 | "token", |
| #12 | "lifecycle" |
| #13 | ], |
| #14 | "requiredEnv": [ |
| #15 | "SOLANA_RPC_URL" |
| #16 | ], |
| #17 | "homepage": "https://github.com/nirholas/pump-fun-sdk", |
| #18 | "attestation": { |
| #19 | "status": "pending", |
| #20 | "isFormallyVerified": false, |
| #21 | "attestationPda": null, |
| #22 | "verificationTimestamp": null |
| #23 | }, |
| #24 | "markdown": "---\nname: pump-token-lifecycle\ndescription: \"Full token lifecycle from creation through bonding curve trading, graduation detection, AMM migration, fee collection, and volume tracking on Solana using PumpSdk and OnlinePumpSdk.\"\nmetadata:\n openclaw:\n homepage: https://github.com/nirholas/pump-fun-sdk\n requires:\n env:\n - SOLANA_RPC_URL\n---\n\n# Token Lifecycle — Create, Trade, Graduate, Migrate & Collect\n\nManage the full lifecycle of Pump tokens from creation through bonding curve trading, graduation detection, AMM migration, fee collection, and volume tracking — using the offline `PumpSdk` and online `OnlinePumpSdk`.\n\n## Context\n\nPump tokens follow a defined lifecycle: creation → bonding curve trading → graduation (when market cap reaches threshold) → AMM migration → AMM trading. The SDK provides instruction builders for each phase, with both offline (no RPC) and online (live fetches) variants.\n\n## Lifecycle Phases\n\n### Phase 1: Token Creation\n\n```typescript\n// V2 creation with Token-2022 (preferred)\nconst ix = await PUMP_SDK.createV2Instruction({\n mint, name, symbol, uri, creator, user,\n});\n\n// Create and immediately buy in same transaction\nconst ixs = await PUMP_SDK.createV2AndBuyInstructions({\n global, feeConfig, mint, name, symbol, uri,\n creator, user, solAmount, amount, slippage\n});\n```\n\n- `createInstruction` (v1) is **deprecated** — use `createV2Instruction` (Token-2022)\n- Token-2022 enables advanced token features (transfer hooks, confidential transfers)\n- Mayhem mode tokens use additional Mayhem program PDAs\n\n### Phase 2: Bonding Curve Trading\n\n```typescript\n// Buy\nconst { bondingCurve } = await onlineSdk.fetchBuyState(mint, user);\nconst amount = getBuyTokenAmountFromSolAmount({ global, feeConfig, mintSupply, bondingCurve, amount: solAmount });\nconst ixs = await PUMP_SDK.buyInstructions({ global, bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo, mint, user, solAmount, amount, slippage: 1 });\n\n// Sell\nconst solAmount = getSellSolAmountFromTokenAmount({ global, feeConfig, mintSupply, bondingCurve, amount });\nconst ixs = await PUMP_SDK.sellInstructions({ global, bondingCurveAccountInfo, bondingCurve, mint, user, amount, solAmount, slippage: 1 });\n```\n\n### Phase 3: Graduation Detection\n\n```typescript\nconst bondingCurve = await onlineSdk.fetchBondingCurve(mint);\nif (bondingCurve.complete) {\n // Token has graduated — must migrate to AMM\n}\n```\n\n### Phase 4: AMM Migration\n\n```typescript\nconst extendIx = await PUMP_SDK.extendAccountInstruction({ bondingCurvePda, bondingCurveAccountInfo });\nconst migrateIx = await PUMP_SDK.migrateInstruction({ mint, creator });\n```\n\n### Phase 5: Post-Migration (AMM Trading)\n\nAfter migration, the SDK's \"BothPrograms\" methods handle trading transparently across Pump and PumpAMM.\n\n### Phase 6: Creator Fee Collection\n\n```typescript\nconst ixs = await onlineSdk.collectCoinCreatorFeeInstructions(creator);\nconst balance = await onlineSdk.getCreatorVaultBalanceBothPrograms(creator);\n```\n\n## Key Constants\n\n| Constant | Value | Description |\n|----------|-------|-------------|\n| `PUMP_PROGRAM_ID` | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` | Bonding curve program |\n| `PUMP_AMM_PROGRAM_ID` | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | AMM pool program |\n| `PUMP_FEE_PROGRAM_ID` | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | Fee sharing program |\n| `BONDING_CURVE_NEW_SIZE` | `151` | Extended account size |\n\n## State Transition Diagram\n\n```\n create\n ────────────────────── ► ACTIVE (BondingCurve)\n │\n buy / sell\n │\n graduation\n (complete = true)\n │\n migrate\n ▼\n GRADUATED (AMM Pool)\n │\n AMM trading + fee collection\n```\n\n## Patterns to Follow\n\n- Return `TransactionInstruction[]`, never `Transaction` objects\n- Use `getMultipleAccountsInfo` to batch RPC calls\n- Check `bondingCurve.complete` before any bonding curve operation\n- Use `fetchBuyState` / `fetchSellState` for efficient account fetching\n- Always extend account before migration if needed\n\n## Common Pitfalls\n\n- `BondingCurve.complete === true` means graduated — buy/sell will fail on-chain\n- Creator vault PDAs differ: `\"creator-vault\"` (Pump, hyphen) vs `\"creator_vault\"` (AMM, underscore)\n- `fetchSellState` requires ATA to exist (unlike `fetchBuyState`)\n- Fee recipient is selected randomly from `global.feeRecipients[]`\n\n" |
| #25 | } |
| #26 |