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 | name: pump-solana-architecture |
| #3 | description: "Design and derive Program Derived Addresses (PDAs) and account layouts across the Pump ecosystem's four Solana programs — global singletons, per-token accounts, per-user accumulators, and cross-program coordination patterns." |
| #4 | metadata: |
| #5 | openclaw: |
| #6 | homepage: https://github.com/nirholas/pump-fun-sdk |
| #7 | --- |
| #8 | |
| #9 | # Solana Program Architecture — PDAs, Accounts & Multi-Program Coordination |
| #10 | |
| #11 | Design, derive, and manage Program Derived Addresses (PDAs) and account layouts across the Pump ecosystem's four Solana programs with cross-program invocation patterns. |
| #12 | |
| #13 | ## On-Chain Programs |
| #14 | |
| #15 | | Program | ID | Purpose | |
| #16 | |---------|-----|---------| |
| #17 | | Pump | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` | Bonding curve operations | |
| #18 | | PumpAMM | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | Graduated AMM pools | |
| #19 | | PumpFees | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | Fee sharing | |
| #20 | | Mayhem | `MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e` | Mayhem-mode tokens | |
| #21 | |
| #22 | ## PDA Categories |
| #23 | |
| #24 | ### Global Singletons |
| #25 | - `GLOBAL_PDA` — `["global"]` on Pump — protocol-wide config |
| #26 | - `FEE_CONFIG_PDA` — `["fee-config"]` on Pump — tiered fee settings |
| #27 | - `GLOBAL_VOLUME_ACCUMULATOR_PDA` — `["global_volume_accumulator"]` — protocol-wide volume |
| #28 | |
| #29 | ### Per-Token PDAs |
| #30 | - `bondingCurvePda(mint)` — `["bonding-curve", mint]` — token bonding curve state |
| #31 | - `bondingCurveTokenAccountPda(mint)` — `["bonding-curve-token-account", mint]` |
| #32 | - `feeSharingConfigPda(mint)` — `["sharing-config", mint]` on PumpFees |
| #33 | - `canonicalPumpPoolPda(mint)` — AMM pool for graduated token |
| #34 | |
| #35 | ### Per-User PDAs |
| #36 | - `creatorVaultPda(creator)` — `["creator-vault", creator]` on Pump |
| #37 | - `ammCreatorVaultPda(creator)` — `["creator_vault", creator]` on PumpAMM |
| #38 | - `userVolumeAccumulatorPda(user)` — `["user_volume_accumulator", user]` |
| #39 | |
| #40 | ### Mayhem PDAs |
| #41 | - `mayhemMetadataPda(mint)` — `["mayhem_metadata", mint]` on Mayhem |
| #42 | - `mayhemWsolPda()` — `["mayhem_wsol"]` on Mayhem |
| #43 | |
| #44 | ## BothPrograms Pattern |
| #45 | |
| #46 | Many operations span both Pump and PumpAMM — the SDK provides aggregation: |
| #47 | |
| #48 | | Method | Description | |
| #49 | |--------|-------------| |
| #50 | | `getCreatorVaultBalanceBothPrograms` | Sum balance from both vaults | |
| #51 | | `collectCoinCreatorFeeInstructions` | Collect from both programs | |
| #52 | | `fetchUserVolumeAccumulatorTotalStats` | Aggregate volume across programs | |
| #53 | | `claimTokenIncentivesBothPrograms` | Claim rewards from both | |
| #54 | |
| #55 | ## Token Lifecycle Cross-Program Flow |
| #56 | |
| #57 | ``` |
| #58 | Pump Program PumpAMM Program |
| #59 | ┌─────────────┐ ┌──────────────────┐ |
| #60 | │ create │ │ │ |
| #61 | │ buy / sell │ ── migrate ──► │ AMM trading │ |
| #62 | │ graduate │ │ fee collection │ |
| #63 | └─────────────┘ └──────────────────┘ |
| #64 | │ │ |
| #65 | └──── PumpFees Program ──────────┘ |
| #66 | (fee sharing) |
| #67 | ``` |
| #68 | |
| #69 | ## Account Extension |
| #70 | |
| #71 | Bonding curve accounts may need extension to `BONDING_CURVE_NEW_SIZE` (151 bytes) before certain operations: |
| #72 | |
| #73 | ```typescript |
| #74 | const extendIx = await PUMP_SDK.extendAccountInstruction({ |
| #75 | bondingCurvePda: bondingCurvePda(mint), |
| #76 | bondingCurveAccountInfo |
| #77 | }); |
| #78 | ``` |
| #79 | |
| #80 | ## Patterns to Follow |
| #81 | |
| #82 | - Use `findProgramAddressSync` for all PDA derivation — never manually compute bump seeds |
| #83 | - Group related account fetches into a single `getMultipleAccountsInfo` call |
| #84 | - Always check account existence before decoding — use nullable decoders |
| #85 | - Extend accounts before migration or setCreator operations |
| #86 | |
| #87 | ## Common Pitfalls |
| #88 | |
| #89 | - Creator vault PDA seeds differ: `"creator-vault"` (Pump, hyphen) vs `"creator_vault"` (AMM, underscore) |
| #90 | - `canonicalPumpPoolPda` uses the external pump-swap-sdk, not the Pump program |
| #91 | - Mayhem PDAs are on a separate program (`MAyhSm...`) |
| #92 | - PDA derivation failures indicate an invalid bump — the address is off the Ed25519 curve |
| #93 | |
| #94 |