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
chore: jupiter/pyth swap refinements, payments + marketplace updates
nirholas563691ac2341
diff --git a/agent-payments-sdk/FORK_NOTES.md b/agent-payments-sdk/FORK_NOTES.mdindex 4d57d32d6..4c774ad96 100644--- a/agent-payments-sdk/FORK_NOTES.md+++ b/agent-payments-sdk/FORK_NOTES.md@@ -1,84 +1,121 @@-# Fork notes — `@pump-fun/agent-payments-sdk` (local 3.1.0)+# Fork notes — `agent-payments-sdk` (local, version 3.1.0)-This directory is a **deliberate three.ws fork** of `@pump-fun/agent-payments-sdk`,-not a stale copy. It is wired as a local npm workspace (listed in the root-`package.json` `workspaces`), so in-repo installs always resolve `^3.1.0` to this+This directory is a **deliberate, value-added three.ws fork** of pump.fun's+`@pump-fun/agent-payments-sdk`. It is the on-chain engine behind our **agent+tokens** product — the flow where a user launches a pump.fun token for their+agent ([api/pump/launch-agent.js](../api/pump/launch-agent.js)) and then charges+users who pay that agent in its token, with buyback and shareholder distribution+([api/agents/payments/[action].js](../api/agents/payments/[action].js)).++It is wired as a local npm workspace (its dir is in the root `package.json`+`workspaces`), so in-repo installs resolve `@pump-fun/agent-payments-sdk` to thissource and the published npm release is never fetched.-## Relationship to upstream+## TL;DR decision++**Keep the fork. Do NOT downgrade to the published release.** Our local copy is+materially *ahead* of upstream — it already implements the USDC-quote / token-2022+/ `buy_v2`/`sell_v2` migration that the published package lacks. Pinning to the+public version would *regress* live agent-token payments. The on-chain program is+pump.fun's; when they publish program changes we port them *into* this fork,+re-applying our patches — we never replace our copy with theirs.++The one thing that is *not* intentional is the **name/version squat** (we ship+under pump.fun's package name at a version that doesn't exist on npm). See+"Known issue" below.++## Evidence — local 3.1.0 vs published 3.0.3-| | Upstream npm `3.0.3` (`latest`) | This fork `3.1.0` |+Published `@pump-fun/agent-payments-sdk` tops out at **3.0.3** (`npm view … version`+→ `3.0.3`; there is no `3.1.0`). Comparison of `npm pack @pump-fun/[email protected]`+against this source:++| | Published `3.0.3` (`latest`) | This fork `3.1.0` ||---|---|---|| Author | Pump Fun | nirholas |-| Scope | Solana only | Solana **+ EVM + cross-chain** |-| Ship shape | single bundle (`dist/index.*`) | 7 export subpaths |+| Scope | Solana agent-payments only | Solana **+ EVM + cross-chain** |+| Ship shape | single bundle, 1 export (`.`) | 7 export subpaths || Runtime deps | 3 | 13 |-| Source | not published (`files: ["dist"]`) | full `src/` tree (~14.8k LOC) |--Upstream `3.0.3` exports a single Solana surface: `PumpAgent`, `PumpAgentOffline`,-the PDA helpers, account decoders, and the program constants/types for the agent-payments program (`AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7`). The published-package is restricted/private and ships only `dist`; there is no public upstream-source repo to diff against, so the Solana core here was **reverse-engineered**-from the published bundle (see `README.md`).--> Note: npm `latest` tops out at `3.0.3`. There is **no published `3.1.0`** — the-> `3.1.0` version number is ours and signals "upstream Solana core + three.ws-> extensions." This is intentional; do not "fix" the `^3.1.0` pin as if it were-> a broken/missing version.--## What we add on top of the upstream Solana core--Everything below is **net-new in this fork** and has no equivalent in upstream-`3.0.3`. All of it is consumed elsewhere in the repo (see "Consumers"):--- **EVM** (`./evm`) — `EvmAgent`, `EvmAgentOffline`, ABI, addresses, on-chain- events, invoice/quote/transaction builders, validation.-- **x402** — HTTP 402 payment protocol on both chains:- - `./x402` (EVM): client + facilitator.- - `./solana/x402`: client, facilitator, header codecs, types.-- **a2a** (`./a2a`) — agent-to-agent payment helpers.-- **Cross-chain** — `CrossChainPaymentClient` tying the Solana and EVM agents- together behind one client.-- **solana-agent-kit** (`./solana/solana-agent-kit`) — action adapters for the- solana-agent-kit runtime.-- **legacy-agent-payments** (`./solana/legacy-agent-payments`) — the prior- program variant, kept (with tests) for back-compat.-- **Event subscriptions** — `events.ts` / `pump-events.ts` WebSocket decoding and- live subscriptions over the Solana core.--## Why we keep it as a fork (not "track upstream")--Switching the dependency to the published `^3.0.3` would drop every extension-above — EVM, x402, a2a, cross-chain, solana-agent-kit, legacy — all of which are-imported by `api/` routes and skills today. There is no upstream artifact that-provides them, so "tracking upstream" is not a drop-in; it would be a feature-regression. The fork is the right call.--## Keeping the Solana core in sync with upstream--Because upstream ships no source, sync is a manual, periodic check of the-**Solana core only** (PumpAgent / PDAs / decoders / program constants):+| Source | not published (`files: ["dist"]`, minified) | full `src/` (~14.8k LOC) |+| Quote assets | SOL only | **SOL + USDC + token-2022** |+| Bonding-curve trades | none | `PumpTradeClient` (`buy_v2`/`sell_v2`/`buyExactQuoteIn`) |++Symbols present here and **absent from published 3.0.3** (verified by grepping the+3.0.3 bundle — all returned 0):++- Protocol v2 / new accounts: `buy_v2`, `sell_v2`, `buyExactQuoteIn`,+ `userVolumeAccumulator`, `fee_config`, `sharing_config`.+- USDC / token-2022: `USDC_MINT`, `decodeBondingCurveQuoteMint`,+ `resolveTokenProgramForMint`.+- Trading: `PumpTradeClient` and its `BuyQuote`/`SellQuote`/`ExactQuoteResult`,+ `CurrencyNotSupportedError`, `JupiterUnavailableError`.+- Fee routing: `pickFeeRecipient`, `pickBuybackFeeRecipient`.++What the **published 3.0.3 core does** provide (and we keep faithful to): the+agent-payments program (`AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7`) bindings —+`PumpAgent`/`PumpAgentOffline` (`create`, `acceptPayment`,+`buildAcceptPaymentInstructions`, `distributePayments`, `withdraw`,+`extendAccount`, `updateAuthority`, `updateBuybackBps`, `buybackTrigger`,+`getBalances`, `validateInvoicePayment`), the PDA helpers, decoders, and program+constants. Both share the same program IDs (`AgenTMiC2…`, pump `6EF8rrec…`) and+the same `PumpAgent` constructor `(mint, environment?, connection?)`, so our core+is binary-compatible with the deployed program; we have simply extended it.++These extensions are **woven into the core files** (e.g. USDC/token-2022 handling+lives inside `PumpAgentOffline.ts`; `types.ts` mixes upstream param types with our+`BuyQuote`/`SellQuote`). The fork is therefore *not* cleanly separable into+"upstream core + our add-ons" — another reason a drop-in swap to 3.0.3 is unsafe.++## Why not "track upstream" (and what we add)++Switching the dependency to published `^3.0.3` would drop every extension above —+USDC/token-2022 agent payments, the v2 trade client, plus EVM (`./evm`), x402 on+both chains (`./x402`, `./solana/x402`), a2a (`./a2a`), `CrossChainPaymentClient`,+solana-agent-kit actions, and the legacy program (`./solana/legacy-agent-payments`).+All are imported by `api/` routes and SDKs today. "Tracking upstream" is not a+drop-in; it is a feature *and* protocol regression.++## Keeping the core in sync with upstream++Upstream ships no source (only a minified bundle), so sync is a periodic manual+check of the **agent-payments core** — and a *forward port*, never a replace:```bash-# Is there a release newer than what we forked from?-npm view @pump-fun/agent-payments-sdk dist-tags version+# Newer release than 3.0.3?+npm view @pump-fun/agent-payments-sdk version-# Pull the published bundle and diff its public surface against ours.+# Diff the published public surface against ours.cd "$(mktemp -d)" && npm pack @pump-fun/agent-payments-sdk@latest \&& tar xzf *.tgz && grep -E '^export' package/dist/index.d.ts```-If upstream changes the program ID, PDA seeds, IDL, or account layouts, port those-into `src/solana/` (and `src/solana/idl/`) and re-run `npm run build`. Leave the-extensions untouched. Bump our local version (e.g. `3.1.1`) when we port a sync.+If pump.fun changes the program ID, PDA seeds, IDL, or account layouts, port those+into `src/solana/` (and `src/solana/idl/`), keep our USDC/token-2022/v2 patches on+top, re-run `npm run build`, and bump the local version. Leave the EVM/x402/a2a+layers untouched.++## Known issue — name/version squat (recommended follow-up)++We ship under **`@pump-fun/[email protected]`** — a scope we don't own and a+version that doesn't exist on npm. It resolves only because the workspace shadows+the registry. This is the one genuinely confusing part of the setup: a reader of+the manifest, or any fresh consumer outside the workspace, will be misled.++The clean long-term fix is to **rename this package to our own scope**+(`@three-ws/agent-payments`) and repoint *internal* consumers to it, while leaving+*external* skill templates (`pump-fun-skills/**`, which ship their own lockfiles)+on the real public `@pump-fun/agent-payments-sdk`. That rename is non-trivial — it+also touches the separately-published `publish/` bundle and the `src/` ↔+`publish/src/` duplication — so it is best done as its own focused pass, not folded+into this reconcile. Tracked as a follow-up.## Consumers (repo-wide, excluding the fork itself)-`api/pump/[action].js`, `api/_lib/pump.js`, `api/_lib/pump-swap-ix.js`,-`api/agents/payments/[action].js`, `api/agents/pumpfun/[action].js`,-`api/cron/[name].js`, `scripts/buyback-devnet-smoke.mjs`,-`pump-fun-skills/create-coin/`, `pump-fun-skills/tokenized-agents/`,-`solana-agent-sdk/`, plus `src/agent-skills-*.js`. All resolve via the workspace-symlink; `npm run build` here regenerates `dist/` (the root `postinstall`-rebuilds it on demand via `scripts/build-cache.mjs`).+Core (agent-payments program): `api/agents/payments/[action].js`,+`api/agents/pumpfun/[action].js`, `api/pump/[action].js`, `api/cron/[name].js`,+`api/_lib/pump-swap-ix.js`, `scripts/buyback-devnet-smoke.mjs`,+`pump-fun-skills/create-coin/`.+Extensions: `api/_lib/pump.js` (`PumpTradeClient`), `src/agent-skills-agent-payments.js`+(EVM), `solana-agent-sdk/` (x402 types). All resolve via the workspace symlink;+`npm run build` regenerates `dist/` (root `postinstall` rebuilds on demand via+`scripts/build-cache.mjs`).diff --git a/api/agents/[id]/skill-collection.js b/api/agents/[id]/skill-collection.jsdeleted file mode 100644index 8b1378917..000000000--- a/api/agents/[id]/skill-collection.js+++ /dev/null@@ -1 +0,0 @@-diff --git a/api/agents/payments/[action].js b/api/agents/payments/[action].jsindex eb2c88b6a..dad6780c7 100644--- a/api/agents/payments/[action].js+++ b/api/agents/payments/[action].js@@ -455,7 +455,7 @@ async function handleBalances(req, res) {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;const body = parse(balancesSchema, { ...req.query });const conn = solanaConnection({ url: rpcUrl(body.cluster), commitment: 'confirmed' });- const agent = new PumpAgent(new PublicKey(body.mint), conn);+ const agent = new PumpAgent(new PublicKey(body.mint), body.cluster, conn);const balances = await agent.getBalances(new PublicKey(body.currency_mint));return json(res, 200, {paymentVault: { address: balances.paymentVault.address.toBase58(), balance: balances.paymentVault.balance.toString() },diff --git a/api/demo-economy.js b/api/demo-economy.jsindex 19b86c3e2..340520ac7 100644--- a/api/demo-economy.js+++ b/api/demo-economy.js@@ -55,7 +55,7 @@ async function fetchMarketBriefing() {headline: 'Solana market briefing',pools: [{ name: 'SOL/USDC', price: '148.20', change24h: '+3.4%', vol24h: '$82M', up: true },- { name: 'JUP/SOL', price: '0.9812', change24h: '-1.2%', vol24h: '$14M', up: false },+ { name: 'THREE/SOL', price: '0.00042', change24h: '+5.1%', vol24h: '$9M', up: true },],fetchedAt: new Date().toISOString(),};diff --git a/api/wk.js b/api/wk.jsindex c9139bd64..b37696f00 100644--- a/api/wk.js+++ b/api/wk.js@@ -609,7 +609,7 @@ function handleX402Discovery(req, res) {extensions: extensionsForAccepts(mintToMeshAccepts, {method: 'GET',discoverable: true,- input: { mint: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263' },+ input: { mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' },inputSchema: {type: 'object',required: ['mint'],diff --git a/api/x402/mint-to-mesh.js b/api/x402/mint-to-mesh.jsindex 5b781824e..fe04efb7d 100644--- a/api/x402/mint-to-mesh.js+++ b/api/x402/mint-to-mesh.js@@ -63,7 +63,7 @@ const ROUTE_DESCRIPTION ='previews). Pay-per-call in USDC on Base mainnet.';const DISCOVERY_INPUT_EXAMPLE = {- mint: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263',+ mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump',};const DISCOVERY_INPUT_SCHEMA = {@@ -81,13 +81,12 @@ const DISCOVERY_INPUT_SCHEMA = {};const DISCOVERY_OUTPUT_EXAMPLE = {- mint: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263',+ mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump',theme: {- name: 'Bonk',- symbol: 'Bonk',+ name: 'three',+ symbol: 'THREE',color: [0.92, 0.45, 0.18],- imageUrl: 'https://arweave.net/hQiPZOsRZXGXBJd_82PhVdlM_hACsT_q6wqwf5cSY7I',- hasImage: true,+ hasImage: false,},glb: {mimeType: 'model/gltf-binary',diff --git a/src/agent-skills-jupiter.js b/src/agent-skills-jupiter.jsindex fafc4a46b..c70615e8a 100644--- a/src/agent-skills-jupiter.js+++ b/src/agent-skills-jupiter.js@@ -2,7 +2,7 @@* Jupiter Swap + Pyth Oracle skills* ----------------------------------* Jupiter: quote-only and full swap for any Solana SPL token pair.- * Pyth: live USD prices for SOL, BTC, ETH, USDC, BONK, WIF, JUP, PYTH.+ * Pyth: live USD prices for SOL, BTC, ETH, USDC.** Skills registered:* jupiter-quote — read-only quote, no signing@@ -65,7 +65,7 @@ export function registerJupiterSkills(skills) {properties: {symbolIn: {type: 'string',- description: 'Input token symbol (SOL, USDC, BONK, …) or raw mint address',+ description: 'Input token symbol (SOL, USDC, …) or raw mint address',},symbolOut: {type: 'string',@@ -192,7 +192,7 @@ export function registerJupiterSkills(skills) {type: 'object',required: ['symbol'],properties: {- symbol: { type: 'string', description: 'Token symbol to look up (e.g. BONK, WIF)' },+ symbol: { type: 'string', description: 'Token symbol to look up (e.g. SOL, USDC)' },},},handler: async (args, _ctx) => {diff --git a/src/kol/radar-fixture.json b/src/kol/radar-fixture.jsonindex 3cf6dba9c..050c5c4c9 100644--- a/src/kol/radar-fixture.json+++ b/src/kol/radar-fixture.json@@ -56,7 +56,7 @@"ts": 1714301000000},{- "mint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",+ "mint": "THREEsynthetic1111111111111111111111111111","name": "SpikeKing","symbol": "SPKNG","signalType": "volume-spike",diff --git a/src/kol/wallets.json b/src/kol/wallets.jsonindex 7a80be928..1d699e333 100644--- a/src/kol/wallets.json+++ b/src/kol/wallets.json@@ -14,7 +14,7 @@"winRate": 0.62},{- "wallet": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",+ "wallet": "THREEsynthetic2222222222222222222222222222","source": "gmgn","pnlUsd": 3200,"winRate": 0.55diff --git a/src/marketplace.js b/src/marketplace.jsindex 7c9ca1334..f31a4b2dc 100644--- a/src/marketplace.js+++ b/src/marketplace.js@@ -5610,7 +5610,6 @@ function closePaymentModal() {function shortMintLabel(mint) {if (mint === 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v') return 'USDC';- if (mint === 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') return 'USDT';return mint.slice(0, 4) + '…';}diff --git a/src/shared/skill-purchase.js b/src/shared/skill-purchase.jsindex 787d01a89..f4127c0c5 100644--- a/src/shared/skill-purchase.js+++ b/src/shared/skill-purchase.js@@ -115,7 +115,6 @@ export function formatAssetPrice(price) {export function shortMintLabel(mint) {if (mint === USDC_MAINNET_MINT) return 'USDC';- if (mint === 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') return 'USDT';return (mint || '').slice(0, 4) + '…';}diff --git a/src/solana/jupiter-swap.js b/src/solana/jupiter-swap.jsindex 88d8713b4..b0f9a4d48 100644--- a/src/solana/jupiter-swap.js+++ b/src/solana/jupiter-swap.js@@ -135,7 +135,7 @@ export async function getJupiterTopTokens() {}/**- * Resolve a token symbol (e.g. "BONK") to its mint address.+ * Resolve a token symbol (e.g. "SOL") to its mint address.* Returns null if not found.* @param {string} symbol* @returns {Promise<string|null>}diff --git a/src/solana/pyth-price.js b/src/solana/pyth-price.jsindex 6224fe2fe..ff49c5dbf 100644--- a/src/solana/pyth-price.js+++ b/src/solana/pyth-price.js@@ -9,16 +9,15 @@ import { HermesClient } from '@pythnetwork/hermes-client';const HERMES_URL = 'https://hermes.pyth.network';-// Curated feed IDs for tokens commonly used in this platform+// Reference price-feed IDs for the major assets used as pricing/settlement+// context (native SOL, BTC/ETH market references, USDC stable). We never list+// other project tokens or memecoins here — the only coin this platform promotes+// is $THREE. Callers can still resolve any Pyth feed id directly if needed.export const PRICE_FEED_IDS = {SOL: 'ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',BTC: 'e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',ETH: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',USDC: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',- BONK: '72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419',- WIF: '4ca4beeca86f0d164160323817a4e42b10010a724c2217c6ee41b54cd4cc61fc',- JUP: '0a0408d619e9380abad35060f9192039ed5042fa6f82301d0e48bb52be830996',- PYTH: '0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff',};let _client = null;diff --git a/src/swap-jupiter.js b/src/swap-jupiter.jsindex 9cd29d074..623bf6962 100644--- a/src/swap-jupiter.js+++ b/src/swap-jupiter.js@@ -20,22 +20,22 @@ import {} from '@solana/web3.js';import { log } from './shared/log.js';-// Solana mint constants used as built-in defaults / quick picks.+// Solana mint constants used as built-in defaults / quick picks. SOL and USDC+// are coin-agnostic settlement / quote assets (the default swap pair); $THREE is+// the one and only project token. No other coin is ever surfaced here.const SOL_MINT = 'So11111111111111111111111111111111111111112';const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';+const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';-// Curated quick-pick list. Token picker also accepts any mint via paste.-// Decimals + symbols are baked in so the modal still works if Jupiter's-// /tokens endpoint is rate-limited or offline.+// Curated quick-pick list — SOL/USDC quote assets plus $THREE. The token picker+// also accepts ANY mint via paste, so swapping other tokens still works; we just+// never promote a coin other than $THREE as a built-in tile. Decimals + symbols+// are baked in so the modal still works if Jupiter's /tokens endpoint is+// rate-limited or offline.const QUICK_TOKENS = [- { symbol: 'SOL', name: 'Solana', mint: SOL_MINT, decimals: 9, logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png' },- { symbol: 'USDC', name: 'USD Coin', mint: USDC_MINT, decimals: 6, logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png' },- { symbol: 'USDT', name: 'USDT', mint: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', decimals: 6, logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB/logo.svg' },- { symbol: 'BONK', name: 'Bonk', mint: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263', decimals: 5, logoURI: 'https://arweave.net/hQiPZOsRZXGXBJd_82PhVdlM_hACsT_q6wqwf5cSY7I' },- { symbol: 'JUP', name: 'Jupiter', mint: 'JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN', decimals: 6, logoURI: 'https://static.jup.ag/jup/icon.png' },- { symbol: 'WIF', name: 'dogwifhat', mint: 'EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm', decimals: 6, logoURI: 'https://bafkreibk3covs5ltyqxa272uodhculbr6kea6betidfwy3ajsav2vjzyum.ipfs.nftstorage.link' },- { symbol: 'PYTH', name: 'Pyth Network', mint: 'HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3', decimals: 6, logoURI: 'https://pyth.network/token.svg' },- { symbol: 'JTO', name: 'Jito', mint: 'jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL', decimals: 9, logoURI: 'https://metadata.jito.network/token/jto/image' },+ { symbol: 'SOL', name: 'Solana', mint: SOL_MINT, decimals: 9, logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png' },+ { symbol: 'USDC', name: 'USD Coin', mint: USDC_MINT, decimals: 6, logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png' },+ { symbol: 'THREE', name: 'three', mint: THREE_MINT, decimals: 6, logoURI: '' },];const SOLANA_MINT_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;diff --git a/src/widgets/pumpfun-feed.js b/src/widgets/pumpfun-feed.jsindex 226f6ef71..d4112e417 100644--- a/src/widgets/pumpfun-feed.js+++ b/src/widgets/pumpfun-feed.js@@ -466,7 +466,7 @@ function renderGraduation(ev) {['AXI', `https://axiom.trade/meme/${mint}`],['GMG', `https://gmgn.ai/sol/token/${mint}`],['PDR', `https://trade.padre.gg/trade/solana/${mint}`],- ['PHO', `https://photon-sol.tinyastro.io/en/r/@bonk/${mint}`],+ ['PHO', `https://photon-sol.tinyastro.io/en/lp/${mint}`],['BLX', `https://bullx.io/terminal?chainId=1399811149&address=${mint}`],].map(([l, u]) => `<a href="${attrEsc(u)}" target="_blank" rel="noopener" style="color:#888888">${l}</a>`).join('⋅'): '';diff --git a/tasks/week-2026-06-08/B1-coin-purity-sweep.md b/tasks/week-2026-06-08/B1-coin-purity-sweep.mddeleted file mode 100644index 726c9398b..000000000--- a/tasks/week-2026-06-08/B1-coin-purity-sweep.md+++ /dev/null@@ -1,107 +0,0 @@-# B1 — Coin-purity sweep: purge every non-$THREE token reference--**Track:** B — complete feature · **Priority:** P0 (non-negotiable rule) · **Effort:** 2–3h · **Depends on:** none--## Context--[CLAUDE.md](../../CLAUDE.md) is absolute: **the only coin/token the platform may ever name,-display, link, or promote is `$THREE`** (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`). No-BONK, JUP, WIF, USDT, PYTH, JTO, or any other token — anywhere in shipped UI, examples, fixtures,-or docs. Treat any other coin reference like a leaked secret: remove it.--**The one allowed exception (do not "fix" these):** generic, coin-agnostic **settlement/quote**-plumbing where **USDC** or **wrapped SOL (wSOL)** is the settlement currency (x402 pays in USDC;-swaps quote against SOL/USDC). USDC/wSOL used purely as a settlement or quote asset is fine. USDT-is **not** in this exception. A token presented as a *selectable tile / example coin / promoted-symbol* is **never** fine, even USDC.--This sweep was already audited file-by-file. The exact edits are below. Apply them, then run your-own ripgrep pass to catch anything new.--## Edits to apply (verified)--| # | File:line | Current | Change to |-|---|-----------|---------|-----------|-| 1 | `src/swap-jupiter.js:30-39` | `QUICK_TOKENS` tiles incl. USDT, BONK, JUP, WIF, PYTH, JTO | Reduce to **SOL, USDC, THREE** only (array below). Custom mints still work via paste. |-| 2 | `api/x402/mint-to-mesh.js:66` | `DISCOVERY_INPUT_EXAMPLE = { mint: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263' }` (Bonk) | `{ mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' }` |-| 3 | `api/x402/mint-to-mesh.js:84-90` | `DISCOVERY_OUTPUT_EXAMPLE`: Bonk mint, `name:'Bonk'`, `symbol:'Bonk'`, Bonk arweave `imageUrl` | $THREE mint, `name:'three'`, `symbol:'THREE'`; drop the Bonk `imageUrl` (set `hasImage:false` or a $THREE asset URL). Keep illustrative `color`/`bytes`. |-| 4 | `api/wk.js:612` | `input: { mint: 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263' }` (Bonk) | `input: { mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' }` |-| 5 | `src/marketplace.js:5613` | `if (mint === 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') return 'USDT';` | **Delete this line.** Keep the `USDC` branch above it; unknown mints already fall through to a short-mint label. |-| 6 | `src/shared/skill-purchase.js:118` | `if (mint === 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') return 'USDT';` | **Delete this line.** Keep the `USDC` branch above it. |-| 7 | `src/solana/pyth-price.js:18-19` | `BONK: '72b0...'`, `WIF: '4ca4...'` in `PRICE_FEED_IDS` | **Remove the BONK and WIF entries.** Keep SOL/BTC/ETH/USDC. (This list is exposed via the live `pyth-price` agent skill.) |-| 8 | `src/agent-skills-jupiter.js:5` | Header comment: `...SOL, BTC, ETH, USDC, BONK, WIF, JUP, PYTH.` | `...SOL, BTC, ETH, USDC.` |-| 9 | `src/agent-skills-jupiter.js:68` | `description: 'Input token symbol (SOL, USDC, BONK, …) or raw mint address'` | `description: 'Input token symbol (SOL, USDC, …) or raw mint address'` |-| 10 | `src/agent-skills-jupiter.js:195` | `description: 'Token symbol to look up (e.g. BONK, WIF)'` | `description: 'Token symbol to look up (e.g. SOL, USDC)'` |-| 11 | `api/demo-economy.js:58` | Fallback pool row `{ name: 'JUP/SOL', ... }` | Replace with `{ name: 'THREE/SOL', ... }` (or drop to a single `SOL/USDC` row). Keep the existing `SOL/USDC` row. |-| 12 | `src/widgets/pumpfun-feed.js:469` | Photon link uses referral handle `@bonk`: `https://photon-sol.tinyastro.io/en/r/@bonk/${mint}` | Use the project's own Photon referral code (e.g. `/r/three.ws/`), or drop the PHO link. No literal `bonk` in shipped links. |-| 13 | `src/kol/wallets.json:17` | `"wallet": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"` (Bonk mint posing as a wallet; **served at runtime** by `api/kol/[action].js`) | Replace with a synthetic placeholder, e.g. `"THREEsynthetic2222222222222222222222222222"`. |-| 14 | `src/kol/radar-fixture.json:58-61` | `"mint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"` (real USDT mint; **imported at runtime** by `src/kol/radar.js`) | Replace the mint with a synthetic placeholder, e.g. `"THREEsynthetic1111111111111111111111111111"`. Keep the fake name/symbol. |--### Exact replacement for `QUICK_TOKENS` (#1)--```js-const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';--const QUICK_TOKENS = [- { symbol: 'SOL', name: 'Solana', mint: SOL_MINT, decimals: 9, logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png' },- { symbol: 'USDC', name: 'USD Coin', mint: USDC_MINT, decimals: 6, logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png' },- { symbol: 'THREE', name: 'three', mint: THREE_MINT, decimals: 6, logoURI: '' },-];-```--`QUICK_TOKENS[0]`/`[1]` are still referenced as `defaultInputMint`/`defaultOutputMint` (around-`src/swap-jupiter.js:804-806`), so SOL→USDC remains the default pair — preserved. **Verify $THREE-decimals on-chain before applying** (pump.fun mints are typically 6); the modal also reads decimals-via the custom-mint path if needed.--## Do NOT flag these (verified allowed)--- `src/swap-jupiter.js:24-25` `SOL_MINT` / `USDC_MINT` constants (settlement/quote defaults).-- `api/x402/mint-to-mesh.js:167,181` `'USD Coin'`/`'USDC'` in `buildRequirements` (x402 settlement).-- `src/shared/skill-purchase.js:117` / `src/marketplace.js:5612` USDC branches (settlement asset).-- `src/game/ambient-crowd.js` `pepe`/`gigachad` (NPC usernames, not tokens).-- `public/three.svg` base64 substring matches (false positives).-- `public/chat/assets/*` build artifacts (gitignored; regenerated — fixing #2/#4 clears them).--## Then: your own sweep--After applying the table, run a fresh pass to catch anything missed or newly added:--```-rg -n -i '\b(bonk|wif|jup|pyth|jto|pepe|popcat|mew|bome|usdt|tether)\b' src api public workers \- --glob '!*.test.js' --glob '!node_modules' --glob '!dist*' --glob '!*.map'-```--Judge each hit against the rule + the allowed exception. Fix real violations; leave settlement-plumbing. Low-priority cleanup (optional, do if quick): swap `bonk`/`doge`/`BONK` example strings in-JSDoc/comments at `api/x402/crypto-intel.js:36`, `api/pump/search.js:1`, `src/solana/jupiter-swap.js:138`-for `sol`/`three`.--## Acceptance criteria--- [ ] All 14 edits applied exactly (or with a documented, justified deviation).-- [ ] No selectable token tile, example coin, price-feed symbol, fixture mint, or referral handle- references any token other than $THREE (USDC/wSOL settlement plumbing excepted).-- [ ] The two runtime-served fixtures (`src/kol/wallets.json`, `src/kol/radar-fixture.json`) contain- no real third-party mainnet mints.-- [ ] Your fresh ripgrep pass returns only allowed settlement references or false positives.-- [ ] Swap modal still functions (SOL/USDC default pair intact; custom mint paste still works).--## Verification--1. `npx vitest run` (the swap + bonding-curve + skill-purchase tests must still pass).-2. `npm run dev`; open the swap modal — confirm only SOL/USDC/THREE tiles, custom paste works.-3. Re-run the ripgrep sweep; confirm a clean result.--## Rules--This is the platform's most important rule. When in doubt, remove rather than keep. Obey-[CLAUDE.md](../../CLAUDE.md).--## Completion protocol--1. Re-read your diff (`git diff`) and confirm every line is justified.-2. Delete this file: `tasks/week-2026-06-08/B1-coin-purity-sweep.md`.-3. Commit your changes **and** this file's deletion together, e.g.:- `git add -A && git commit -m "fix: purge all non-$THREE token references (tiles, examples, fixtures, feeds); close B1"`-4. Do **not** push — the human controls pushes.diff --git a/tests/api/pump-curve.test.js b/tests/api/pump-curve.test.jsindex 2251ba772..b0a4f5ad9 100644--- a/tests/api/pump-curve.test.js+++ b/tests/api/pump-curve.test.js@@ -39,6 +39,9 @@ import curveHandler from '../../api/pump/curve.js';import quoteSdkHandler from '../../api/pump/quote-sdk.js';const VALID_MINT = 'So11111111111111111111111111111111111111112';+// A pump.fun mint (vanity-ground to end in "pump") — required to pass curve.js's+// non-pump short-circuit and reach the (mocked) RPC layer. Uses the $THREE mint.+const CURVE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';function makeReq({ url = '/', method = 'GET', headers = {} } = {}) {return { url, method, headers };@@ -72,12 +75,23 @@ describe('GET /api/pump/curve', () => {expect(res.statusCode).toBe(400);});- it('404 when no bonding curve found', async () => {+ it('404 not_a_pump_mint for a non-pump mint, without touching RPC', async () => {+ const res = makeRes();+ await curveHandler(makeReq({ url: `/api/pump/curve?mint=${VALID_MINT}` }), res);+ expect(res.statusCode).toBe(404);+ expect(getJson(res).error).toBe('not_a_pump_mint');+ // Short-circuit must happen before any bonding-curve RPC read.+ expect(getBondingCurveState).not.toHaveBeenCalled();+ // Negative-cacheable so repeat probes are served from the edge.+ expect(res.getHeader('cache-control')).toMatch(/s-maxage=300/);+ });++ it('404 when no bonding curve found for a real pump mint', async () => {getBondingCurveState.mockResolvedValueOnce(null);getTokenPrice.mockResolvedValueOnce(null);getGraduationProgress.mockResolvedValueOnce(null);const res = makeRes();- await curveHandler(makeReq({ url: `/api/pump/curve?mint=${VALID_MINT}` }), res);+ await curveHandler(makeReq({ url: `/api/pump/curve?mint=${CURVE_MINT}` }), res);expect(res.statusCode).toBe(404);expect(getJson(res).error).toBe('no_curve');});@@ -92,10 +106,10 @@ describe('GET /api/pump/curve', () => {getTokenPrice.mockResolvedValueOnce({ priceSol: '0.0001', marketCapSol: '1000' });getGraduationProgress.mockResolvedValueOnce({ progressBps: 4500 });const res = makeRes();- await curveHandler(makeReq({ url: `/api/pump/curve?mint=${VALID_MINT}` }), res);+ await curveHandler(makeReq({ url: `/api/pump/curve?mint=${CURVE_MINT}` }), res);expect(res.statusCode).toBe(200);const body = getJson(res);- expect(body.mint).toBe(VALID_MINT);+ expect(body.mint).toBe(CURVE_MINT);expect(body.curve.creator).toBe('CRE');expect(body.price.priceSol).toBe('0.0001');expect(body.graduation.progressBps).toBe(4500);@@ -107,7 +121,7 @@ describe('GET /api/pump/curve', () => {getTokenPrice.mockResolvedValueOnce(null);getGraduationProgress.mockResolvedValueOnce(null);const res = makeRes();- await curveHandler(makeReq({ url: `/api/pump/curve?mint=${VALID_MINT}&network=devnet` }), res);+ await curveHandler(makeReq({ url: `/api/pump/curve?mint=${CURVE_MINT}&network=devnet` }), res);expect(getJson(res).network).toBe('devnet');});});