Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(pump): reconcile per-coin creator earnings against the coin timeline
nirholas98744d430df0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b34ace9cd..861755ca9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **A read-only drift report for every standalone GitHub mirror**: npm run mirrors:drift compares each of the ~105 standalone mirrors in data/standalone-mirrors.json against its monorepo source at the last synced commit (GitHub API, with a README-timestamp fallback when rate-limited), flags any package whose GitHub copy has diverged, and writes the result to tasks/mirror-drift-<date>.json. It never pushes or mutates a mirror; it is the audit step that found the two fixes above. (`/docs/contributing`) `[infra, docs]`- **Atomic is now a six-tab Transaction V1 lab, not just an inspector**: /atomic grew five tabs beyond the Inspector, each reachable by click, arrow-key/Home/End tab navigation, or a deep link (?tab=mask, ?tab=sponsor, ?tab=planner, ?tab=diff, ?tab=wallet). The config mask decoder reads a V1 transaction's real TransactionConfigMask u32 and its fixed-width ConfigValues byte by byte, flagging a half-set priority-fee pair or a reserved bit SIMD-0385 has not assigned yet. The sponsor cap view shows a paymaster exactly what it is agreeing to pay, reading V1's inline config instead of a Compute Budget instruction scan that sees nothing on a V1 transaction. The size and budget planner compiles a pasted instruction set with @solana/kit to an exact byte count against legacy, V0, or V1's ceiling, including an exact lamport total for a chosen priority fee. The legacy/V0/V1 diff compiles the same instructions three ways and reports the real byte deltas, honestly, including the case where V1's inline config makes it larger than legacy. The wallet V1 capability check connects the browser's injected wallet and reports the same verdict the rest of three.ws would get from findV1WalletStandardSigner before ever requesting a real V1 signature. Nothing here is estimated: every number comes from compiling and decoding real transactions, and nothing is ever signed, simulated, or broadcast. (`/atomic`) `[feature]`- **Atomic now replays a pump.fun transaction step by step**: Atomic (/atomic) decodes every Pump, PumpSwap, and PumpFees event in a transaction's logs, oldest first, and renders it as a Replay panel: a bonding-curve-position bar, a human-readable description of each step (create, buy/sell, graduation, creator-fee collection and distribution, GitHub social-fee claims, and post-graduation PumpSwap swaps), and the SOL/token amounts that moved. An event the installed SDK does not recognize still renders, labeled unrecognized, instead of silently disappearing. For a create transaction, the panel also pages through the earliest trades on that mint since launch, walking Solana's signature history backward in bounded pages since RPC has no forward cursor. `[feature]`+- **Creator earnings now cross-check two independent pump.fun sources**: A coin's earnings figure on /launches/<mint> and in the agent earnings card used to come from one source only: the creator wallet's lifetime fee index. It now also sums that specific coin's own pump.fun distribution timeline, the only feed that can say which coin actually paid a wallet, and shows both: 'this coin paid X SOL' next to the wallet-level figure, plus a plain sentence when the two sources disagree and by how much. Nothing is hidden when sources drift apart; the gap is the point. The snapshot pipeline that already indexed wallet-level fees now reconciles against the timeline for every coin on each refresh. (`/launches`) `[feature]`- **Deep links to a specific avatar now actually load that avatar**: @three-ws/walk's ?walk=play&avatar=<id> deep link and the drop-in resume path read the saved avatar preference straight out of storage and never looked at the query string, so sharing a link to a specific avatar silently loaded the stored (or default) one instead. A new deepLinkAvatarId resolver gives the query param precedence and persists it, the same way picking an avatar in the UI does. `[fix, sdk]`- **Every pump.fun launch now carries a plain-English receipt**: /launches/<mint> gained a Launch receipt panel composing five on-chain facts into one readable object: whether the mint or freeze authority can still act (with a plain sentence for each, not just enabled/disabled), supply and decimals, the top-10 holder share, where trading fees route (a creator wallet, a fee-sharing config, cashback, or holder rewards), the creation transaction's version and byte size, and the Trade Safety Firewall's verdict. A coin that never launched through pump.fun gets an honest 'not a pump.fun launch' instead of an error, and a source that fails marks only its own section unavailable, never an invented number. Copy the receipt as text or download it as JSON; both carry a SHA-256 content hash of the response so a saved copy can be checked against a fresh read. A shareable 1200x630 card is available via GET /api/pump/launch-og?mint=<mint>&variant=receipt, and the composition itself is a new public endpoint, GET /api/pump/launch-receipt?mint=<mint>. (`/launches`) `[feature]`- **GitHub fee-claim channel now attributes withdrawals to a coin, or says plainly it cannot**: A GitHub identity withdrawing pump.fun fees through the claim_social_fee_pda instruction only proves payment to that identity, not which coin paid it: one GitHub fee account can be a shareholder on more than one coin, and its address can be pasted into a copycat coin's metadata. The claims feed and its Telegram channel now classify every such withdrawal with on-chain evidence: a same-transaction distribution to the exact account, or a 90%-dominant distribution history since the previous claim, then a repository-owner or creator-wallet match, down to an honest unresolved or unverified label when nothing proves a coin. A new-GitHub-account-plus-copycat-coin pattern holds the claim for review instead of posting it with a celebratory card. `[feature, security]`diff --git a/api/_lib/agent-earnings.js b/api/_lib/agent-earnings.jsindex fc566626b..8fe97233a 100644--- a/api/_lib/agent-earnings.js+++ b/api/_lib/agent-earnings.js@@ -13,7 +13,12 @@// and no other agent's coin on file shares it. A coin whose// fees go to any other wallet (an owner's connected wallet, a// launch sponsor) is listed but not counted: that wallet's-// total can include coins launched anywhere.+// total can include coins launched anywhere. Each coin also+// carries a second, independent figure summed from that+// coin's own pump.fun distribution timeline+// (pump-creator-fees.js's fetchCoinEarnings), surfaced per+// coin as `distributed` with a `reconciliation` delta+// against the wallet-level figure.// service income x402 skill sales (agent_revenue_events, USDC net of the// platform fee) and hires by other agents (agent_hires,// completed). USDC is valued 1:1 in USD.@@ -86,6 +91,9 @@ export function earningsMethod(window) {`unclaimed is the creator vault balance read on-chain, claimed is earned minus unclaimed. ` +`pump.fun reports fees per creator wallet, so a wallet counts toward an agent only when it is ` +`that agent's own custodial wallet; coins paying any other wallet are listed but not counted. ` ++ `Each coin also carries a second, independent figure (distributed_sol) summed from that coin's own ` ++ `pump.fun distribution timeline, which is the only source that can say which coin actually paid a ` ++ `wallet; the gap between the two sources is shown as a reconciliation delta, never hidden. ` +`Service income is x402 skill sales (net, USDC) plus completed hires by other agents, valued 1:1 in USD, ` +`plus invoices paid on Solana mainnet, valued in USD when the payment was verified. ` +`Figures cover ${range}. SOL and USD are converted at one live SOL/USD price. Devnet coins are excluded.`@@ -300,7 +308,9 @@ export async function getAgentEarnings(agent, { window: rawWindow = 'all' } = {}sql`select pam.mint, pam.name, pam.symbol, pam.created_at,e.creator, e.earned_lamports::text, e.claimed_lamports::text, e.unclaimed_lamports::text,- e.wallet_coin_count, e.wallet_agent_count, e.source, e.error, e.refreshed_at, e.attempted_at+ e.wallet_coin_count, e.wallet_agent_count, e.source, e.error, e.refreshed_at, e.attempted_at,+ e.coin_earned_lamports::text, e.coin_distributions, e.coin_earnings_source,+ e.reconciliation_delta_lamports::text, e.reconciliation_pctfrom pump_agent_mints pamleft join agent_coin_earnings e on e.mint = pam.mint and e.network = pam.networkwhere pam.agent_id = ${agent.id} and pam.network = 'mainnet'@@ -367,6 +377,10 @@ function shapeCoin(c, agentWallet, price) {const reported = c.source === 'pumpfun_creator_fees' && c.earned_lamports != null;const counted = reported && c.creator === agentWallet && Number(c.wallet_agent_count) === 1;const earnedSol = reported ? lamportsToSol(c.earned_lamports) : null;+ const distributedSol = c.coin_earnings_source === 'timeline' && c.coin_earned_lamports != null+ ? lamportsToSol(c.coin_earned_lamports)+ : null;+ const deltaSol = c.reconciliation_delta_lamports != null ? lamportsToSol(c.reconciliation_delta_lamports) : null;return {mint: c.mint,name: c.name,@@ -382,6 +396,15 @@ function shapeCoin(c, agentWallet, price) {wallet_coin_count: c.wallet_coin_count ?? null,refreshed_at: c.refreshed_at || null,error: c.error || null,+ distributed: {+ sol: distributedSol,+ usd: price > 0 && distributedSol != null ? round(distributedSol * price, 2) : null,+ distributions: c.coin_distributions ?? null,+ },+ reconciliation: deltaSol == null ? null : {+ delta_sol: round(deltaSol, 9),+ delta_pct: c.reconciliation_pct == null ? null : round(Number(c.reconciliation_pct), 2),+ },};}diff --git a/api/_lib/creator-earnings-snapshot.js b/api/_lib/creator-earnings-snapshot.jsindex 95ab1539e..b5d745cec 100644--- a/api/_lib/creator-earnings-snapshot.js+++ b/api/_lib/creator-earnings-snapshot.js@@ -10,6 +10,14 @@// them. When pump.fun or the RPC cannot answer, a coin keeps its last good// figures (refreshed_at stays at the last success) and the failure is recorded// in `error`; a coin that never had a good read is stored as 'unavailable'.+//+// Each coin also gets a second, independent figure: coin_earned_lamports,+// summed straight off that coin's own distribution timeline+// (pump-creator-fees.js's fetchCoinEarnings), instead of the wallet-level+// earned_lamports above, which is one lifetime total smeared across every+// coin the same wallet created. reconciliation_delta_lamports is the gap+// between the sum of those per-coin figures and the wallet's claimed total;+// a nonzero delta is stored and shown, never hidden.import { sql } from './db.js';import { getConnection } from './pump.js';@@ -17,10 +25,13 @@ import {resolveCoinCreators,readCreatorFeeReport,fetchCreatorFeeBuckets,+ fetchCoinEarnings,+ fetchAllShares,} from './pump-creator-fees.js';const WSOL = 'So11111111111111111111111111111111111111112';const WALLET_CONCURRENCY = 4;+const COIN_CONCURRENCY = 4;/** @param {bigint | null | undefined} v */const big = (v) => (v == null ? null : v.toString());@@ -66,15 +77,21 @@ async function recordUnavailable(coin, { creator = null, walletCoins = 1, wallet`;}-async function recordReport(coin, { creator, walletCoins, walletAgents, report }) {+async function recordReport(coin, { creator, walletCoins, walletAgents, report, coinEarnings, reconciliation }) {await sql`insert into agent_coin_earnings(mint, network, agent_id, creator, earned_lamports, claimed_lamports, unclaimed_lamports,- wallet_coin_count, wallet_agent_count, source, error, refreshed_at, attempted_at)+ wallet_coin_count, wallet_agent_count, source, error,+ coin_earned_lamports, coin_distributions, coin_earnings_source,+ reconciliation_delta_lamports, reconciliation_pct, refreshed_at, attempted_at)values(${coin.mint}, 'mainnet', ${coin.agent_id}, ${creator},${big(report.earned_lamports)}, ${big(report.claimed_lamports)}, ${big(report.unclaimed_lamports)},- ${walletCoins}, ${walletAgents}, 'pumpfun_creator_fees', null, now(), now())+ ${walletCoins}, ${walletAgents}, 'pumpfun_creator_fees', null,+ ${coinEarnings ? big(coinEarnings.lamports) : null}, ${coinEarnings ? coinEarnings.distributions : null},+ ${coinEarnings ? 'timeline' : null},+ ${reconciliation ? big(reconciliation.delta_lamports) : null}, ${reconciliation ? reconciliation.delta_pct : null},+ now(), now())on conflict (mint, network) do update setagent_id = excluded.agent_id,creator = excluded.creator,@@ -85,6 +102,11 @@ async function recordReport(coin, { creator, walletCoins, walletAgents, report }wallet_agent_count = excluded.wallet_agent_count,source = excluded.source,error = null,+ coin_earned_lamports = coalesce(excluded.coin_earned_lamports, agent_coin_earnings.coin_earned_lamports),+ coin_distributions = coalesce(excluded.coin_distributions, agent_coin_earnings.coin_distributions),+ coin_earnings_source = coalesce(excluded.coin_earnings_source, agent_coin_earnings.coin_earnings_source),+ reconciliation_delta_lamports = coalesce(excluded.reconciliation_delta_lamports, agent_coin_earnings.reconciliation_delta_lamports),+ reconciliation_pct = coalesce(excluded.reconciliation_pct, agent_coin_earnings.reconciliation_pct),refreshed_at = now(),attempted_at = now()`;@@ -104,6 +126,33 @@ async function storeBuckets(creator, interval, buckets) {}}+/**+ * Each coin's own distribution-timeline earnings for `creator`, plus the+ * wallet-level reconciliation: the sum of those per-coin figures against the+ * wallet's claimed_lamports (a second, independent source for the same+ * number). `ok: false` entries (a sick or 404 timeline) are excluded from the+ * sum rather than treated as zero, so a transient failure cannot manufacture+ * a false mismatch.+ * @param {string} creator+ * @param {Array<{ mint: string }>} coins+ * @param {bigint | null} claimedLamports+ */+async function reconcileCoinEarnings(creator, coins, claimedLamports) {+ const results = await mapLimit(coins, COIN_CONCURRENCY, (coin) => fetchCoinEarnings(coin.mint, creator));+ const byMint = new Map(coins.map((coin, i) => [coin.mint, results[i]]));+ const anyOk = results.some((r) => r.ok);+ let reconciliation = null;+ if (anyOk && claimedLamports != null) {+ const distributed = results.reduce((sum, r) => (r.ok ? sum + r.value.lamports : sum), 0n);+ const delta = distributed - claimedLamports;+ reconciliation = {+ delta_lamports: delta,+ delta_pct: claimedLamports > 0n ? (Number(delta) / Number(claimedLamports)) * 100 : 0,+ };+ }+ return { byMint, reconciliation };+}+/*** Refresh one creator wallet: its fee report, its buckets, and every coin row* that shares it.@@ -122,23 +171,54 @@ async function refreshWallet(connection, creator, coins) {}return { creator, ok: false, error: report.error, coins: walletCoins };}+ // Per-coin reconciliation: a stronger source than the wallet-level total+ // above, which this same figure gets smeared across every coin of the+ // wallet. Best-effort: a failed timeline read keeps the wallet-level+ // figure for that coin rather than failing the whole wallet.+ const { byMint, reconciliation } = await reconcileCoinEarnings(creator, coins, report.claimed_lamports);for (const coin of coins) {- await recordReport(coin, { creator, walletCoins, walletAgents, report });+ const timeline = byMint.get(coin.mint);+ await recordReport(coin, {+ creator,+ walletCoins,+ walletAgents,+ report,+ coinEarnings: timeline?.ok ? timeline.value : null,+ reconciliation,+ });}if (days.ok) await storeBuckets(creator, '1d', days.value);if (halfHours.ok) await storeBuckets(creator, '30m', halfHours.value);++ // Cross-check: coins pump.fun's fee-sharing program says this wallet shares+ // with that our own registry does not have on file. Visibility only (the+ // registry is owned by the launcher, not this snapshot), so a coin launched+ // outside three.ws, or one the registry missed, is surfaced instead of+ // silently absent from this wallet's figures.+ const shares = await fetchAllShares(creator);+ let sharesGap = null;+ if (shares.ok) {+ const dbMints = new Set(coins.map((c) => c.mint));+ const missing = shares.value.items.map((s) => s.mint).filter((mint) => !dbMints.has(mint));+ if (missing.length || shares.value.truncated) {+ sharesGap = { missing_mints: missing, truncated: shares.value.truncated };+ }+ }+return {creator,ok: true,coins: walletCoins,earned_lamports: report.earned_lamports.toString(),buckets_ok: days.ok && halfHours.ok,+ reconciliation_delta_lamports: reconciliation ? reconciliation.delta_lamports.toString() : null,+ shares_gap: sharesGap,};}/*** One full snapshot pass over every mainnet coin.- * @returns {Promise<{ coins: number, wallets: number, refreshed: number, upstream_failed: number, skipped: Array<{ mint: string, reason: string }>, wallet_errors: Array<{ creator: string, error: string }> }>}+ * @returns {Promise<{ coins: number, wallets: number, refreshed: number, upstream_failed: number, skipped: Array<{ mint: string, reason: string }>, wallet_errors: Array<{ creator: string, error: string }>, reconciled: Array<{ creator: string, delta_lamports: string }>, shares_gaps: Array<{ creator: string, missing_mints: string[], truncated: boolean }> }>}*/export async function runCreatorEarningsSnapshot() {const coins = await sql`@@ -207,6 +287,13 @@ export async function runCreatorEarningsSnapshot() {const walletErrors = results.filter((r) => !r.ok).map((r) => ({ creator: r.creator, error: r.error }));const refreshed = results.filter((r) => r.ok).reduce((n, r) => n + r.coins, 0);const failedCoins = results.filter((r) => !r.ok).reduce((n, r) => n + r.coins, 0);+ const reconciled = results.filter((r) => r.ok && r.reconciliation_delta_lamports != null).map((r) => ({+ creator: r.creator,+ delta_lamports: r.reconciliation_delta_lamports,+ }));+ const sharesGaps = results+ .filter((r) => r.ok && r.shares_gap)+ .map((r) => ({ creator: r.creator, ...r.shares_gap }));return {coins: coins.length,wallets: byCreator.size,@@ -214,5 +301,7 @@ export async function runCreatorEarningsSnapshot() {upstream_failed: failedCoins,skipped,wallet_errors: walletErrors,+ reconciled,+ shares_gaps: sharesGaps,};}diff --git a/api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sql b/api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sqlnew file mode 100644index 000000000..e1e7ac274--- /dev/null+++ b/api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sql@@ -0,0 +1,37 @@+-- Per-coin reconciled creator earnings (work order 510-integrate-11): a second,+-- independent figure for agent_coin_earnings, summed from each coin's own+-- distribution timeline (swap-api /v1/coins/<mint>/timeline) rather than the+-- wallet-level creator-fee index that earned_lamports already carries.+-- Apply: node scripts/apply-migrations.mjs --apply --file 20261015090000_agent_coin_earnings_timeline.sql+-- Idempotent.+--+-- coin_earned_lamports this coin's own share of distribution events paid to+-- its creator wallet, summed straight off the mint's+-- timeline. Unlike earned_lamports (one wallet-level+-- total smeared across every coin that wallet created),+-- this is specific to the one coin.+-- coin_distributions how many distribution events contributed.+-- coin_earnings_source 'timeline' once the per-coin read has succeeded at+-- least once; null (the default) means only the+-- wallet-level figure has ever been read for this coin.+-- reconciliation_delta_lamports / reconciliation_pct+-- wallet-level: sum of coin_earned_lamports across every+-- coin of the creator wallet, minus that wallet's+-- claimed_lamports. Stored on every coin row of the+-- wallet, same pattern as the existing wallet-smeared+-- columns. A nonzero delta is surfaced, not hidden.++begin;++alter table agent_coin_earnings add column if not exists coin_earned_lamports bigint;+alter table agent_coin_earnings add column if not exists coin_distributions integer;+alter table agent_coin_earnings add column if not exists coin_earnings_source text;+alter table agent_coin_earnings add column if not exists reconciliation_delta_lamports bigint;+alter table agent_coin_earnings add column if not exists reconciliation_pct double precision;++alter table agent_coin_earnings drop constraint if exists agent_coin_earnings_coin_earnings_source_check;+alter table agent_coin_earnings+ add constraint agent_coin_earnings_coin_earnings_source_check+ check (coin_earnings_source is null or coin_earnings_source in ('timeline'));++commit;diff --git a/api/_lib/pump-creator-fees.js b/api/_lib/pump-creator-fees.jsindex 63ac9abd0..f9cccfcce 100644--- a/api/_lib/pump-creator-fees.js+++ b/api/_lib/pump-creator-fees.js@@ -30,6 +30,15 @@// a claim (which sweeps those buckets first) would collect now.// claimed earned minus unclaimed: every lamport the index says was// earned and the vault no longer holds was swept by a claim.+// coin-level the index above reports one lifetime total per wallet, so a+// wallet with several coins sees that same figure smeared+// across all of them. fetchCoinEarnings sums the `distribution`+// events on ONE coin's own timeline (swap-api+// /v1/coins/<mint>/timeline) addressed to the wallet, which is+// the only source that can tell which coin actually paid it.+// The creator-earnings snapshot stores this per-coin figure+// alongside the wallet-level one and the delta between them+// (reconciliation), rather than silently picking one.//// Every pump.fun call runs behind the shared 'pumpfun:creator-fees' circuit// breaker, so a sick upstream costs one timeout per instance, not one per read.@@ -150,6 +159,81 @@ export async function fetchCreatorFeeTotal(wallet) {return fallback.ok ? fallback : { ok: false, error: `${primary.error}; fallback: ${fallback.error}` };}+/**+ * Every coin pump.fun's fee-sharing program says shares fees with `wallet`+ * (swap-api /v1/fee-sharing/account/<wallet>/shares), paged at 100: a creator+ * with more coins than one page used to silently show only the first 20.+ * Used to cross-check that the creator-fee snapshot has not missed a coin.+ * @param {string} wallet+ * @param {{ maxPages?: number }} [opts]+ */+export async function fetchAllShares(wallet, { maxPages = 20 } = {}) {+ return guarded(async () => {+ const items = [];+ let cursor = null;+ for (let page = 0; page < maxPages; page++) {+ const url = new URL(`${PUMP_SWAP_BASE}/v1/fee-sharing/account/${encodeURIComponent(wallet)}/shares`);+ url.searchParams.set('limit', '100');+ if (cursor) url.searchParams.set('cursor', cursor);+ const r = await pumpFetchJson(url.toString(), { timeoutMs: TIMEOUT_MS });+ if (!r.ok) throw new Error(`pump.fun fee-sharing shares ${r.status}`);+ for (const it of r.body?.items || []) {+ if (it?.mint) items.push({ mint: it.mint, bps: typeof it.bps === 'number' ? it.bps : null, is_admin: !!it.isAdmin });+ }+ if (!r.body?.pagination?.hasMore) return { items, truncated: false };+ cursor = r.body.pagination.nextCursor;+ }+ return { items, truncated: true };+ });+}++/**+ * How much `wallet` actually earned from ONE coin: the sum of `distribution`+ * events addressed to it on that coin's own timeline (swap-api+ * /v1/coins/<mint>/timeline), paged at 100. This is the only per-coin figure+ * pump.fun exposes; /fees/creator reports one lifetime total per wallet, which+ * a wallet with several coins can only see smeared equally across all of them.+ * A mint with no timeline (never indexed) resolves to zero distributions, not+ * an error.+ * @param {string} mint+ * @param {string} wallet+ * @param {{ maxPages?: number }} [opts]+ */+export async function fetchCoinEarnings(mint, wallet, { maxPages = 30 } = {}) {+ return guarded(async () => {+ let cursor = null;+ let lamports = 0n;+ let distributions = 0;+ let firstAt = null;+ let lastAt = null;+ for (let page = 0; page < maxPages; page++) {+ const url = new URL(`${PUMP_SWAP_BASE}/v1/coins/${encodeURIComponent(mint)}/timeline`);+ url.searchParams.set('limit', '100');+ if (cursor) url.searchParams.set('cursor', cursor);+ const r = await pumpFetchJson(url.toString(), { timeoutMs: TIMEOUT_MS });+ if (!r.ok) {+ if (r.status === 404) break;+ throw new Error(`pump.fun coin timeline ${r.status}`);+ }+ for (const ev of r.body?.items || []) {+ if (ev?.eventType !== 'distribution') continue;+ for (const rec of ev.recipients || []) {+ if (rec?.address !== wallet) continue;+ const amount = toLamports(rec.amount);+ if (amount == null || amount <= 0n) continue;+ lamports += amount;+ distributions++;+ if (!firstAt || ev.timestamp < firstAt) firstAt = ev.timestamp;+ if (!lastAt || ev.timestamp > lastAt) lastAt = ev.timestamp;+ }+ }+ if (!r.body?.pagination?.hasMore) break;+ cursor = r.body.pagination.nextCursor;+ }+ return { mint, lamports, distributions, first_at: firstAt, last_at: lastAt };+ });+}+/*** Bucketed creator fees for one wallet, SOL leg only. pump.fun serves `1d`* buckets for the last 30 days and `30m` buckets for the last 7. It no longerdiff --git a/api/pump/launch-detail.js b/api/pump/launch-detail.jsindex b8575fd82..fa68c7eb4 100644--- a/api/pump/launch-detail.js+++ b/api/pump/launch-detail.js@@ -35,7 +35,7 @@ import { normalizeGatewayURL } from '../../src/ipfs.js';import { getTraderStats } from '../_lib/trader-stats.js';import { getConnection } from '../_lib/pump.js';import { solPriceUsd } from '../_lib/sol-price.js';-import { resolveCoinCreators, readCreatorFeeReport } from '../_lib/pump-creator-fees.js';+import { resolveCoinCreators, readCreatorFeeReport, fetchCoinEarnings } from '../_lib/pump-creator-fees.js';const MINT_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;const lamportsToSol = (v) => (v == null ? null : Number(BigInt(v)) / 1e9);@@ -62,18 +62,28 @@ function safeR2Url(key) {// circuit breaker and resolves the fee recipient on-chain.//// pump.fun indexes these fees per creator wallet: `wallet_coin_count` > 1 means-// the figure is shared by that many coins from the same wallet.+// the figure is shared by that many coins from the same wallet. `distributed`+// is this coin's OWN share, summed from its own distribution timeline (the+// only source that can say which coin actually paid the wallet); `reconciled`+// is the gap between that per-coin sum and the wallet-level claimed figure,+// surfaced rather than hidden.async function creatorFeesFor(mint, network, price) {if (network !== 'mainnet') return null;const toUsd = (sol) => (price > 0 && sol != null ? Math.round(sol * price * 100) / 100 : null);const [snap] = await sql`select creator, earned_lamports::text, claimed_lamports::text, unclaimed_lamports::text,- wallet_coin_count, source, refreshed_at+ wallet_coin_count, source, refreshed_at,+ coin_earned_lamports::text, coin_distributions, coin_earnings_source,+ reconciliation_delta_lamports::text, reconciliation_pctfrom agent_coin_earningswhere mint = ${mint} and network = 'mainnet'`;if (snap?.source === 'pumpfun_creator_fees' && snap.earned_lamports != null) {const earned = lamportsToSol(snap.earned_lamports);+ const distributedSol = snap.coin_earnings_source === 'timeline' && snap.coin_earned_lamports != null+ ? lamportsToSol(snap.coin_earned_lamports)+ : null;+ const deltaSol = snap.reconciliation_delta_lamports != null ? lamportsToSol(snap.reconciliation_delta_lamports) : null;return {creator: snap.creator,earned_sol: earned,@@ -83,15 +93,28 @@ async function creatorFeesFor(mint, network, price) {wallet_coin_count: snap.wallet_coin_count,refreshed_at: snap.refreshed_at,source: 'snapshot',+ distributed: {+ sol: distributedSol,+ usd: toUsd(distributedSol),+ distributions: snap.coin_distributions ?? null,+ },+ reconciliation: deltaSol == null ? null : {+ delta_sol: deltaSol,+ delta_pct: snap.reconciliation_pct == null ? null : Number(snap.reconciliation_pct),+ },};}const connection = getConnection({ network: 'mainnet' });const creators = await resolveCoinCreators(connection, [mint]).catch(() => null);const creator = creators?.get(mint)?.creator;if (!creator) return null;- const report = await readCreatorFeeReport(connection, creator, { mints: [mint] });+ const [report, timeline] = await Promise.all([+ readCreatorFeeReport(connection, creator, { mints: [mint] }),+ fetchCoinEarnings(mint, creator),+ ]);if (!report.ok) return null;const earned = Number(report.earned_lamports) / 1e9;+ const distributedSol = timeline.ok ? Number(timeline.value.lamports) / 1e9 : null;return {creator,earned_sol: earned,@@ -101,6 +124,12 @@ async function creatorFeesFor(mint, network, price) {wallet_coin_count: null,refreshed_at: new Date().toISOString(),source: 'live',+ distributed: {+ sol: distributedSol,+ usd: toUsd(distributedSol),+ distributions: timeline.ok ? timeline.value.distributions : null,+ },+ reconciliation: null,};}diff --git a/data/changelog.json b/data/changelog.jsonindex 5adee3f31..663fa853e 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security, desktop (desktop entries become the desktop app's release notes). `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-10-14",+ "title": "Creator earnings now cross-check two independent pump.fun sources",+ "summary": "A coin's earnings figure on /launches/<mint> and in the agent earnings card used to come from one source only: the creator wallet's lifetime fee index. It now also sums that specific coin's own pump.fun distribution timeline, the only feed that can say which coin actually paid a wallet, and shows both: 'this coin paid X SOL' next to the wallet-level figure, plus a plain sentence when the two sources disagree and by how much. Nothing is hidden when sources drift apart; the gap is the point. The snapshot pipeline that already indexed wallet-level fees now reconciles against the timeline for every coin on each refresh.",+ "tags": [+ "feature"+ ],+ "link": "/launches"+ },{"date": "2026-10-14","title": "Every pump.fun launch now carries a plain-English receipt",diff --git a/prompts/finish/510-integrate-11-per-coin-earnings-source.md b/prompts/finish/510-integrate-11-per-coin-earnings-source.mdindex b500319fb..ec593c299 100644--- a/prompts/finish/510-integrate-11-per-coin-earnings-source.md+++ b/prompts/finish/510-integrate-11-per-coin-earnings-source.md@@ -1,5 +1,7 @@# integrate 11: reconciled per-coin creator earnings from the coin timeline+**Evolve status (2026-10-14):** Everything except the production migration apply is done. `fetchCoinEarnings` and `fetchAllShares` are ported into `api/_lib/pump-creator-fees.js` behind the existing circuit breaker (no second client); `api/_lib/creator-earnings-snapshot.js` now reconciles each coin's timeline sum against the wallet-level claimed figure and stores the delta, percentage and source; `api/pump/launch-detail.js` and `api/_lib/agent-earnings.js` serve `distributed` and `reconciliation` alongside the existing wallet-level figures, falling back to a live timeline read when no snapshot row exists; `src/launch-detail.js` and `src/shared/agent-earnings-card.js` render "this coin paid X SOL" with a plain-English reconciliation sentence; `earningsMethod()` names both sources. `tests/pump-creator-fees.test.js` gained 8 new cases (timeline paging/summing, share paging/truncation, reconciliation arithmetic), all passing; a pre-existing, unrelated DDL gap in `tests/agent-earnings-board.test.js` (missing `agent_commerce_invoices` table, from an earlier unrelated commit) was fixed alongside the new columns so that suite's 10 tests pass too. The new migration (`api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sql`) is written and verified idempotent and syntactically valid via a throwaway PGlite run, and the full `launch-detail.js` handler was proven correct end to end against a PGlite database with both migrations applied and a seeded row, matching the exact JSON shape documented above. It cannot be applied to the real production database from this session (hard-denied), so a live curl against production still returns `creator_fees.distributed: null` until it lands; the query and render logic are verified correct via the PGlite and Playwright route-interception runs described above instead. UI verified at 375/768/1440 with zero console errors via Playwright. See [OWNER-ACTIONS row 63](_context/production-100-OWNER-ACTIONS.md) for the exact migration-apply command and a critical ordering note: the migration must land before this code deploys, or the combined old+new column SQL select throws and the pre-existing enrichment-degrades-to-null wrapper silently drops `economics.creator_fees` to `null` for every coin until it does. Leaving this file in place until that migration lands.+How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now; one gated step, named below.## Operating clause (binding)diff --git a/prompts/finish/_context/integrate-PROGRESS.md b/prompts/finish/_context/integrate-PROGRESS.mdindex dbd2c48a6..086c279b8 100644--- a/prompts/finish/_context/integrate-PROGRESS.md+++ b/prompts/finish/_context/integrate-PROGRESS.md@@ -473,3 +473,77 @@ and this receipt is an enhancement to it, not a new surface.Commits: `9b782dfee` (endpoint, extraction, panel, OG variant, tests, docs,changelog), plus this closing commit (PROGRESS log, order-file deletion).++## 2026-10-14: order 510-integrate-11 stopped on a gate (evolve)++Ported `fetchCoinEarnings` and `fetchAllShares` into `api/_lib/pump-creator-fees.js`+behind the existing circuit breaker (no second client). `fetchCoinEarnings(mint,+wallet)` pages `swap-api.pump.fun/v1/coins/<mint>/timeline`, sums `distribution`+events addressed to the wallet, and resolves to a healthy zero (not a failure) on+a 404 for a mint with no timeline yet. `fetchAllShares(wallet)` pages+`fee-sharing/account/<wallet>/shares` and marks its result `truncated` past+`maxPages`.++`api/_lib/creator-earnings-snapshot.js`'s refresh loop now reconciles each coin's+timeline sum against the wallet-level claimed figure from 015's existing+`readCreatorFeeReport`, storing the delta and its percentage of the claimed+figure (never hidden, never silently dropped) in five new+`agent_coin_earnings` columns added by+`api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sql`+(`coin_earned_lamports`, `coin_distributions`, `coin_earnings_source`,+`reconciliation_delta_lamports`, `reconciliation_pct`). The snapshot's own+return value now surfaces `reconciled` and `shares_gaps` summaries.++`api/pump/launch-detail.js`'s `creatorFeesFor()` and+`api/_lib/agent-earnings.js`'s `getAgentEarnings()` both serve a new+`distributed: {sol, usd, distributions}` object and a `reconciliation:+{delta_sol, delta_pct} | null` object alongside the existing wallet-level+fields, falling back to a live `fetchCoinEarnings` call (reconciliation+`null`, since no cheap wallet-level baseline exists live) when no snapshot row+exists yet for a mint. `earningsMethod()` now names both sources explicitly.+`src/launch-detail.js` adds a "This coin paid" metric to the economics grid+and a plain-English reconciliation sentence+("The two sources agree." / "The two sources differ by ... SOL (...%).") to+its existing creator-fees note; `src/shared/agent-earnings-card.js`'s coin row+appends the same two facts to its detail line.++Verified: `npx vitest run tests/pump-creator-fees.test.js` passes 14/14 (6 new+cases for `fetchCoinEarnings` paging/404-as-zero/non-404-failure and+`fetchAllShares` paging/truncation/failure, plus 2 pure-arithmetic+reconciliation cases), fixtures use the $THREE mint and a synthetic wallet.+`tests/agent-earnings-board.test.js` (10/10) required fixing a pre-existing,+unrelated DDL gap found while adding the new columns to its hand-rolled+fixture: an earlier commit (`7461c3ed0`) added an `agent_commerce_invoices`+query to `agent-earnings.js` without updating this test's schema, confirmed+by grepping failure output for the actual missing-relation error (zero+`coin_earned_lamports` mentions, twelve `agent_commerce_invoices does not+exist` ones) before fixing it alongside the new columns, not instead of+diagnosing it. The migration itself was proven idempotent and syntactically+correct via a throwaway PGlite script (applied twice without erroring,+rejects a bad `coin_earnings_source` value), and the full+`launch-detail.js` handler was proven to produce the exact documented JSON+shape end to end against a PGlite database with both migrations applied and+a seeded synthetic row. The UI was browser-verified with Playwright at+375/768/1440 with zero console errors, using `page.route()` to inject a+synthetic `economics.creator_fees.distributed`/`reconciliation` payload into+the real page's real API response, since production has no migrated data to+render yet; both throwaway scripts were deleted after use, nothing shipped.++What cannot finish from this session: the migration cannot be applied to the+real production database (hard-denied), so a live curl against production+still returns `creator_fees.distributed: null` (same graceful degrade as+before this order, not a new failure mode) until it lands. A real, direct+read against production surfaced a genuine ordering risk worth flagging:+`creatorFeesFor()` and `getAgentEarnings()`'s `coins` query both select old+and new columns in ONE statement, so if this commit deploys before the+migration applies, that select throws on every call and the pre-existing+`.catch(() => null)` wrapper around `creatorFeesFor()` silently degrades+`economics.creator_fees` to `null` for every coin, not just the new fields,+until the migration lands. See [OWNER-ACTIONS row+63](production-100-OWNER-ACTIONS.md) for the exact command and this same+ordering note. Leaving `510-integrate-11-per-coin-earnings-source.md` in+place with a dated Evolve status paragraph rather than deleting it.++Commits: this closing commit (ports, snapshot reconciliation, API, UI,+tests, migration, docs, changelog, owner-actions row, order-file+annotation, PROGRESS log).diff --git a/prompts/finish/_context/production-100-OWNER-ACTIONS.md b/prompts/finish/_context/production-100-OWNER-ACTIONS.mdindex 9557c575c..75244a3e0 100644--- a/prompts/finish/_context/production-100-OWNER-ACTIONS.md+++ b/prompts/finish/_context/production-100-OWNER-ACTIONS.md@@ -76,6 +76,7 @@ on it; some resolve themselves as other work lands.| 59 | **Push every staged standalone mirror** (added 2026-10-14 by the evolve loop closing out order 500-integrate-01). `npm run sync:repos` now stages a one-commit snapshot per mirror under `dist/standalone-mirrors/<repo>/` instead of force-pushing, reading `data/standalone-mirrors.json` as the single source of truth for which monorepo directory maps to which public repo (this also fixes the eleven mirrors already renamed on GitHub, so no duplicate repo gets created for them). It never calls `gh`, never pushes, and makes no network writes; the script's own output after staging is the exact push line for each mirror, in the form `git -C dist/standalone-mirrors/<repo> push --force https://github.com/nirholas/<repo>.git HEAD:main`. Run `npm run sync:repos` (optionally `-- --only <repo>` for a single mirror), review a staged tree if you want to, then run the printed push command for each mirror you want to publish. `npm run sync:repos:check` reports drift against each mirror's live tree without writing anything, useful to see which mirrors are stale before deciding which pushes to run. | one `npm run sync:repos` run plus N `git push --force` commands (one per mirror, printed by the tool) | Publishes the Apache-2.0 license-footer fix and the renamed-mirror corrections to every public GitHub mirror | [500-integrate-01-mirror-manifest.md](../500-integrate-01-mirror-manifest.md) (retired this session; see `_context/integrate-PROGRESS.md`), [data/standalone-mirrors.json](../../data/standalone-mirrors.json) || 60 | **Approve bumping `@nirholas/pump-sdk` from `^1.30.0` to `^1.36.0`** in `packages/avatar-agent-mcp/package.json` (added 2026-10-14 by the evolve loop closing out order 501-integrate-02). The `avatar-agent-mcp` GitHub mirror moved to this range on its own; `npm run mirrors:drift` flagged the drift. This names another project's SDK, so the commit gate applies: the edit is made and verified (`npm install`, `npm ls @nirholas/pump-sdk` → `1.36.0`, `npm test` → 26/26 green) but held staged, uncommitted, in the worktree rather than committed. The order's own text also named a "2.x move with holder-reward launches"; that claim is stale, the real current GitHub range is `^1.36.0` (still 1.x) and no holder-reward code exists in the mirror (checked, no match for `holder.reward`/`holder_reward`/`holderReward`). To approve: review the staged diff (`git diff packages/avatar-agent-mcp/package.json package-lock.json`), then `git add packages/avatar-agent-mcp/package.json package-lock.json && git commit`. | one `git add` + `git commit` | Keeps `packages/avatar-agent-mcp` on the pump-sdk range its own GitHub mirror and `npm test` already validate | [501-integrate-02-mirror-drift-report.md](../501-integrate-02-mirror-drift-report.md) (retired this session; see `_context/integrate-PROGRESS.md`) || 62 | **Deploy `services/pump-claims` (new Cloud Run service) and apply its migration** (added 2026-10-14 by the evolve loop closing out order 506-integrate-07). The service is a standalone real-time listener: it subscribes to PumpFees program logs, decodes and attributes every GitHub social-fee-PDA claim (`claim_social_fee_pda`), and writes it to a new `pump_fee_claims` table, so `api/_lib/pump-claims.js`'s claims feed can read a persisted real-time source instead of re-scanning RPC history on every request (it still falls back to the RPC scan whenever the table has nothing for the requested window). Built and verified this session: 21/21 `node --test` passing (decode, attribution, idempotent insert, reconnect/gap-fill, a 429-backoff helper for the free RPC lane), a Docker image built AND run (not just built) confirming every transitively-imported module resolves, a new transitive-import-aware vitest guard (`tests/pump-claims-worker-image.test.js`) so a future drift fails the build instead of crashing the container on boot, and the actual migration file applied and verified with the real `npm run db:migrate -- --apply --file 20261015080000_pump_fee_claims.sql` / `npm run db:check` tooling against a local throwaway Postgres (`scripts/use-local-neon.mjs`), never against production. Two things only the owner can do: (a) apply the migration to the real production database, exactly `npm run db:migrate -- --apply --file 20261015080000_pump_fee_claims.sql` (read `npm run db:status` first; this applies immediately, no dry run, and the shared worktree may have other agents' unrelated pending migrations queued, so review the full pending list before running); (b) deploy the service, exactly `gcloud builds submit --config services/pump-claims/cloudbuild.yaml .` from the repo root (pinned to the `three-ws-build@`/`three-ws@` service accounts, `--no-cpu-throttling --min-instances=1`, defaults `SOLANA_RPC_URL` to the free `api.mainnet-beta.solana.com` lane, one of only two lanes measured to serve `logsSubscribe`; see `docs/ops/solana-rpc-lanes.md`). After both land, run `node services/pump-claims/backfill.js --days=7` once (or let the live listener's cold-start gap-fill do it) so the table isn't empty on day one, then confirm with `select count(*) from pump_fee_claims;`. One real finding from this session worth knowing before that backfill runs: the PumpFees program is extremely busy overall (measured ~500 signatures/second across ALL its traffic, not just GitHub claims), so `backfill.js`'s `MAX_SIGNATURES_SCANNED` safety cap (20,000) will be reached within roughly the most recent minute of chain activity regardless of the `--days` flag; a true 7-day backfill of this specific claim type is not reachable by walking raw signature history on any RPC lane and would need a dedicated indexer if ever required, the live listener (real-time, no scan) is the real source of ongoing coverage. | one migration apply + one `gcloud builds submit` + one backfill run | Makes the claims feed's GitHub-attribution path real-time and self-hosted, ending its implicit dependence on RPC-scan freshness per request | [506-integrate-07-pump-claims-listener.md](../506-integrate-07-pump-claims-listener.md), [services/pump-claims/README.md](../../services/pump-claims/README.md) |+| 63 | **Apply the per-coin earnings timeline migration, and only then deploy** (added 2026-10-14 by the evolve loop closing out order 510-integrate-11). `api/_lib/pump-creator-fees.js` now sums each coin's own pump.fun distribution timeline (`fetchCoinEarnings`) alongside the existing wallet-level fee index, and `api/_lib/creator-earnings-snapshot.js` reconciles the two into five new `agent_coin_earnings` columns (`coin_earned_lamports`, `coin_distributions`, `coin_earnings_source`, `reconciliation_delta_lamports`, `reconciliation_pct`). The migration (`api/_lib/migrations/20261015090000_agent_coin_earnings_timeline.sql`) is written and verified idempotent and syntactically correct via a throwaway PGlite run, never against production. Exact apply command: `npm run db:migrate -- --apply --file 20261015090000_agent_coin_earnings_timeline.sql` (read `npm run db:status` first; this applies immediately with no dry run, and the shared worktree may have other agents' unrelated pending migrations queued, so review the full pending list before running). Critical ordering note: `api/pump/launch-detail.js`'s `creatorFeesFor()` and `api/_lib/agent-earnings.js`'s `getAgentEarnings()` both now select the new columns in the SAME query as the pre-existing ones, so if this commit's code reaches production before the migration lands, that combined select throws `column "coin_earned_lamports" does not exist` on every call; the pre-existing `.catch(() => null)` wrapper around `creatorFeesFor()` silently swallows it, degrading `economics.creator_fees` to `null` for every coin (not just the new fields) until the migration is applied. Apply the migration before (or as part of) the next deploy that includes this diff, not after. | one `npm run db:migrate -- --apply` run, timed before the next deploy | Restores and extends per-coin creator-earnings data (`economics.creator_fees`) with a second, independent, reconciled source instead of risking it going silently null | [510-integrate-11-per-coin-earnings-source.md](../510-integrate-11-per-coin-earnings-source.md) || 61 | **Push and archive 7 retired repos** (added 2026-10-14 by the evolve loop closing out order 503-integrate-04). `data/retired-repos.json` lists `three-ui`, `crypto-market-data`, `crypto-market-data-ts`, and `crypto-data-aggregator` (all superseded by the `/markets` page or `src/` in this monorepo), `memescope-monday-directory` (duplicate of `memescope-monday`), and one repo from each of the two Robinhood Chain duplicate pairs (`robinhood-chain-alert-bot`, duplicate of `robinhood-chain-alerts`; `robinhood-chain-trading-bot`, duplicate of `robinhood-chain-traders`). `npm run retire:repos` staged a one-commit pointer README under `dist/retired-repos/<repo>/` for each, explaining the retirement and linking to the replacement; it never calls `gh` and never pushes. To approve, run these 14 commands (7 pushes, 7 archives): `git -C dist/retired-repos/three-ui push --force https://github.com/nirholas/three-ui.git HEAD:main && gh repo archive nirholas/three-ui --yes`, `git -C dist/retired-repos/crypto-market-data push --force https://github.com/nirholas/crypto-market-data.git HEAD:main && gh repo archive nirholas/crypto-market-data --yes`, `git -C dist/retired-repos/crypto-market-data-ts push --force https://github.com/nirholas/crypto-market-data-ts.git HEAD:main && gh repo archive nirholas/crypto-market-data-ts --yes`, `git -C dist/retired-repos/crypto-data-aggregator push --force https://github.com/nirholas/crypto-data-aggregator.git HEAD:main && gh repo archive nirholas/crypto-data-aggregator --yes`, `git -C dist/retired-repos/memescope-monday-directory push --force https://github.com/nirholas/memescope-monday-directory.git HEAD:main && gh repo archive nirholas/memescope-monday-directory --yes`, `git -C dist/retired-repos/robinhood-chain-alert-bot push --force https://github.com/nirholas/robinhood-chain-alert-bot.git HEAD:main && gh repo archive nirholas/robinhood-chain-alert-bot --yes`, `git -C dist/retired-repos/robinhood-chain-trading-bot push --force https://github.com/nirholas/robinhood-chain-trading-bot.git HEAD:main && gh repo archive nirholas/robinhood-chain-trading-bot --yes`. `dist/` is gitignored, so re-run `npm run retire:repos` first if the staged trees were cleaned since this session. | 7 pushes + 7 archives | Removes 7 stale/duplicate public repos from the owner's GitHub without losing their history (each gets a pointer commit first) | [503-integrate-04-robinhood-copies-and-retired-repos.md](../503-integrate-04-robinhood-copies-and-retired-repos.md) (retired this session; see `_context/integrate-PROGRESS.md`) |Deleted 2026-09-01: the former row 5 (`WALLET_ENCRYPTION_KEY_PREVIOUS` policy), whichdiff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 8acd11b21..4c82ea727 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-10-14T18:13:33.933Z",+ "generated_at": "2026-10-14T18:52:48.773Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 4088,+ "total": 4089,"complete": false,"full_feed": "/changelog.json","entries": [@@ -40,6 +40,16 @@"feature"]},+ {+ "date": "2026-10-14",+ "type": "update",+ "title": "Creator earnings now cross-check two independent pump.fun sources",+ "summary": "A coin's earnings figure on /launches/<mint> and in the agent earnings card used to come from one source only: the creator wallet's lifetime fee index. It now also sums that specific coin's own pump.fun distribution timeline, the only feed that can say which coin actually paid a wallet, and shows both: 'this coin paid X SOL' next to the wallet-level figure, plus a plain sentence when the two sources disagree and by how much. Nothing is hidden when sources drift apart; the gap is the point. The snapshot pipeline that already indexed wallet-level fees now reconciles against the timeline for every coin on each refresh.",+ "link": "/launches",+ "tags": [+ "feature"+ ]+ },{"date": "2026-10-14","type": "update",@@ -1546,17 +1556,6 @@"tags": ["feature"]- },- {- "date": "2026-10-10",- "type": "update",- "title": "Approve or deny your agent's requests from Telegram and Discord",- "summary": "When your agent asks before a transfer or a trade, the request now lands in your paired Telegram or Discord chat with the full confirmation table (recipient, amount, asset, chain, risk notes and deadline) and Approve and Deny buttons. Each button is signed for that exact request, your chat and your account, so a changed request, an expired one, a copied button or someone else in a group chat can never trigger it, and pressing Approve twice runs the action once. The chat now also answers /approvals to list everything waiting, /positions for open positions and their live value, /pause to stop one agent and /kill to stop every agent and deny every pending request. A chat can stop your agents but never unfreeze them; that is done on the web. Forwarded messages are never treated as instructions.",- "link": "/approvals",- "tags": [- "feature",- "security"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 43bcc043f..28f796644 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-14T18:13:33.913Z",+ "generated_at": "2026-10-14T18:52:48.751Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -37,6 +37,16 @@"feature"]},+ {+ "date": "2026-10-14",+ "type": "update",+ "title": "Creator earnings now cross-check two independent pump.fun sources",+ "summary": "A coin's earnings figure on /launches/<mint> and in the agent earnings card used to come from one source only: the creator wallet's lifetime fee index. It now also sums that specific coin's own pump.fun distribution timeline, the only feed that can say which coin actually paid a wallet, and shows both: 'this coin paid X SOL' next to the wallet-level figure, plus a plain sentence when the two sources disagree and by how much. Nothing is hidden when sources drift apart; the gap is the point. The snapshot pipeline that already indexed wallet-level fees now reconciles against the timeline for every coin on each refresh.",+ "link": "/launches",+ "tags": [+ "feature"+ ]+ },{"date": "2026-10-14","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex e603d4ed1..4f43550f2 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -30,6 +30,14 @@<category>feature</category><description>Atomic (/atomic) decodes every Pump, PumpSwap, and PumpFees event in a transaction's logs, oldest first, and renders it as a Replay panel: a bonding-curve-position bar, a human-readable description of each step (create, buy/sell, graduation, creator-fee collection and distribution, GitHub social-fee claims, and post-graduation PumpSwap swaps), and the SOL/token amounts that moved. An event the installed SDK does not recognize still renders, labeled unrecognized, instead of silently disappearing. For a create transaction, the panel also pages through the earliest trades on that mint since launch, walking Solana's signature history backward in bounded pages since RPC has no forward cursor.</description></item>+ <item>+ <title>Creator earnings now cross-check two independent pump.fun sources</title>+ <link>https://three.ws/launches</link>+ <guid isPermaLink="false">2026-10-14:Creator earnings now cross-check two independent pump.fun sources</guid>+ <pubDate>Wed, 14 Oct 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A coin's earnings figure on /launches/<mint> and in the agent earnings card used to come from one source only: the creator wallet's lifetime fee index. It now also sums that specific coin's own pump.fun distribution timeline, the only feed that can say which coin actually paid a wallet, and shows both: 'this coin paid X SOL' next to the wallet-level figure, plus a plain sentence when the two sources disagree and by how much. Nothing is hidden when sources drift apart; the gap is the point. The snapshot pipeline that already indexed wallet-level fees now reconciles against the timeline for every coin on each refresh.</description>+ </item><item><title>Deep links to a specific avatar now actually load that avatar</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex b5dedb993..87926d71b 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-14T18:13:33.899Z",+ "generated_at": "2026-10-14T18:52:48.738Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/launch-detail.js b/src/launch-detail.jsindex d1fc2f9f5..73095ae62 100644--- a/src/launch-detail.js+++ b/src/launch-detail.js@@ -1254,6 +1254,13 @@ function renderEconomics() {hasCreatorFees && creatorFees.unclaimed_sol != null? metric('Unclaimed', fmtSol(Number(creatorFees.unclaimed_sol), { sign: false })): null,+ hasCreatorFees && creatorFees.distributed?.sol != null+ ? metric(+ 'This coin paid',+ fmtSol(Number(creatorFees.distributed.sol), { sign: false }),+ creatorFees.distributed.usd != null ? fmtUsd(Number(creatorFees.distributed.usd), { sign: false }) : null,+ )+ : null,]),]);if (hasCreatorFees) body.appendChild(creatorFeesNote(creatorFees));@@ -1302,6 +1309,17 @@ function creatorFeesNote(fees) {? `Creator fees from pump.fun, updated ${relTime(fees.refreshed_at)}.`: 'Creator fees from pump.fun.',);+ if (fees.distributed?.sol != null) {+ parts.push("\"This coin paid\" is summed straight from this coin's own pump.fun distribution timeline, independent of the wallet-level figures above.");+ }+ if (fees.reconciliation) {+ const delta = Number(fees.reconciliation.delta_sol);+ parts.push(+ Math.abs(delta) < 1e-6+ ? 'The two sources agree.'+ : `The two sources differ by ${fmtSol(delta, { sign: true })}${fees.reconciliation.delta_pct != null ? ` (${fees.reconciliation.delta_pct.toFixed(1)}%)` : ''}.`,+ );+ }const agent = state.detail.agent;return el('p', { class: 'ld-econ-note' }, [el('span', { text: parts.join(' ') + ' ' }),diff --git a/src/shared/agent-earnings-card.js b/src/shared/agent-earnings-card.jsindex 2aaaa128c..6643b311a 100644--- a/src/shared/agent-earnings-card.js+++ b/src/shared/agent-earnings-card.js@@ -135,6 +135,12 @@ function coinRow(c) {c.status === 'other_wallet'? `Fees go to ${esc(shortAddr(c.creator))}, not this agent's wallet${shared}`: `Unclaimed ${esc(fmtSol(c.unclaimed_sol))}${shared}`;+ if (c.distributed?.sol != null) {+ detail += ` · this coin paid ${esc(fmtSol(c.distributed.sol))}`;+ if (c.reconciliation && Math.abs(Number(c.reconciliation.delta_sol)) >= 1e-6) {+ detail += ` (${esc(fmtSol(Math.abs(Number(c.reconciliation.delta_sol))))} ${Number(c.reconciliation.delta_sol) > 0 ? 'more' : 'less'} than the wallet-level figure)`;+ }+ }value = `${esc(fmtSol(c.earned_sol))}${c.earned_usd != null ? `<small>${esc(fmtUsd(c.earned_usd))}</small>` : ''}`;}const pill = COIN_STATUS[c.status] ? `<span class="ern-pill">${COIN_STATUS[c.status]}</span>` : '';diff --git a/tests/agent-earnings-board.test.js b/tests/agent-earnings-board.test.jsindex c7f4c625b..d69753431 100644--- a/tests/agent-earnings-board.test.js+++ b/tests/agent-earnings-board.test.js@@ -54,6 +54,8 @@ const DDL = `mint text, network text, agent_id uuid, creator text, earned_lamports numeric,claimed_lamports numeric, unclaimed_lamports numeric, wallet_coin_count int, wallet_agent_count int,source text, error text, refreshed_at timestamptz default now(), attempted_at timestamptz default now(),+ coin_earned_lamports numeric, coin_distributions int, coin_earnings_source text,+ reconciliation_delta_lamports numeric, reconciliation_pct float8,primary key (mint, network));create table creator_fee_buckets (creator text, bucket_interval text, bucket_start timestamptz, fee_lamports numeric);@@ -65,6 +67,10 @@ const DDL = `id uuid primary key default gen_random_uuid(), provider_agent_id uuid, usd numeric, status text,created_at timestamptz, completed_at timestamptz);+ create table agent_commerce_invoices (+ id uuid primary key default gen_random_uuid(), agent_id uuid, status text, network text,+ paid_usd numeric, paid_at timestamptz+ );create table launcher_claims (agent_id uuid, network text, claim_sig text, claimed_lamports numeric, mint text,created_at timestamptz default now());create table agent_actions (agent_id uuid, type text, payload jsonb, created_at timestamptz default now());diff --git a/tests/pump-creator-fees.test.js b/tests/pump-creator-fees.test.jsindex e1dcf3b54..b98704603 100644--- a/tests/pump-creator-fees.test.js+++ b/tests/pump-creator-fees.test.js@@ -6,10 +6,13 @@import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';-const { fetchCreatorFeeTotal, fetchCreatorFeeBuckets } = await import('../api/_lib/pump-creator-fees.js');+const { fetchCreatorFeeTotal, fetchCreatorFeeBuckets, fetchCoinEarnings, fetchAllShares } = await import(+ '../api/_lib/pump-creator-fees.js'+);const { _resetBreakers } = await import('../api/_lib/resilience.js');const WALLET = 'THREEsynthetic11111111111111111111111111111';+const MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';const WSOL = 'So11111111111111111111111111111111111111112';const SOLANA = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp';const originalFetch = global.fetch;@@ -94,3 +97,123 @@ describe('fetchCreatorFeeBuckets', () => {expect(r.ok).toBe(false);});});++describe('fetchCoinEarnings', () => {+ it('sums distribution events addressed to the wallet across pages', async () => {+ global.fetch = vi.fn(async (url) => {+ expect(String(url)).toContain(`/v1/coins/${MINT}/timeline`);+ if (!String(url).includes('cursor=')) {+ return reply(200, {+ items: [+ {+ eventType: 'distribution',+ timestamp: '2026-10-01T00:00:00.000Z',+ recipients: [{ address: WALLET, amount: '1000000' }, { address: 'someoneElse', amount: '999' }],+ },+ { eventType: 'trade', timestamp: '2026-10-01T00:05:00.000Z' },+ ],+ pagination: { hasMore: true, nextCursor: 'page2' },+ });+ }+ return reply(200, {+ items: [+ {+ eventType: 'distribution',+ timestamp: '2026-10-02T00:00:00.000Z',+ recipients: [{ address: WALLET, amount: '500000' }],+ },+ ],+ pagination: { hasMore: false, nextCursor: null },+ });+ });+ const r = await fetchCoinEarnings(MINT, WALLET);+ expect(r).toEqual({+ ok: true,+ value: {+ mint: MINT,+ lamports: 1500000n,+ distributions: 2,+ first_at: '2026-10-01T00:00:00.000Z',+ last_at: '2026-10-02T00:00:00.000Z',+ },+ });+ });++ it('resolves to zero distributions, not a failure, for a mint with no timeline', async () => {+ global.fetch = vi.fn(async () => reply(404, { statusCode: 404 }));+ const r = await fetchCoinEarnings(MINT, WALLET);+ expect(r).toEqual({+ ok: true,+ value: { mint: MINT, lamports: 0n, distributions: 0, first_at: null, last_at: null },+ });+ });++ it('fails (not zero) on a non-404 upstream error', async () => {+ global.fetch = vi.fn(async () => reply(503, { statusCode: 503 }));+ const r = await fetchCoinEarnings(MINT, WALLET);+ expect(r.ok).toBe(false);+ });+});++describe('fetchAllShares', () => {+ it('pages through every coin a wallet shares fees with', async () => {+ global.fetch = vi.fn(async (url) => {+ expect(String(url)).toContain(`/v1/fee-sharing/account/${WALLET}/shares`);+ if (!String(url).includes('cursor=')) {+ return reply(200, {+ items: [{ mint: MINT, bps: 10000, isAdmin: true }],+ pagination: { hasMore: true, nextCursor: 'page2' },+ });+ }+ return reply(200, {+ items: [{ mint: 'THREEsynthetic2222222222222222222222222222' }],+ pagination: { hasMore: false, nextCursor: null },+ });+ });+ const r = await fetchAllShares(WALLET);+ expect(r).toEqual({+ ok: true,+ value: {+ truncated: false,+ items: [+ { mint: MINT, bps: 10000, is_admin: true },+ { mint: 'THREEsynthetic2222222222222222222222222222', bps: null, is_admin: false },+ ],+ },+ });+ });++ it('marks the result truncated when a wallet has more pages than maxPages allows', async () => {+ global.fetch = vi.fn(async () =>+ reply(200, { items: [{ mint: MINT }], pagination: { hasMore: true, nextCursor: 'next' } }),+ );+ const r = await fetchAllShares(WALLET, { maxPages: 2 });+ expect(r.ok).toBe(true);+ expect(r.value.truncated).toBe(true);+ expect(r.value.items).toHaveLength(2);+ });++ it('fails on a non-2xx response', async () => {+ global.fetch = vi.fn(async () => reply(500, {}));+ const r = await fetchAllShares(WALLET);+ expect(r.ok).toBe(false);+ });+});++describe('per-coin reconciliation', () => {+ it('a zero delta means the timeline sum and the wallet claimed figure agree', () => {+ const distributed = 1500000n;+ const claimed = 1500000n;+ const delta = distributed - claimed;+ expect(delta).toBe(0n);+ });++ it('a nonzero delta is surfaced as a percentage of the claimed figure, not hidden', () => {+ const distributed = 1800000n;+ const claimed = 1500000n;+ const delta = distributed - claimed;+ const deltaPct = (Number(delta) / Number(claimed)) * 100;+ expect(delta).toBe(300000n);+ expect(deltaPct).toBeCloseTo(20, 5);+ });+});