under the hood

How it works

In short, the site watches one wallet: the one pump.fun pays the coin's creator fees to. Each time I claim fees, it shows up as a public transaction, and the site records how much was claimed and when. I then log the gifts I've sent on TikTok LIVE, and the site does the accounting. It can read the chain but never move anything, so there's nothing here worth breaking into.

In one line: the chain shows what came in, and I show what went out.

the short versionFive steps

  1. Someone trades the coin

    Every buy or sell pays a small creator fee. pump.fun holds it in two vaults tied to the creator wallet.

    // vaultAddresses() works out both vault addresses from the wallet alone
  2. I claim the fees, and the site notices

    Claiming happens on pump.fun like normal. The site reads the wallet's transactions and records each claim, with no typing on my part.

    // vaultOutflow() compares each vault's balance before and after a transaction
  3. A streamer gets featured

    Every 15 minutes the spotlight moves to the next approved account in the queue. You can see who it is, and a countdown, on the main page.

    // currentPick() uses the clock, not a cron job, so everyone sees the same pick
  4. I send the gifts by hand

    Galaxies and other gifts go to the featured account's latest video, or to their live stream. Each one is logged with a screenshot or clip.

    // the log refuses any gift that costs more than what's left on its claim
  5. You check the numbers

    The main page adds it all up: fees earned, claimed, spent on gifts, and what's left. Every claim links to its transaction.

    // summarize(): unspent = claimed − spent

the flowFrom wallet to web page

  1. inputCreator wallet address
  2. step 1Work out where fees land
  3. step 2List the wallet's transactions
  4. step 3Spot SOL leaving the vaults
  5. step 4Save each claim once
  6. step 5I log each gift by hand
  7. step 6Add it all up
  8. outputThis website

Press the button to walk through it one stage at a time.

step by stepThe actual code

Short excerpts from the real code, not the full files. Feel free to skip them if code isn't your thing.

src/lib/chain.tsvaultAddresses()
export function vaultAddresses(creator: PublicKey) {
  const solVault = creatorVaultPda(creator); // Pump program, seeds ["creator-vault", creator], native SOL
  const [ammAuthority] = PublicKey.findProgramAddressSync([Buffer.from("creator_vault"), creator.toBuffer()], PUMP_AMM);
  const wsolVault = getAssociatedTokenAddressSync(NATIVE_MINT, ammAuthority, true, TOKEN_PROGRAM_ID); // PumpSwap, WSOL
  return { solVault, wsolVault };
}
01 /

Work out where the fees land

pump.fun doesn't send creator fees straight to my wallet. They collect in two "vaults" tied to it: one for while the coin is on the bonding curve, and one for after it moves to PumpSwap.

Both vault addresses can be worked out from my wallet address alone, with no lookup needed. Everything after this step is about watching those two accounts.

src/lib/chain.tsscanClaims()
  for (let page = 0; page < maxPages; page++) {
    const batch = await c.getSignaturesForAddress(creator, { limit: 1000, before, until: until ?? undefined });
    sigs.push(...batch);
    if (batch.length < 1000) break;
    before = batch[batch.length - 1].signature;
  }
  const ordered = sigs.filter((s) => !s.err).reverse(); // oldest first
02 /

List the wallet's transactions

Next it asks a Solana RPC node for the creator wallet's transaction IDs, 1,000 at a time, newest first. until is a bookmark: the last transaction it already checked, so it only fetches what's new.

Failed transactions are skipped, and the rest are fetched in full, 20 at a time. If the free RPC plan asks it to slow down, it pauses briefly and tries again. Getting this part right took a while.

src/lib/fees.tsvaultOutflow()
  let sol = 0n;
  const i = tx.accountKeys.indexOf(vaults.solVault);
  if (i >= 0) {
    const d = BigInt(tx.preBalances[i] ?? 0) - BigInt(tx.postBalances[i] ?? 0);
    if (d > 0n) sol = d;
  }
03 /

Spot SOL leaving the vaults

This is the core idea. Every Solana transaction records each account's balance before and after it runs. If a vault's balance went down, that's a claim, and the difference is the amount.

Increases (from trading) are ignored. The PumpSwap vault gets the same check. Amounts are kept in lamports, the smallest unit of SOL, so nothing is lost to rounding.

src/lib/sync.tsrunSync()
    for (const c of claims) {
      const price = await solUsdOn(c.blockTime.toISOString().slice(0, 10));
      const rows = await db
        .insert(schema.claims)
        .values({ signature: c.signature, blockTime: c.blockTime, lamports: c.lamports, solUsd: price ? String(price) : null })
        .onConflictDoNothing({ target: schema.claims.signature })
        .returning({ id: schema.claims.id });
      added += rows.length;
    }
    if (newest) await setState("cursor", newest);
04 /

Save each claim, exactly once

Each claim is saved along with that day's SOL price. If the same claim turns up twice, the second copy is quietly ignored, so there are never duplicates.

The bookmark then moves forward. All of this runs on its own when someone opens the site (at most once a minute), or when I press Sync.

src/app/admin/actions.tsaddGiftAction()
    const alloc = allocate(claims, gifts).find((a) => a.id === claimId);
    if (!fitsClaim(alloc, lamports)) {
      return { error: alloc ? `This gift is ${sol(lamports)} SOL but only ${sol(alloc.remaining)} SOL is left on that claim.` : "Pick the claim that paid for this gift." };
    }
05 /

I log each gift by hand

This is the one part the chain can't see. I buy TikTok coins and send each gift during the stream myself, then fill in a short form: the streamer, the gift (a Rose, a Galaxy, whatever it was), the cost, and a link to the proof.

The cost is converted to SOL at that day's price. The site won't accept a gift worth more than what's left on its claim, which keeps the accounts consistent.

src/lib/fees.tssummarize()
  const claimed = claims.reduce((a, c) => a + c.lamports, 0n);
  const spent = gifts.reduce((a, g) => a + g.lamports, 0n);
  const giftUsdCents = gifts.reduce((a, g) => a + g.usdCents, 0);
  return {
    earned: claimed + unclaimed,
    claimed,
    unclaimed,
    spent,
    unspent: claimed > spent ? claimed - spent : 0n,
    giftUsdCents,
    overspent: spent > claimed,
  };
06 /

Add it all up

From here it's simple addition. Claimed is the sum of all claims, spent is the sum of all gifts, and unspent is the difference. Unclaimed is whatever is still sitting in the vaults.

If gifts ever add up to more than was claimed, the site says so on the front page rather than hiding it.

Why I did it this way

Balances, not messages

I could have simply written “claimed X SOL” somewhere, but then you'd be relying on my word. The balances are recorded by the network itself, so nobody can alter them, myself included.

Read-only by design

The site holds no wallet keys, so even if someone broke in, there'd be nothing to take. I claim fees on pump.fun as usual, and the site simply picks them up.

What I'd change next time

  • Host proof screenshots on the site rather than linking out, since links don't last forever.
  • Sync on a schedule. At the moment it only checks when someone visits, which works fine until things go quiet.
  • Test it on a coin that's graduated to PumpSwap. The code supports it, but it hasn't been tried on one yet.
  • syntax highlighting on this page would be nice too

good to knowQuick answers

Where do the numbers come from?
Fee claims are read straight from the Solana blockchain, so anyone can check them. Gifts happen off-chain, so those are logged by me with proof attached.
Is anything about me saved?
Just browsing saves nothing about you. If you nominate someone, their handle and your reason are saved, along with a scrambled (hashed) form of your IP for spam limits.
Are the gifts sent automatically?
No. Every gift is bought and sent by hand. The site only reads the chain and keeps the record; it has no wallet keys and can't move anything.
Can I suggest who gets gifts?
Yes. Nominate a streamer, and if they're added to the queue, they'll take a turn in the rotation.