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-sdk-core", |
| #3 | "name": "pump-sdk-core", |
| #4 | "description": "Build and extend the core Pump SDK — an offline-first TypeScript SDK that constructs Solana TransactionInstructions for token creation, buying, selling, migration, and creator fee collection across three on-chain programs (Pump, PumpAMM, PumpFees).", |
| #5 | "category": "typescript", |
| #6 | "path": "pump-sdk-core/SKILL.md", |
| #7 | "url": "https://x402.wtf/api/skills/pump-sdk-core", |
| #8 | "tags": [ |
| #9 | "pump", |
| #10 | "solana", |
| #11 | "sdk", |
| #12 | "core" |
| #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-sdk-core\ndescription: \"Build and extend the core Pump SDK — an offline-first TypeScript SDK that constructs Solana TransactionInstructions for token creation, buying, selling, migration, and creator fee collection across three on-chain programs (Pump, PumpAMM, PumpFees).\"\nmetadata:\n openclaw:\n homepage: https://github.com/nirholas/pump-fun-sdk\n requires:\n env:\n - SOLANA_RPC_URL\n---\n\n# Pump SDK Core — Instruction Building & On-Chain Interaction\n\nBuild, extend, and maintain the core Pump SDK — an offline-first TypeScript SDK that constructs Solana `TransactionInstruction`s for token creation, buying, selling, migration, and creator fee collection across three on-chain programs (Pump, PumpAMM, PumpFees) plus the Mayhem program.\n\n## Context\n\nThe SDK is published as `@nirholas/pump-sdk` (npm) and powers the Pump protocol — a Solana-based token launchpad with bonding curve pricing, automatic AMM migration after graduation, tiered fees, and creator fee sharing. The codebase uses Anchor for IDL-based instruction building and supports both Token (SPL) and Token-2022 token programs.\n\n## Key Files\n\n- `src/sdk.ts` — `PumpSdk` class with all instruction builders and account decoders\n- `src/onlineSdk.ts` — `OnlinePumpSdk` class extending offline SDK with live RPC fetches\n- `src/index.ts` — barrel re-export module defining the public API surface\n- `src/state.ts` — TypeScript interfaces for all on-chain account state\n- `src/pda.ts` — Program Derived Address derivation for all programs\n- `src/idl/pump.ts`, `src/idl/pump_amm.ts`, `src/idl/pump_fees.ts` — Anchor IDL definitions\n\n## Architecture\n\n- **Offline SDK (`PumpSdk`)**: Builds instructions without a live connection. Uses Anchor `Program` instances initialized with a dummy keypair and connection. Exported as a singleton `PUMP_SDK`.\n- **Online SDK (`OnlinePumpSdk`)**: Wraps `PumpSdk` with a real `Connection` for fetching account state via `getMultipleAccountsInfo`. Provides \"BothPrograms\" methods that aggregate data across bonding curve (Pump) and AMM (PumpAMM) programs.\n- **Three program IDs**: `PUMP_PROGRAM_ID`, `PUMP_AMM_PROGRAM_ID`, `PUMP_FEE_PROGRAM_ID`, plus `MAYHEM_PROGRAM_ID` for mayhem-mode tokens.\n\n## Instruction Builder Pattern\n\nEvery instruction method returns `TransactionInstruction[]` (not transactions), allowing callers to compose them into transactions freely. Methods follow a naming convention:\n- `*Instruction` — single instruction\n- `*Instructions` — multiple instructions (e.g., ATA creation + buy)\n\n## Account Decoders\n\nThe SDK decodes raw `AccountInfo<Buffer>` into typed interfaces using the Anchor coder:\n- `decodeGlobal`, `decodeBondingCurve`, `decodeFeeConfig`, `decodeSharingConfig`, etc.\n- Nullable variants (e.g., `decodeBondingCurveNullable`) handle missing or undersized accounts gracefully.\n\n## Slippage Calculation\n\n```\nmaxSolCost = solAmount + (solAmount × slippage × 10 / 1000)\nminSolReceived = solAmount - (solAmount × slippage × 10 / 1000)\n```\n\n## Patterns to Follow\n\n- Always return `TransactionInstruction[]` from instruction builders, never full `Transaction` objects\n- Use `getMultipleAccountsInfo` to batch RPC calls (2–3 accounts per call)\n- Support both Token (SPL) and Token-2022 programs via `tokenProgram` parameter\n- Handle account extension (`extendAccountInstruction`) for bonding curves that need more space\n- Validate shareholder arrays: max 10 shareholders, shares must total 10,000 bps, no duplicates, no zero shares\n- Use typed error classes from `src/errors.ts` for validation failures\n- Keep the offline SDK connection-free; all RPC calls belong in `OnlinePumpSdk`\n\n## Common Pitfalls\n\n- Circular dependency between `sdk.ts` and `onlineSdk.ts`\n- Buy instruction passes `{ 0: true }` as a flags argument — this is intentional, not a bug\n- `BONDING_CURVE_NEW_SIZE = 151` — accounts may need extension before certain operations\n- `BondingCurve.complete === true` means the token has graduated to AMM — bonding curve operations will fail\n- The `createInstruction` (v1) is deprecated in favor of `createV2Instruction` (Token-2022)\n\n" |
| #25 | } |
| #26 |