# Claim creator fees

Launch owners open [Account → Claim creator fees](https://clawdmail.app/account#creator-fees), also linked from the CLAWD sidebar and the launch-wallet panel. The page uses the same private, approved account and server-managed Privy launch wallet as coin creation.

The live balance includes SOL above rent in the wallet-wide Pump creator vault, WSOL token amounts in the wallet-wide PumpSwap creator vault, and retained creator fees on each confirmed coin's bonding curve and canonical PumpSwap pool. Vault balances belong to the wallet across all its tokens; they are not attributed to individual coins. Current onchain curve and pool recipients are checked independently against the owner wallet. Only the original single-creator SOL flow used by this launcher is supported. Coins moved to fee sharing or holder rewards use their respective distribution flows.

Choose **Review fee claim** to simulate the exact transaction. It sweeps retained creator fees, then calls the modern bonding `collect_creator_fee_v2` and PumpSwap `collect_coin_creator_fee` instructions as needed. PumpSwap's WSOL payout is unwrapped into the same launch wallet. If the destination WSOL account already exists, the review shows its existing WSOL and returned account rent before closing it. A changed destination account requires a fresh review.

The review displays fee income, estimated total claim cost (including rent), estimated net income, destination, and a 45-second expiry. Claims must have positive net income and stay within a 0.05 SOL total cost ceiling. The owner checks the approval box and selects **Approve and claim fees**. No email or MCP connection can approve a claim. Large portfolios are claimed in batches that fit Solana's 1,232-byte transaction limit; the review shows remaining fees, and the owner can claim them afterward with another review.

Every claim is persisted in PostgreSQL. One partial unique index permits one active claim per owner, and signing uses an atomic revision claim across web replicas. Privy's signed transaction must preserve the reviewed message and have valid signatures. The signed wire and signature are saved before the single broadcast. A network timeout remains `submitted`; receipt refresh only checks that signature. Confirmed success and error outcomes remain submitted, holding the active claim until finalized. Confirmation requires the successful finalized onchain transaction to match the exact reviewed message and saved signature; successful receipts have `state: confirmed` and `confirmationStatus: finalized`. After finalized blockheight passes the transaction's expiry, a signing interruption is atomically fenced, allowing a fresh review. A submitted transaction missing from both repeated status-history checks and confirmed transaction history is marked expired and unconfirmed; its signature remains visible for inspection. Neither recovery path rebroadcasts or reports an uncertain payout as confirmed.

Private API routes are under `/api/mail/pump/fees`: balance/history GET; `/review` POST; `/claims/:id/approve`, `/refresh`, and `/cancel` POST. Approve accepts only `reviewHash`. The account identity chooses the wallet; callers cannot select another creator, recipient, or transaction. Startup and `npm run db:setup` apply `backend/creator-fees-schema.sql`.

Simultaneous fee summary requests for the same owner share one chain read. Every request checks current account approval, and subsequent refreshes read fresh balances. Review and approval always obtain their own current chain snapshot. The shared launch RPC transport bounds concurrency, queue size, response bytes and deadlines; claim limits follow the approved account rather than a shared IP address.

Verification: `npm run mail:test` checks real SDK instruction layouts, retained-fee sweeping, ownership, cost/expiry/drift checks, signing concurrency, stored receipts, and network uncertainty. `node scripts/verify-creator-fees.cjs` checks the Vue desktop/mobile flow with fixtures. Fixtures do not prove a real accrued-fee claim.

Use [owner onchain acceptance](ONCHAIN-ACCEPTANCE.md) for exact live approval steps, payout accounting and the required saved finalized evidence.

Primary references: supplied `docs/instructions/COLLECT_CREATOR_FEE.md` and `SWEEP_FEES.md` from `/Users/8bit/Downloads/pump-public-docs-main`, [official creator-fee collection](https://github.com/pump-fun/pump-public-docs/blob/main/docs/instructions/COLLECT_CREATOR_FEE.md), [official retained-fee sweeps](https://github.com/pump-fun/pump-public-docs/blob/main/docs/instructions/SWEEP_FEES.md), and [Solana token account closure](https://solana.com/docs/tokens/basics/close-account). The implementation pins Pump SDK 4.0.0, PumpSwap SDK 2.1.0, and SPL Token 0.4.15.
