# pumpfun-creator-fees
<!-- three.ws:badges -->
[](https://github.com/nirholas/pumpfun-creator-rewards/stargazers) [](https://github.com/nirholas/pumpfun-creator-rewards/commits) [](https://github.com/nirholas/pumpfun-creator-rewards/pulls) [](https://github.com/nirholas/pumpfun-creator-rewards/blob/HEAD/AGENTS.md)
<!-- /three.ws:badges -->
Look up Pump.fun creator-reward earnings by **coin mint**, **wallet address**, or **username**.
Single-page web app with a JSON API. Live data, no mocks. Ships as one container on Google Cloud Run.
**Live:** <https://pumpfun-creator-rewards-lp642k3kpa-uc.a.run.app>
Try it directly:
```bash
curl "https://pumpfun-creator-rewards-lp642k3kpa-uc.a.run.app/api/fees?q=<mint|wallet|username>"
```
## What it shows
Given any of the three inputs:
- **Lifetime totals** for the resolved wallet: total earned, claimed, and unclaimed (SOL + USD)
- **Per-coin earnings** — exactly how much *each individual coin* has paid this wallet, with the payout count, when it last paid, and what share of the creator's total income it represents
- **Breakdown stats** — how many coins have ever actually paid out, how concentrated the income is (e.g. "2 coins make up 90% of earnings"), and the last 30 days of earnings
- **Distribution timeline** for a coin: every fee-sharing config change and every payout, with transaction links
When the input is a coin mint, the headline figure is **what that coin paid**, with the creator's all-coin lifetime totals shown separately underneath as context.
### How per-coin earnings are derived
This is the part worth understanding, because pump.fun does not hand it to you.
The wallet totals endpoint accepts a `mint` query param, but **ignores it**: filtering by mint returns byte-identical numbers to the unfiltered call, even for a mint the wallet has no share in. Anything that presents `totals?mint=X` as "what coin X earned" is really showing the creator's lifetime total across every coin.
The real per-coin figure comes from each coin's **distribution timeline**. Every `distribution` event lists the exact lamports paid to each recipient, so summing the entries addressed to the wallet gives what that coin actually paid it. Across a 53-coin creator, those per-coin sums add up to within **0.0004%** of the wallet's reported lifetime `shareholderClaimed`, which is the check that says the method is sound. Every response includes a `reconciliation` block reporting that delta, so drift is visible rather than silent.
One honest limitation: pump.fun reports **unclaimed** fees only at the wallet level, so unclaimed cannot be attributed per coin. Per-coin numbers are therefore amounts *distributed* (paid out), and they reconcile against `shareholderClaimed`, not `shareholderTotalEarned`. The UI says so.
This distinction also matters for GitHub social-fee claim alerts. A withdrawal
from a shared fee account does not contain a token mint and must not be assigned
to the highest-market-cap linked coin. Use the per-coin distribution timeline
when coin-level payment attribution is required; otherwise label the withdrawal
`unresolved_pooled`. A GitHub claim is evidence of payment, not automatic proof
that the identity created or endorses a token.
## API
All endpoints are `GET` (or `HEAD`) and return JSON.
`q` accepts a coin mint or wallet address (32 to 44 base58 characters), a pump.fun username, or `platform:user`: `github:` (alias `gh:`) and `pump:` take a username, `x:` (alias `twitter:`) takes a handle or numeric id, and `tiktok:`, `discord:`, `reddit:`, `youtube:` and `twitch:` take the numeric user id. A bare name pump.fun does not know is also tried as a GitHub login. Malformed input is rejected with `400` before any upstream call.
Errors are `{ "error": "..." }`, never cached:
| Status | Meaning |
|---|---|
| `400` | Missing, repeated or malformed parameter |
| `404` | Well-formed input that resolves to nothing |
| `429` | This client is over the rate limit (see `Retry-After`) |
| `502` | An upstream service failed or returned something unusable |
| `503` | An upstream service is rate-limiting this server |
| `504` | An upstream service timed out (each call is capped at 10s) |
Amounts carry an exact `lamports` integer string alongside `sol` and `usd`. `sol` is a convenience number (lamports / 1e9 as a double), so use `lamports` where exactness matters.
### `GET /api/fees?q=<mint|wallet|username>`
Fast summary: the resolved identity, lifetime totals, and every coin sharing fees with the wallet (fully paginated — a creator with 53 coins returns 53, not the first page).
```jsonc
{
"query": "...",
"resolved": {
"type": "mint" | "wallet" | "username" | "social",
"wallet": "...",
"mint": "...", // set when type=mint, else null
"platform": "github", // set for platform:user lookups, else null
"username": "...", // set when known, else null
"numericId": "...", // the platform user id, for type=social
"coinMeta": { ... }, // set when type=mint
"sharingConfigAddress": "...", // type=mint: the on-chain fee-sharing config, when readable
"onChainRecipients": [ { "wallet": "...", "bps": 10000, "sharePct": 100 } ],
"profile": { ... } // set when the wallet has a pump.fun profile
},
"totals": {
"shareholderClaimed": { "lamports": "...", "sol": "...", "usd": "..." },
"shareholderUnclaimed": { ... },
"shareholderTotalEarned": { ... },
"mintCount": 53
},
"solPriceUsd": 76.29, // derived from the API's own SOL/USD pair, not an oracle
"coins": [
{ "mint": "...", "name": "...", "symbol": "...", "image": "...",
"bps": 10000, "sharePct": 100, "isAdmin": true,
"marketCapUsd": 0, "createdTimestamp": 0 }
],
"coinsTruncated": false, // true only if the creator has more coins than we can page
"fetchedAt": "..."
}
```
### `GET /api/earnings?q=<mint|wallet|username>`
The intelligence view. Same shape, plus what each coin actually paid. Walks one timeline per coin (concurrency-capped and cached), so it is heavier than `/api/fees` — around 1.7s cold for a 53-coin creator, and the UI renders the summary first and fills this in when it lands.
```jsonc
{
"resolved": { ... },
"totals": { ... },
"solPriceUsd": 76.29,
"coinEarnings": { ... }, // present when type=mint: THIS coin's entry from `coins`
"coins": [ // sorted by earnings, descending
{
"mint": "...", "name": "...", "symbol": "...", "image": "...",
"bps": 10000, "sharePct": 100, "marketCapUsd": 0,
"earned": { "lamports": "2856250...", "sol": 2856.25, "usd": 217899.1 },
"earnedLast30d": { "lamports": "...", "sol": 0, "usd": 0 },
"shareOfEarningsPct": 89.4, // this coin's cut of everything the wallet was paid
"distributions": 127, // number of payouts
"firstEarnedAt": "2026-06-08T20:50:01.000Z",
"lastEarnedAt": "2026-07-12T09:14:03.000Z",
"earningsTruncated": false // true if the timeline was too long to read in full (30 pages of 100)
}
],
"insights": {
"coinCount": 53,
"earningCoinCount": 37,
"silentCoinCount": 16, // share fees but have never paid a lamport
"truncatedCoinCount": 0, // coins with earningsTruncated, whose totals may be low
"distributed": { "lamports": "...", "sol": 3193.96, "usd": 243662.4 },
"unclaimed": { "sol": "86.73", "usd": "6626.76" },
"last30d": { "sol": 939.69, "usd": 71688.2 },
"lastEarnedAt": "2026-07-12T09:14:03.000Z",
"topCoin": { "mint": "...", "name": "...", "earned": { ... } },
"topCoinSharePct": 89.4,
"coinsFor90Pct": 2 // coins needed to account for 90% of all earnings
},
"reconciliation": { // summed distributions vs the API's own claimed figure
"summedDistributions": { "sol": 3193.956, ... },
"apiClaimed": { "sol": "3193.967815798", ... },
"deltaSol": -0.0119,
"deltaPct": -0.0004
},
"fetchedAt": "..."
}
```
### `GET /api/timeline?q=<mint>&cursor=<cursor>`
A coin's raw event feed: creation, fee-sharing config changes, and every distribution with its transaction signature. Returns `coin` metadata, `items` and `pagination` (`hasMore`, `nextCursor`), 50 events per page; pass `nextCursor` back as `cursor`. `q` must be a mint address.
### `GET /api/xid?username=<x_handle>`
Resolves an X/Twitter handle (with or without `@`) to the numeric user ID that pump.fun's social vaults are keyed by: `{ "id": "...", "username": "..." }`. X has no keyless lookup API, so this reads the public profile page and falls back to Nitter mirrors; expect it to be the least reliable endpoint.
## Data sources
This is a thin proxy over Pump.fun's own public-but-undocumented APIs:
- `https://swap-api.pump.fun/v1/fee-sharing/account/{wallet}/totals` — wallet lifetime earnings (its `?mint=` filter is ignored upstream, see above)
- `https://swap-api.pump.fun/v1/fee-sharing/account/{wallet}/shares` — per-coin sharing config
- `https://swap-api.pump.fun/v1/coins/{mint}/timeline` — a coin's events, including every distribution
- `https://frontend-api-v3.pump.fun/coins-v2/{mint}` — coin metadata + creator
- `https://frontend-api-v3.pump.fun/users/{username|wallet}` — username → wallet
These are the same endpoints the live pump.fun frontend calls. Not affiliated with Pump.fun.
Identity lookups also use the Solana JSON-RPC (`getAccountInfo` for social vaults and fee-sharing configs), the GitHub users API (login → numeric id), and x.com or Nitter pages (X handle → id).
## Local dev
```bash
npm install
npm run dev # vite on :3000, all four /api routes served by middleware
```
Open <http://localhost:3000> and try a mint, wallet, or username.
Checks (the same ones CI runs):
```bash
npm run lint # node --check on every JS file, JSON manifests parse
npm test # node:test suite; fetch is mocked, no network calls
npm run build
```
To run the production server (built assets + API, exactly what the container runs):
```bash
npm run serve # build, then node server.js on :8080
```
## Architecture
One container serves everything:
- `server.js` — Node HTTP server. Static UI from `dist/` (hashed assets cached forever, `index.html` revalidated), `/api/*` routed to the handlers, `/health` for the platform probe.
- `lib/node-adapter.js` — maps the `api/*.js` handlers (written against the Vercel `req.query` / `res.status().json()` signature) onto plain Node request and response objects. Both `server.js` and the Vite dev server mount it, so a route that works in dev works in production.
- `api/*.js` — the four endpoints, thin wrappers that validate input and map errors to statuses.
- `lib/pump.js` — input resolution, pagination and the earnings math. `lib/upstream.js` wraps every outbound call with a timeout and error mapping, `lib/validate.js` checks input, `lib/solana.js` does base58 and PDA derivation without an SDK, `lib/xid.js` resolves X handles, and `lib/rate-limit.js` throttles clients.
- No database and no secrets: every response is derived live from upstream. The only state is an in-process cache (coin metadata for 2 minutes, per-coin earnings for 1 minute) and the rate-limit counters.
## Deploy (Google Cloud Run)
```bash
gcloud auth login # once, if your token has expired
npm run deploy
```
`npm run deploy` submits `cloudbuild.yaml` to Cloud Build, which builds the image with BuildKit inline caching (an unchanged `package-lock.json` skips `npm ci`), pushes it to Artifact Registry, and deploys it to the `pumpfun-creator-rewards` Cloud Run service in `us-central1`.
The service scales to zero, so it costs nothing when idle. Both the build and runtime service accounts are pinned in `cloudbuild.yaml` on purpose: the project's default compute service account was deleted, and a build that falls back to it fails.
Nothing needs to be configured for the app to run, and it needs no secrets. These optional environment variables tune the server:
| Variable | Default | Effect |
|---|---|---|
| `PORT` | `8080` | Port to listen on. Cloud Run sets it. |
| `RATE_LIMIT_PER_MINUTE` | `60` | `/api/*` requests allowed per client per minute, counted per instance. Over the limit the API answers `429` with `Retry-After`. `0` disables the limit. |
| `SOLANA_RPC_URL` | `https://api.mainnet-beta.solana.com` | Solana JSON-RPC endpoint for vault and sharing-config reads. The public endpoint rate-limits hard; a private one avoids `503`s on social lookups. The URL is never logged or returned, so it may carry an API key. |
| `TRUST_PROXY_HOPS` | `1` | How many proxies in front of the server append to `X-Forwarded-For`. The client address used for rate limiting is the entry that many places from the right. Cloud Run is one hop; set `0` when the server is exposed directly, so a forged header cannot dodge the limit. |
## License
All rights reserved. See [LICENSE](LICENSE).
## Documentation
Full documentation site: **https://nirholas.github.io/pumpfun-creator-rewards/**
- [Getting started](docs/getting-started.md) covers install and first run.
- [Examples](docs/examples.md) has copy-paste snippets.
## Star History
[](https://www.star-history.com/#nirholas/pumpfun-creator-rewards&Date)
<!-- three.ws:growth -->
## Support the project
If pumpfun-creator-rewards saves you time, **[star it on GitHub](https://github.com/nirholas/pumpfun-creator-rewards)**. Stars are how other developers and AI agents find the repositories worth trusting, and they cost you one click.
Know someone who would use it? [Post on X](https://twitter.com/intent/tweet?text=pumpfun-creator-rewards%3A%20Look%20up%20Pump.fun%20creator-reward%20earnings%20by%20coin%20mint%2C%20wallet%20address%2C%20or%20username&url=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpumpfun-creator-rewards) · [Share on Bluesky](https://bsky.app/intent/compose?text=pumpfun-creator-rewards%3A%20Look%20up%20Pump.fun%20creator-reward%20earnings%20by%20coin%20mint%2C%20wallet%20address%2C%20or%20username%20https%3A%2F%2Fgithub.com%2Fnirholas%2Fpumpfun-creator-rewards) · [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpumpfun-creator-rewards) · [Submit to Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpumpfun-creator-rewards&t=pumpfun-creator-rewards%3A%20Look%20up%20Pump.fun%20creator-reward%20earnings%20by%20coin%20mint%2C%20wallet%20address%2C%20or%20username) · [Share on Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fnirholas%2Fpumpfun-creator-rewards&title=pumpfun-creator-rewards%3A%20Look%20up%20Pump.fun%20creator-reward%20earnings%20by%20coin%20mint%2C%20wallet%20address%2C%20or%20username)
## Built for AI agents too
Coding agents and LLM tooling can read this repo directly: [AGENTS.md](./AGENTS.md), [llms.txt](./llms.txt), [llms-full.txt](./llms-full.txt). Point an agent at `https://github.com/nirholas/pumpfun-creator-rewards` and it has the context it needs.
## More from the same author
- [All repositories by nirholas](https://github.com/nirholas/nirholas#readme): the full catalog, grouped by topic
- [three.ws](https://three.ws): the platform for 3D AI agents with Solana wallets, a skill marketplace and x402 payments
- Questions or ideas: [open an issue](https://github.com/nirholas/pumpfun-creator-rewards/issues) or [start a discussion](https://github.com/nirholas/pumpfun-creator-rewards/discussions)
## Contributors
[](https://github.com/nirholas/pumpfun-creator-rewards/graphs/contributors)
<!-- /three.ws:growth -->
<!-- nirholas:watermark -->
---
<p align="center">
Built by <a href="https://github.com/nirholas"><b>nirholas</b></a> · <a href="https://x.com/nichxbt">@nichxbt</a> · <a href="https://github.com/nirholas">github.com/nirholas</a>
</p>
<!-- /nirholas:watermark -->