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-fee-sharing |
| #3 | description: "Configure and distribute creator fees to multiple shareholders using the PumpFees program with BPS-based share allocation, admin management, and cross-program fee consolidation for graduated tokens." |
| #4 | metadata: |
| #5 | openclaw: |
| #6 | homepage: https://github.com/nirholas/pump-fun-sdk |
| #7 | requires: |
| #8 | env: |
| #9 | - SOLANA_RPC_URL |
| #10 | --- |
| #11 | |
| #12 | # Fee Sharing — Multi-Party Creator Fee Distribution |
| #13 | |
| #14 | Configure and manage creator fee sharing — allowing token creators to distribute accumulated trading fees to multiple shareholders using the PumpFees program with BPS-based share allocation. |
| #15 | |
| #16 | ## Architecture |
| #17 | |
| #18 | ``` |
| #19 | Token Creator |
| #20 | │ |
| #21 | ▼ |
| #22 | ┌─────────────────────┐ |
| #23 | │ SharingConfig PDA │ |
| #24 | │ (PumpFees program) │ |
| #25 | │ shareholders: │ |
| #26 | │ [{ addr, bps }] │ |
| #27 | └─────────────────────┘ |
| #28 | │ distribute |
| #29 | ┌────┴────┬────┬────┐ |
| #30 | │ 40% │ 30%│ 20%│ 10% |
| #31 | ▼ ▼ ▼ ▼ |
| #32 | User1 User2 User3 User4 |
| #33 | ``` |
| #34 | |
| #35 | ## Workflow |
| #36 | |
| #37 | ### 1. Create Fee Sharing Config |
| #38 | |
| #39 | ```typescript |
| #40 | const ix = PUMP_SDK.createFeeSharingConfig({ |
| #41 | creator, mint, pool, payer, |
| #42 | shareholders: [ |
| #43 | { address: userA, shareBps: 5000 }, // 50% |
| #44 | { address: userB, shareBps: 3000 }, // 30% |
| #45 | { address: userC, shareBps: 2000 }, // 20% |
| #46 | ] |
| #47 | }); |
| #48 | ``` |
| #49 | |
| #50 | ### 2. Update Shareholders |
| #51 | |
| #52 | ```typescript |
| #53 | const ix = PUMP_SDK.updateFeeShares({ |
| #54 | creator, mint, |
| #55 | shareholders: [ |
| #56 | { address: userA, shareBps: 4000 }, |
| #57 | { address: userD, shareBps: 3000 }, |
| #58 | { address: userB, shareBps: 3000 }, |
| #59 | ] |
| #60 | }); |
| #61 | ``` |
| #62 | |
| #63 | ### 3. Distribute Fees |
| #64 | |
| #65 | ```typescript |
| #66 | const { instructions, isGraduated } = await onlineSdk.buildDistributeCreatorFeesInstructions(mint); |
| #67 | // For graduated: transferCreatorFeesToPump + distributeCreatorFees |
| #68 | // For non-graduated: distributeCreatorFees only |
| #69 | ``` |
| #70 | |
| #71 | ## Validation Rules |
| #72 | |
| #73 | | Rule | Error Class | |
| #74 | |------|------------| |
| #75 | | At least 1 shareholder | `NoShareholdersError` | |
| #76 | | Maximum 10 shareholders | `TooManyShareholdersError` | |
| #77 | | No zero-share entries | `ZeroShareError` | |
| #78 | | Shares sum to 10,000 BPS | `InvalidShareTotalError` | |
| #79 | | No duplicate addresses | `DuplicateShareholderError` | |
| #80 | | Graduated tokens need pool | `PoolRequiredForGraduatedError` | |
| #81 | |
| #82 | ## Cross-Program Fee Consolidation |
| #83 | |
| #84 | ``` |
| #85 | Trading fees ──► AMM Creator Vault (PumpAMM) |
| #86 | │ |
| #87 | transferCreatorFeesToPump |
| #88 | │ |
| #89 | ▼ |
| #90 | Pump Creator Vault (Pump) |
| #91 | │ |
| #92 | distributeCreatorFees |
| #93 | │ |
| #94 | ▼ |
| #95 | Shareholders (proportional) |
| #96 | ``` |
| #97 | |
| #98 | ## Patterns to Follow |
| #99 | |
| #100 | - Validate shareholder arrays before sending: max 10, sum = 10,000 BPS, no duplicates, no zero shares |
| #101 | - Use `BothPrograms` methods when aggregating across Pump + PumpAMM |
| #102 | - Check `isGraduated` to determine if AMM fee consolidation is needed |
| #103 | - Check `adminRevoked` before attempting to update shareholders |
| #104 | |
| #105 | ## Common Pitfalls |
| #106 | |
| #107 | - Shares must total exactly 10,000 BPS (100%) — not 100, not 1,000,000 |
| #108 | - Graduated tokens require the `pool` parameter for config creation |
| #109 | - Two separate creator vaults exist with different PDA seeds (hyphen vs underscore) |
| #110 | - `updateFeeShares` will fail on-chain if `adminRevoked === true` |
| #111 | - Basis points use integer arithmetic — fractional bps are not possible |
| #112 | |
| #113 |