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-incentives", |
| #3 | "name": "pump-token-incentives", |
| #4 | "description": "Volume-based PUMP token reward system with day-indexed epochs, pro-rata distribution, accumulator tracking, and cross-program claiming on Solana.", |
| #5 | "category": "pump-protocol", |
| #6 | "path": "pump-token-incentives/SKILL.md", |
| #7 | "url": "https://x402.wtf/api/skills/pump-token-incentives", |
| #8 | "tags": [ |
| #9 | "pump", |
| #10 | "solana", |
| #11 | "token", |
| #12 | "incentives" |
| #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-incentives\ndescription: \"Volume-based PUMP token reward system with day-indexed epochs, pro-rata distribution, accumulator tracking, and cross-program claiming on Solana.\"\nmetadata:\n openclaw:\n homepage: https://github.com/nirholas/pump-fun-sdk\n requires:\n env:\n - SOLANA_RPC_URL\n---\n\n# Token Incentives — Volume-Based PUMP Token Rewards\n\nImplement and maintain the token incentive system that rewards traders with PUMP governance tokens based on their SOL trading volume, using a day-based epoch system with pro-rata distribution.\n\n## Context\n\nThe Pump protocol incentivizes trading activity by distributing PUMP tokens to users proportional to their SOL trading volume. The system tracks volume in day-long epochs, with each day having a pre-configured token supply pool.\n\n## Day-Based Epoch System\n\nVolume tracking operates in fixed-length epochs defined by the `GlobalVolumeAccumulator`:\n- `startTime` — epoch system start timestamp\n- `secondsInADay` — epoch length (typically 86,400 seconds)\n- `solVolumes[]` — array of total SOL volume per day\n- `totalTokenSupply[]` — array of PUMP tokens available per day\n\n```typescript\ndayIndex = Math.floor((currentTimestamp - startTime) / secondsInADay)\n```\n\n## Pro-Rata Reward Formula\n\n$$\\text{tokens} = \\frac{\\text{userSolVolume} \\times \\text{dayTokenSupply}}{\\text{globalSolVolume}}$$\n\n## Account Lifecycle\n\n1. **Init** (`initUserVolumeAccumulator`) — creates the user's volume accumulator PDA\n2. **Sync** (`syncUserVolumeAccumulator`) — updates the accumulator with latest volume data\n3. **Claim** (`claimTokenIncentives`) — claims accumulated PUMP token rewards\n4. **Close** (`closeUserVolumeAccumulator`) — closes the account, reclaims rent\n\n## BothPrograms Aggregation\n\nSince users trade on both the bonding curve (Pump) and AMM (PumpAMM):\n\n- `fetchUserVolumeAccumulatorTotalStats(user)` — sums across both programs\n- `getTotalUnclaimedTokensBothPrograms(user)` — combined unclaimed rewards\n- `claimTokenIncentivesBothPrograms(user, payer)` — claims from both\n- `syncUserVolumeAccumulatorBothPrograms(user)` — syncs both\n\n## Edge Cases\n\n| Case | Behavior |\n|------|----------|\n| Zero global volume for a day | No tokens distributed (division by zero guarded) |\n| User never synced | Only `totalUnclaimedTokens` from account state returned |\n| Day index beyond arrays | No additional rewards computed |\n| User updated same day | `currentDayTokens` returns preview, `totalUnclaimedTokens` excludes it |\n\n## Patterns to Follow\n\n- Pure functions in `tokenIncentives.ts` — no side effects, no RPC calls\n- Accept optional `currentTimestamp` parameter for testability\n- Always use `BN` arithmetic — never convert to JavaScript `number`\n- Sync before claiming to ensure the latest volume is reflected\n\n## Common Pitfalls\n\n- `totalUnclaimedTokens` does NOT include the current day's rewards — only finalized days\n- `currentDayTokens` returns 0 if the user's last update was on a different day (sync first)\n- Day indices are zero-based from `startTime`, not from epoch 0\n- Volume accumulator PDAs differ between Pump and PumpAMM programs\n\n" |
| #25 | } |
| #26 |