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
fix(crypto): fall back to the on-chain curve reader when pump.fun's frontend API is Cloudflare-blocked and no cache survives
nirholas0aea532974ad
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex da766353c..a3cc6f030 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -20,6 +20,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Drive the CLI from scripts and agents, and download a run report**: Every three-ws command now takes --json (one JSON document on stdout, diagnostics on stderr) and --non-interactive (never prompts), with a stable exit-code table: 2 usage, 3 auth, 4 refused by a guard, 5 payment required, 6 network. New commands cover agents, runs, wallet balance, skill install and orders. `three-ws report run <id> --out run.html` writes one self-contained offline file with the goal, tool calls, decisions, trades, outcome and the decision-trail head hash, and the run page has a matching Download report button. (`/docs/cli`) `[feature, sdk]`- **Engine bridges are packaged for the Unity, Godot and Unreal stores**: One command, npm run package:engine-stores, validates the Unity, Godot and Unreal bridges and builds a reproducible upload package for each, with listing metadata and a submission checklist. The Unity package and Unreal plugin manifests now carry their documentation links. (`/docs/engine-store-publishing`) `[sdk, docs]`- **Fixed three more legacy thumbnail links that browsers refused to load**: A handful of forge creations and 3D props stored from before an earlier URL fix still pointed straight at the storage bucket's own domain instead of three.ws's own CDN link, which Chrome blocks as an opaque cross-origin response. Model-page posters, a creation's related-models sidebar, forge share-card previews (the image X and Discord show when a link is pasted), and the Forged gallery's model-viewer thumbnails now all resolve through the same CDN link as everything else. (`/forge`) `[fix]`+- **GET /api/crypto/bonding falls back to an on-chain read when pump.fun is Cloudflare-blocked**: pump.fun's frontend API started answering every request from our servers with a Cloudflare challenge, which hard-failed /api/crypto/bonding for every mint, including $THREE's own, once the 30-minute last-known-good cache expired. The endpoint now reads the bonding-curve account straight off Solana RPC (the same reader already live behind /api/pump/curve) before giving up, so bonding/graduation status stays answerable even while pump.fun's edge blocks us. (`/docs/api-reference`) `[fix]`- **Hundreds of dependency security advisories cleared across the repo**: Every committed lockfile was audited and patched: same-line security releases everywhere, vetted moves to patched majors (vitest 4, zod 4, helia 7, Svelte 5 and Vite 7 in the chat app, transformers 4 in HQ, gltf-transform 4 for the meshopt worker), and each package's tests and builds were rerun before and after. What remains are advisories with no patched release published anywhere (bigint-buffer, elliptic, node-forge) and pins that upstream SDKs still require. `[security, infra]`- **Install the three.ws skills with one command on any agent runtime**: Run npx skills add nirholas/three-ws-skills (or the 3D-only and agent-economy repos) to install the three.ws skills into Claude Code, Codex, Cursor and any other runtime that reads the open Agent Skills format. Every skill now passes the Agent Skills spec validator, which fixed 21 skills whose frontmatter some installers could not parse, and an install test proves each repo lists and installs every skill in a clean directory. Publishing the repos is still the owner's step. (`/docs/agent-skills`) `[feature, docs]`- **Long MCP answers arrive as a summary, and agents can search the docs**: list_my_agents, recall and crypto_data now answer with a short summary, a count, a handle and the first page when the list is long, and the new expand tool reads the rest on request. A 100-coin market list drops from about 47,800 to 4,400 tokens. Handles are signed, account-bound and last 15 minutes. The new free search_docs tool answers how-to questions from the docs index on the main and studio servers. (`/docs/mcp`) `[feature, docs]`diff --git a/api/_lib/pump-bonding.js b/api/_lib/pump-bonding.jsindex a783612b8..32f87a8d5 100644--- a/api/_lib/pump-bonding.js+++ b/api/_lib/pump-bonding.js@@ -15,10 +15,18 @@// The pure mapping (`mapBondingStatus`) is separated from the network fetch// (`fetchPumpCoin`) so the curve math is unit-testable with synthetic fixtures,// no chain required.+//+// A third tier backs both caches: when pump.fun's frontend is unreachable and+// no last-known-good copy survives, `getBondingStatus` reads the bonding-curve+// account straight off Solana RPC via `pump-curve-view.js`'s `getCurveView`,+// the same on-chain source already proven live behind `/api/pump/curve`.+// `mapOnchainCurveView` maps that into the identical status shape, tagged+// `source: 'onchain'` instead of `'pumpfun'`.import { isGraduated } from './pump-launch-feed.js';import { pumpFetchJson } from './pump-feed-fetch.js';import { cacheGet, cacheSet } from './cache.js';+import { getCurveView } from './pump-curve-view.js';export const PUMP_FRONTEND_BASE =process.env.PUMP_FRONTEND_BASE || 'https://frontend-api-v3.pump.fun';@@ -146,6 +154,53 @@ export function mapBondingStatus(coin, { solPriceUsd = 0 } = {}) {};}+/**+ * Map a getCurveView() `{ body }` payload (api/_lib/pump-curve-view.js's+ * on-chain reader) into the same status shape mapBondingStatus produces, for+ * getBondingStatus's true double-miss path: pump.fun's frontend unreachable+ * AND no last-known-good copy survives. Pure; no network.+ *+ * getCurveView's on-chain curve account (sdk-bridge's getBondingCurveState)+ * never carries pump.fun's `raydium_pool` / `pump_swap_pool` fields: those+ * live only on the frontend API's raw coin object. A graduated read taken+ * on-chain therefore cannot tell Raydium from PumpSwap and reports pump.fun's+ * current default venue, the same fallback mapBondingStatus itself uses when+ * neither pool field is present. Likewise getCurveView's on-curve price is+ * SOL-denominated with no USD leg (that conversion only exists in the+ * graduated/Jupiter branch), so `marketCapUsd` stays null for an on-curve+ * on-chain read rather than mixing units.+ *+ * @param {{ curve: object|null, graduated?: boolean, graduatedPrice?: object }} body+ * @returns {object}+ */+export function mapOnchainCurveView(body) {+ if (body?.graduated) {+ return {+ onCurve: false,+ graduated: true,+ migratedTo: 'pumpswap',+ bondingProgressPct: 100,+ solInCurve: null,+ tokensRemaining: null,+ marketCapUsd: body.graduatedPrice?.marketCapUsd ?? null,+ source: 'onchain',+ };+ }++ const realTokenReserves = num(body?.curve?.realTokenReserves);+ const realSolReserves = num(body?.curve?.realSolReserves);+ return {+ onCurve: true,+ graduated: false,+ migratedTo: null,+ bondingProgressPct: bondingProgressPct(realTokenReserves),+ solInCurve: realSolReserves != null ? realSolReserves / 1e9 : null,+ tokensRemaining: realTokenReserves != null ? realTokenReserves / 1e6 : null,+ marketCapUsd: null,+ source: 'onchain',+ };+}+// Bounded retry on 429/5xx (honours Retry-After), never throws: the same// resilience the sibling pump.fun readers (trending, whales, /api/pump/coin)// already rely on, so a Cloudflare rate-limit blip recovers inside one request@@ -186,11 +241,15 @@ export async function fetchPumpCoin(mint) {/*** Resolve the full bonding-curve status for a mint: live cache, then fetch +- * map, then a last-known-good fallback on upstream failure. Mirrors- * `readThroughFeed` in pump-feed-fetch.js: a live hit answers first; a miss- * fetches and writes through both tiers; a failed fetch serves the- * last-known-good copy (flagged `stale`) rather than hard-failing, and only- * reports `upstream_down` when no cached data exists at all for this mint.+ * map, then a last-known-good fallback on upstream failure, then the on-chain+ * reader as a last resort. Mirrors `readThroughFeed` in pump-feed-fetch.js: a+ * live hit answers first; a miss fetches and writes through both tiers; a+ * failed fetch serves the last-known-good copy (flagged `stale`) rather than+ * hard-failing; and only when BOTH pump.fun's frontend and the LKG cache miss+ * does it fall through to api/_lib/pump-curve-view.js's on-chain reader+ * (the same Solana-RPC-backed source /api/pump/curve already serves live).+ * `upstream_down` is now reserved for the case where that on-chain read also+ * comes up empty.** @param {string} mint* @returns {Promise<{ kind: 'ok', status: object, coin: object, stale: boolean } | { kind: 'not_found' } | { kind: 'upstream_down' }>}@@ -216,5 +275,19 @@ export async function getBondingStatus(mint) {const lkg = await cacheGet(bondingLkgKey(mint));if (lkg) return { kind: 'ok', status: lkg.status, coin: lkg.coin, stale: true };++ // True double miss: pump.fun's frontend is unreachable (the Cloudflare+ // challenge it now answers every request with) and no cached copy for+ // this mint survives either. Read the bonding-curve account straight off+ // Solana RPC before giving up; it is the same data, proven live.+ const onchain = await getCurveView({ mint, network: 'mainnet' });+ if (onchain.httpStatus === 200 && onchain.body && (onchain.body.curve || onchain.body.graduated)) {+ const status = mapOnchainCurveView(onchain.body);+ // Cached into the LKG tier (never the pump.fun liveKey, which means+ // "pump.fun answered this recently") so a repeat poll within the LKG+ // window doesn't re-hit RPC.+ cacheSet(bondingLkgKey(mint), { status, coin: null }, LKG_TTL_S).catch(() => {});+ return { kind: 'ok', status, coin: null, stale: false };+ }return { kind: 'upstream_down' };}diff --git a/data/changelog.json b/data/changelog.jsonindex 5629365e9..43482c9af 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-24",+ "title": "GET /api/crypto/bonding falls back to an on-chain read when pump.fun is Cloudflare-blocked",+ "summary": "pump.fun's frontend API started answering every request from our servers with a Cloudflare challenge, which hard-failed /api/crypto/bonding for every mint, including $THREE's own, once the 30-minute last-known-good cache expired. The endpoint now reads the bonding-curve account straight off Solana RPC (the same reader already live behind /api/pump/curve) before giving up, so bonding/graduation status stays answerable even while pump.fun's edge blocks us.",+ "tags": [+ "fix"+ ],+ "link": "/docs/api-reference"+ },{"date": "2026-10-24","title": "Two new Solana Blinks: tip an agent, buy its coin",diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 86705a394..3e6361397 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-10-24T23:12:48.053Z",+ "generated_at": "2026-10-24T23:24:05.471Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 4190,+ "total": 4191,"complete": false,"full_feed": "/changelog.json","entries": [@@ -153,6 +153,16 @@"fix"]},+ {+ "date": "2026-10-24",+ "type": "update",+ "title": "GET /api/crypto/bonding falls back to an on-chain read when pump.fun is Cloudflare-blocked",+ "summary": "pump.fun's frontend API started answering every request from our servers with a Cloudflare challenge, which hard-failed /api/crypto/bonding for every mint, including $THREE's own, once the 30-minute last-known-good cache expired. The endpoint now reads the bonding-curve account straight off Solana RPC (the same reader already live behind /api/pump/curve) before giving up, so bonding/graduation status stays answerable even while pump.fun's edge blocks us.",+ "link": "/docs/api-reference",+ "tags": [+ "fix"+ ]+ },{"date": "2026-10-24","type": "update",@@ -1553,16 +1563,6 @@"tags": ["feature"]- },- {- "date": "2026-10-12",- "type": "update",- "title": "Engine QA: a free real-time-engine fitness grade, plus real LOD chains",- "summary": "A new free grade answers the question a game engine's import step asks that neither glTF validation nor simulation readiness does: draw calls, material count, texel density against the mesh's real-world size, a per-level triangle budget for a LOD chain, and whether the mesh is cheap and closed enough to use as its own physics collider. GET/POST /api/3d/engine-qa grades any public GLB (format=stl exports a watertight mesh for printing); the same browser-only checks run with zero network cost in Rig Doctor, and the full grade with a one-click upgrade in the GLB viewer, through a shared <engine-qa> panel component. The underlying LOD builder (packages/glb-tools's buildLodChain, real meshoptimizer decimation tagged with MSFT_lod) is now also available on generation: send { \"lods\": true } to POST /api/forge and the finished creation gets a combined LOD-chain variant alongside its delivered mesh, the same opt-in, fire-and-forget pattern as the existing web-delivery variant.",- "link": "/docs/engine-qa",- "tags": [- "feature"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 6e136de95..7d2626934 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-24T23:12:48.028Z",+ "generated_at": "2026-10-24T23:24:05.446Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -150,6 +150,16 @@"fix"]},+ {+ "date": "2026-10-24",+ "type": "update",+ "title": "GET /api/crypto/bonding falls back to an on-chain read when pump.fun is Cloudflare-blocked",+ "summary": "pump.fun's frontend API started answering every request from our servers with a Cloudflare challenge, which hard-failed /api/crypto/bonding for every mint, including $THREE's own, once the 30-minute last-known-good cache expired. The endpoint now reads the bonding-curve account straight off Solana RPC (the same reader already live behind /api/pump/curve) before giving up, so bonding/graduation status stays answerable even while pump.fun's edge blocks us.",+ "link": "/docs/api-reference",+ "tags": [+ "fix"+ ]+ },{"date": "2026-10-24","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 1468e24c2..917885270 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -118,6 +118,14 @@<category>fix</category><description>A handful of forge creations and 3D props stored from before an earlier URL fix still pointed straight at the storage bucket's own domain instead of three.ws's own CDN link, which Chrome blocks as an opaque cross-origin response. Model-page posters, a creation's related-models sidebar, forge share-card previews (the image X and Discord show when a link is pasted), and the Forged gallery's model-viewer thumbnails now all resolve through the same CDN link as everything else.</description></item>+ <item>+ <title>GET /api/crypto/bonding falls back to an on-chain read when pump.fun is Cloudflare-blocked</title>+ <link>https://three.ws/docs/api-reference</link>+ <guid isPermaLink="false">2026-10-24:GET /api/crypto/bonding falls back to an on-chain read when pump.fun is Cloudflare-blocked</guid>+ <pubDate>Sat, 24 Oct 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>pump.fun's frontend API started answering every request from our servers with a Cloudflare challenge, which hard-failed /api/crypto/bonding for every mint, including $THREE's own, once the 30-minute last-known-good cache expired. The endpoint now reads the bonding-curve account straight off Solana RPC (the same reader already live behind /api/pump/curve) before giving up, so bonding/graduation status stays answerable even while pump.fun's edge blocks us.</description>+ </item><item><title>Hundreds of dependency security advisories cleared across the repo</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex ff748219f..9b6a51979 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-10-24T23:12:48.012Z",+ "generated_at": "2026-10-24T23:24:05.430Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tests/crypto-bonding-endpoint.test.js b/tests/crypto-bonding-endpoint.test.jsindex dc3790235..f103f4888 100644--- a/tests/crypto-bonding-endpoint.test.js+++ b/tests/crypto-bonding-endpoint.test.js@@ -132,6 +132,27 @@ describe('GET /api/crypto/bonding', () => {});});+ it('200s an on-chain fallback result with source onchain and no x-pump-stale header (it is live data, not stale pump.fun data)', async () => {+ getBondingStatus.mockResolvedValue({+ kind: 'ok',+ stale: false,+ status: {+ onCurve: false,+ graduated: true,+ migratedTo: 'pumpswap',+ bondingProgressPct: 100,+ solInCurve: null,+ tokensRemaining: null,+ marketCapUsd: 296832.56,+ source: 'onchain',+ },+ });+ const res = await call(`/api/crypto/bonding?mint=${THREE_MINT}`);+ expect(res._json.status).toBe(200);+ expect(res._json.body.source).toBe('onchain');+ expect(res._json.headers['x-pump-stale']).toBeUndefined();+ });+it('200s a stale last-known-good result with x-pump-stale set instead of 503', async () => {getBondingStatus.mockResolvedValue({kind: 'ok',diff --git a/tests/pump-bonding.test.js b/tests/pump-bonding.test.jsindex 96204f8da..40185e804 100644--- a/tests/pump-bonding.test.js+++ b/tests/pump-bonding.test.js@@ -11,13 +11,22 @@ vi.mock('../api/_lib/cache.js', () => ({cacheSet: async (k, v) => { cache.set(k, v); },}));+// The on-chain fallback (getCurveView) is the proven reader already live+// behind /api/pump/curve; it is mocked here so this suite stays a unit test+// of getBondingStatus's branching, not an RPC integration test.+vi.mock('../api/_lib/pump-curve-view.js', () => ({+ getCurveView: vi.fn(),+}));+import {bondingProgressPct,mapBondingStatus,+ mapOnchainCurveView,isPumpLaunch,PUMP_CURVE_INITIAL_REAL_TOKENS,getBondingStatus,} from '../api/_lib/pump-bonding.js';+import { getCurveView } from '../api/_lib/pump-curve-view.js';// Synthetic pump.fun coin objects. No real third-party mint — $THREE's CA is the// platform's own coin; the reserves are illustrative curve states.@@ -156,6 +165,41 @@ describe('mapBondingStatus — graduated branch', () => {});});++describe('mapOnchainCurveView -- pure mapping of getCurveView() output', () => {+ it('maps an on-curve getCurveView body to the shared status shape, tagged onchain', () => {+ const s = mapOnchainCurveView({+ curve: {+ realTokenReserves: String(PUMP_CURVE_INITIAL_REAL_TOKENS / 4),+ realSolReserves: String(42 * 1e9),+ },+ });+ expect(s.onCurve).toBe(true);+ expect(s.graduated).toBe(false);+ expect(s.migratedTo).toBeNull();+ expect(s.bondingProgressPct).toBeCloseTo(75, 6);+ expect(s.solInCurve).toBeCloseTo(42, 6);+ expect(s.tokensRemaining).toBeCloseTo(PUMP_CURVE_INITIAL_REAL_TOKENS / 4 / 1e6, 6);+ expect(s.marketCapUsd).toBeNull(); // body.price is SOL-denominated, no USD leg on this branch+ expect(s.source).toBe('onchain');+ });++ it('maps a graduated getCurveView body (curve account closed) with the Jupiter-backed market cap', () => {+ const s = mapOnchainCurveView({+ curve: null,+ graduated: true,+ graduatedPrice: { priceUsd: 0.0003, source: 'jupiter', marketCapUsd: 300_000 },+ });+ expect(s.graduated).toBe(true);+ expect(s.onCurve).toBe(false);+ expect(s.bondingProgressPct).toBe(100);+ expect(s.solInCurve).toBeNull();+ expect(s.tokensRemaining).toBeNull();+ expect(s.marketCapUsd).toBe(300_000);+ expect(s.migratedTo).toBe('pumpswap'); // on-chain curve account never carries raydium_pool/pump_swap_pool+ expect(s.source).toBe('onchain');+ });+});// getBondingStatus: live cache / last-known-good fallback. Bug: before this,// a failed upstream fetch always returned `{kind:'upstream_down'}`, even when// a prior successful fetch for the same mint existed -- the live production@@ -179,6 +223,13 @@ const bondingCoin = {beforeEach(() => {cache.clear();+ // Default: the on-chain reader also has nothing for this mint, so tests+ // that don't care about the fallback see the pre-fallback upstream_down+ // behavior unless they override this mock.+ getCurveView.mockReset().mockResolvedValue({+ httpStatus: 404,+ body: { error: 'no_curve', error_description: 'no bonding curve found for that mint' },+ });});afterEach(() => {@@ -186,10 +237,85 @@ afterEach(() => {});describe('getBondingStatus -- cache + last-known-good fallback', () => {- it('reproduces the outage: upstream down, no last-known-good, reports upstream_down', async () => {+ it('the true double failure: upstream down, no last-known-good, on-chain reader also has nothing, reports upstream_down', async () => {+ // Narrowed from the original "reproduces the outage" regression test now+ // that a successful on-chain read fires on this path (see the two tests+ // below): this case pins down that upstream_down is still reported, and+ // reported cleanly, when BOTH the pump.fun fetch and the on-chain fallback+ // come up empty, not just the former.vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('network unreachable')));const out = await getBondingStatus(THREE_MINT);expect(out).toEqual({ kind: 'upstream_down' });+ expect(getCurveView).toHaveBeenCalledWith({ mint: THREE_MINT, network: 'mainnet' });+ });++ it('on-chain fallback: upstream down, no last-known-good, serves the on-curve bonding state read straight off Solana RPC', async () => {+ vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('network unreachable')));+ getCurveView.mockResolvedValue({+ httpStatus: 200,+ body: {+ mint: THREE_MINT,+ network: 'mainnet',+ curve: {+ virtualTokenReserves: '500000000000000',+ virtualSolReserves: '50000000000',+ realTokenReserves: String(PUMP_CURVE_INITIAL_REAL_TOKENS / 2),+ realSolReserves: String(21 * 1e9),+ tokenTotalSupply: '1000000000000000',+ complete: false,+ creator: '9wgvwps9qK5jNniC5RJdrYCfaV3CLKTnxYVqBjXwegEV',+ isMayhemMode: false,+ },+ price: { priceSol: '0.0001', marketCapSol: '1000' },+ graduation: { isGraduated: false, progressBps: 5000 },+ },+ });++ const out = await getBondingStatus(THREE_MINT);+ expect(out.kind).toBe('ok');+ expect(out.stale).toBe(false);+ expect(out.coin).toBeNull();+ expect(out.status.source).toBe('onchain');+ expect(out.status.onCurve).toBe(true);+ expect(out.status.graduated).toBe(false);+ expect(out.status.bondingProgressPct).toBeCloseTo(50, 6);+ expect(out.status.solInCurve).toBeCloseTo(21, 6);+ expect(out.status.tokensRemaining).toBeCloseTo(PUMP_CURVE_INITIAL_REAL_TOKENS / 2 / 1e6, 6);++ // Written through to the last-known-good tier (not the pump.fun live+ // tier, which means "pump.fun answered this recently") so a repeat poll+ // inside the LKG window doesn't re-hit RPC.+ expect(cache.get(`pump:bonding:live:${THREE_MINT}`)).toBeUndefined();+ const lkg = cache.get(`pump:bonding:lkg:${THREE_MINT}`);+ expect(lkg.status.source).toBe('onchain');+ });++ it('on-chain fallback: upstream down, no last-known-good, serves the graduated state with its Jupiter-backed market cap', async () => {+ vi.stubGlobal('fetch', vi.fn().mockRejectedValue(new Error('network unreachable')));+ getCurveView.mockResolvedValue({+ httpStatus: 200,+ body: {+ mint: THREE_MINT,+ network: 'mainnet',+ curve: null,+ graduated: true,+ price: null,+ graduation: { isGraduated: true, progressBps: 10_000 },+ graduatedPrice: { priceUsd: 0.00029683255767706676, source: 'jupiter', marketCapUsd: 296832.55767706677 },+ },+ });++ const out = await getBondingStatus(THREE_MINT);+ expect(out.kind).toBe('ok');+ expect(out.stale).toBe(false);+ expect(out.status.source).toBe('onchain');+ expect(out.status.graduated).toBe(true);+ expect(out.status.onCurve).toBe(false);+ expect(out.status.bondingProgressPct).toBe(100);+ expect(out.status.solInCurve).toBeNull();+ expect(out.status.tokensRemaining).toBeNull();+ expect(out.status.marketCapUsd).toBeCloseTo(296832.55767706677, 3);+ expect(out.status.migratedTo).toBe('pumpswap');});it('the bug: upstream down but a last-known-good copy exists, serves it stale instead of failing', async () => {