Thank you for your interest in contributing to Pump SDK! Every contribution helps — whether it's a bug report, documentation improvement, or new feature.
- Prerequisites
- Getting Started
- Development Workflow
- Code Style
- Testing
- Commit Conventions
- Pull Request Process
- Issue Reporting
- PR Checklist
Before contributing, ensure you have:
| Requirement | Version | Check |
|---|---|---|
| Node.js | ≥ 18.0 | node --version |
| npm | ≥ 9.0 | npm --version |
| Git | ≥ 2.30 | git --version |
| Rust (optional) | ≥ 1.70 | rustc --version (for vanity generator) |
No API keys or RPC endpoints are needed for development — the core SDK is offline-first and all unit tests use fixtures.
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/pump-fun-sdk.git cd pump-fun-sdk -
Install dependencies:
npm install
-
Build the project:
npm run build
-
Run tests to verify your setup:
npm test -
Verify TypeScript types:
npm run typecheck
If all tests pass, you're ready to contribute.
Create a branch from main using these prefixes:
| Prefix | Use |
|---|---|
feat/ |
New features (feat/amm-deposit-instruction) |
fix/ |
Bug fixes (fix/slippage-calculation) |
docs/ |
Documentation changes (docs/api-reference) |
refactor/ |
Code restructuring (refactor/pda-module) |
test/ |
Adding/fixing tests (test/fee-tier-coverage) |
chore/ |
Maintenance (chore/update-dependencies) |
git checkout -b feat/your-feature-name- Make your changes in the
src/directory - Add or update tests in
src/__tests__/ - Run the test suite:
npm test - Run type checking:
npm run typecheck - Run linting:
npm run lint - Build to verify:
npm run build
| Command | Description |
|---|---|
npm run build |
Build CJS + ESM with type declarations |
npm run dev |
Build in watch mode |
npm test |
Run all tests |
npm run lint |
Check for lint errors |
npm run lint:fix |
Auto-fix lint errors |
npm run typecheck |
Type-check without emitting |
npm run clean |
Remove dist/ directory |
- Strict mode is enabled — no
anytypes without justification - Use
BN(bn.js) for all financial math — never JavaScriptnumberfor amounts - Return
TransactionInstruction[]from instruction builders, neverTransaction - Use
PublicKeyorPublicKeyInitDatafor address parameters - Prefer explicit return types on public functions
The project uses ESLint with Prettier integration:
# Check
npm run lint
# Fix
npm run lint:fix- Do not use
createInstruction(v1) — it is deprecated; usecreateV2Instruction - Do not use JavaScript
numberfor lamport or token amounts - Do not add Node.js-specific APIs to
src/(the SDK runs in browsers too) - Do not import from
src/idl/directly in new code — use SDK methods - Do not commit
.envfiles or private keys
# All tests
npm test
# Single file
npx jest src/__tests__/bondingCurve.test.ts
# With coverage
npx jest --coverage- Place unit tests in
src/__tests__/alongside the modules they test - Use shared fixtures from
src/__tests__/fixtures.ts - Test both happy paths and error cases
- Name test files
<module>.test.ts
The project enforces per-file coverage thresholds:
| File | Lines | Branches | Functions |
|---|---|---|---|
bondingCurve.ts |
90% | 90% | 80% |
fees.ts |
75% | 75% | 80% |
analytics.ts |
50%+ | 50%+ | 80%+ |
tokenIncentives.ts |
75%+ | 60%+ | 80%+ |
New code should maintain or improve these thresholds.
Use Conventional Commits:
<type>(<scope>): <short description>
[optional body]
[optional footer]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change that neither fixes a bug nor adds a feature |
test |
Adding or correcting tests |
chore |
Build process, dependencies, tooling |
perf |
Performance improvement |
feat(sdk): add ammDepositInstruction for LP operations
fix(fees): correct fee tier lookup for zero market cap
docs(readme): add fee sharing example
test(analytics): add price impact edge cases
-
Update your branch with the latest
main:git fetch origin git rebase origin/main
-
Push your branch:
git push origin feat/your-feature-name
-
Open a PR against
mainon GitHub -
Fill out the PR template:
- What does this PR do?
- How was it tested?
- Are there breaking changes?
-
Wait for review — maintainers aim to review within a few days
-
Address feedback with additional commits (don't force-push during review)
-
Squash merge will be used by maintainers when merging
Include:
- SDK version (
npm list @nirholas/pump-sdk) - Node.js version
- Minimal reproduction code
- Expected vs. actual behavior
- Error message and stack trace
Include:
- Use case description
- Proposed API (TypeScript signature)
- Why existing APIs can't solve this
Before submitting, verify:
- Code compiles:
npm run build - Tests pass:
npm test - Types check:
npm run typecheck - Lint passes:
npm run lint - New functions have tests
- Public API changes are documented
- No
console.logstatements left insrc/ - No private keys or
.envfiles committed - Commit messages follow conventional commits
- BN is used for all financial amounts (not
number)