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-fee-system", |
| #3 | "name": "pump-fee-system", |
| #4 | "description": "Complete Pump protocol fee system — tiered protocol fees based on market cap, creator fee collection across two programs, basis point arithmetic, and ceiling division for dust-safe calculations.", |
| #5 | "category": "pump-protocol", |
| #6 | "path": "pump-fee-system/SKILL.md", |
| #7 | "url": "https://x402.wtf/api/skills/pump-fee-system", |
| #8 | "tags": [ |
| #9 | "pump", |
| #10 | "solana", |
| #11 | "fee", |
| #12 | "system" |
| #13 | ], |
| #14 | "requiredEnv": [], |
| #15 | "homepage": "https://github.com/nirholas/pump-fun-sdk", |
| #16 | "attestation": { |
| #17 | "status": "pending", |
| #18 | "isFormallyVerified": false, |
| #19 | "attestationPda": null, |
| #20 | "verificationTimestamp": null |
| #21 | }, |
| #22 | "markdown": "---\nname: pump-fee-system\ndescription: \"Complete Pump protocol fee system — tiered protocol fees based on market cap, creator fee collection across two programs, basis point arithmetic, and ceiling division for dust-safe calculations.\"\nmetadata:\n openclaw:\n homepage: https://github.com/nirholas/pump-fun-sdk\n---\n\n# Fee System — Tiered Fees, Creator Fees & Protocol Fees\n\nImplement and extend the Pump protocol's fee system: tiered protocol fees based on market cap, creator fee collection across two programs, and fee computation with ceiling division.\n\n## Context\n\nThe Pump protocol charges fees on every buy/sell transaction. Fees flow to protocol fee recipients and token creators. The fee system spans three programs and must handle tokens in both bonding curve and graduated (AMM) states.\n\n## Fee Types\n\n| Fee | Recipient | When Charged |\n|-----|-----------|-------------|\n| Protocol fee | `feeRecipients[]` in `Global` | Every buy/sell |\n| Creator fee | Token creator's vault PDA | Every buy/sell (if creator is set) |\n| LP fee | Liquidity providers (AMM only) | Post-graduation trades |\n\n## Tiered Fee Calculation\n\nWhen a `FeeConfig` exists, fees are market-cap-dependent:\n\n```typescript\nfunction calculateFeeTier({ feeTiers, marketCap }): Fees {\n // Iterate tiers in REVERSE order\n for (let i = feeTiers.length - 1; i >= 0; i--) {\n if (marketCap >= feeTiers[i].marketCapLamportsThreshold) {\n return feeTiers[i].fees;\n }\n }\n return feeTiers[0].fees; // fallback to lowest tier\n}\n```\n\n## Fee Computation\n\n```typescript\nfunction getFee({ global, feeConfig, mintSupply, bondingCurve, amount }): BN {\n const { protocolFeeBps, creatorFeeBps } = computeFeesBps(...);\n const protocolFee = ceilDiv(amount * protocolFeeBps, 10000);\n const creatorFee = hasCreator ? ceilDiv(amount * creatorFeeBps, 10000) : 0;\n return protocolFee + creatorFee;\n}\n```\n\n## Creator Vault Balance\n\nCreator fees accumulate in PDAs:\n- `creatorVaultPda(creator)` — Pump program vault\n- `ammCreatorVaultPda(creator)` — PumpAMM program vault\n\nBalance = total lamports - rent exemption minimum.\n\n## Error Classes\n\n| Error | Condition |\n|-------|-----------|\n| `NoShareholdersError` | Empty shareholders array |\n| `TooManyShareholdersError` | More than 10 shareholders |\n| `ZeroShareError` | Shareholder has `shareBps <= 0` |\n| `InvalidShareTotalError` | Shares don't sum to 10,000 bps |\n| `DuplicateShareholderError` | Duplicate addresses |\n\n## Patterns to Follow\n\n- Use ceiling division (`ceilDiv`) for all fee calculations to prevent dust loss\n- Always check both creator vaults (Pump + AMM) when querying balances\n- Use transaction simulation (`simulateTransaction`) for read-only fee queries\n- Creator fee is only charged when `bondingCurve.creator != PublicKey.default` or it's a new curve\n\n## Common Pitfalls\n\n- Fee tiers must be iterated in reverse — the first match from the end is used\n- `computeFeesBps` returns different results depending on whether `feeConfig` is null (legacy vs tiered)\n- Creator fees are zero for tokens without a set creator\n- `getMinimumDistributableFee` requires transaction simulation — it cannot be computed offline\n- `transferCreatorFeesToPump` is only for graduated tokens — non-graduated tokens will fail\n\n" |
| #23 | } |
| #24 |