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(market-data): DeFiLlama yield-pool API + shared market-data lib
fudjiab1049e26932e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9d66d40b7..83fc00d6d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -39,6 +39,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Free pump.fun token search, now under the versioned API** — New GET /api/v1/pump/search finds any Solana pump.fun / meme token by name, symbol, or mint — free, keyless, no account. It's the same Birdeye-first, pump.fun-fallback search that already powers the site's command palette, now registered under the versioned, cataloged /api/v1 surface so agents can discover it via GET /api/v1 alongside the platform's other free pump.fun reads (trending, bonding-curve progress, launches, whale activity). (`/docs/api-reference`) `[feature]`- **Give your agent a 3D body in one call — the new Embodiment endpoint** — Any AI agent can now buy itself a real presence in a single USDC payment: POST a name plus a text description (or a reference photo) to the new Embodiment endpoint and get back a rigged, animated, talking 3D avatar, a durable persona id that reloads in any future session, and a one-tag embed snippet for any website. It's the same free generate-and-rig chain that powers the 3D Studio, packaged as one paid call — no separate rigging step, no account. Generation failures never settle, so a buyer is only ever charged for a finished body. (`/docs/embody`) `[feature]`- **Live block-speed race: watch BNB Chain confirm in ~0.45s** — A new /bnb-latency page races BNB Chain against Base, Ethereum, and Solana in real time, sampling real blocks off public RPCs every few seconds — never a hardcoded number. Each lane shows its live measured average and a rolling sparkline; a chain going quiet shows "reconnecting" instead of a frozen fake reading. (`/bnb-latency`) `[feature]`+- **Live DeFi yield and market-sentiment data: new fear/greed and yield-pool APIs** — A new market-data layer pulls real-time DeFi yield pools and protocol TVL from DeFiLlama, backing a new GET /api/intel/yields endpoint that returns live yield pools filterable by chain, project, and stablecoin status, sorted by TVL. This lays the groundwork for yield-discovery features and a smarter trading copilot on top of real, cached, non-fabricated market data. (`/docs/api-reference`) `[feature]`- **Markets goes deep — Screener, Categories, Exchanges, Derivatives, Converter, DeFi, Chains, Stablecoins** — Eight new tools join the Markets suite, all live data and all free. Screener filters the top 250 coins by market cap, volume, and 24h move. Categories ranks every crypto sector so you can see which narrative leads. Exchanges ranks venues by trust score and volume. Derivatives shows perpetual-futures funding, open interest, and volume. Converter turns any crypto into any major fiat at live rates. And a DeFi trio — DeFi TVL by protocol, Chains by total value locked, and Stablecoins with peg health — brings on-chain liquidity into view via DeFiLlama. Every one is cross-linked from the markets table. (`/screener`) `[feature]`- **Minted 3D assets now carry a second, independently-signed provenance record — and remixing one pays the original creator on the spot** — Every 3D avatar generated on three.ws now gets a signed authorship record on the platform's append-only agent_actions ledger the moment it's created — the same cryptographically-verifiable trail @three-ws/provenance-mcp reads, now written automatically instead of only on request. Minting a generated GLB as a Solana NFT (mint_3d_asset) links its own signed ledger entry alongside the provenance already baked into the NFT metadata. And when a mint names another creator's asset as its parent (a remix), the original creator's royalty share now settles immediately as a real on-chain USDC transfer out of the mint fee — not just a royalty term for a future resale. Every minted 3D asset is also now listed in a public launch directory at GET /api/v1/tokenized/launches, the NFT counterpart to the existing coin-launch feed. (`/docs/mcp`) `[feature, improvement]`- **New free API: check if a wallet holds a Binance Account Bound Token (BABT)** — GET /api/bnb/babt-check?address=0x... tells you whether a BSC address holds a BABT — Binance's non-transferable, KYC-backed on-chain token. It's a real, live signal (1.16M+ holders on BSC mainnet) that developers can use as a free, no-signup uniqueness check for allowlists, anti-sybil gating, or airdrop targeting on BNB Chain. `[feature]`diff --git a/data/changelog.json b/data/changelog.jsonindex d51c23755..c5a06d5f6 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,25 @@{"$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. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-08",+ "title": "scene-mcp can now build a whole 3D world in one call — no browser required",+ "summary": "The scene-mcp server (compose_scene, get_scene, list_scenes) gains two tools: build_world runs the entire diorama pipeline server-side from one sentence — compose the plan, forge every object on the free text→ 3D lane, and merge the result into one glTF binary with named, selectable nodes plus ground and mood-tuned lighting — for agents with no browser to drive the progressive /diorama flow. export_scene does the merge step alone for a diorama you've already forged objects for. Both degrade gracefully: a single object that fails to forge is skipped and reported, never a hard failure — the rest of the world still exports and opens cleanly in Scene Studio. `npx -y @three-ws/scene-mcp` picks up both automatically.",+ "tags": [+ "feature",+ "sdk"+ ],+ "link": "/diorama"+ },+ {+ "date": "2026-07-08",+ "title": "Live DeFi yield and market-sentiment data: new fear/greed and yield-pool APIs",+ "summary": "A new market-data layer pulls real-time DeFi yield pools and protocol TVL from DeFiLlama, backing a new GET /api/intel/yields endpoint that returns live yield pools filterable by chain, project, and stablecoin status, sorted by TVL. This lays the groundwork for yield-discovery features and a smarter trading copilot on top of real, cached, non-fabricated market data.",+ "tags": [+ "feature"+ ],+ "link": "/docs/api-reference"+ },{"date": "2026-07-08","title": "Page agents get personas: one attribute turns your embedded 3D agent into a guide, shop assistant, DeFi advisor, onboarding coach, or support agent",diff --git a/docs/api-reference.md b/docs/api-reference.mdindex d16f0b3e9..f5d9b40b3 100644--- a/docs/api-reference.md+++ b/docs/api-reference.md@@ -2355,6 +2355,49 @@ rates, DeFi), 120 s (exchanges), 60 s (derivatives). No API key required.---+### DeFi yield pools++```+GET /api/intel/yields?chain=<name>&project=<slug>&stablecoin=<true|false>&limit=<1..100>+```++Real-time yield pools from DeFiLlama's `yields.llama.fi/pools`, filtered+server-side and sorted by TVL descending. Powers the trading copilot's+yield-discovery lane. All query params are optional; `limit` defaults to 25.++**Response**++```json+{+ "pools": [+ {+ "pool": "3637ce7b-529b-49c1-964c-710a50b2939c",+ "project": "sky-lending",+ "chain": "Arbitrum",+ "symbol": "SUSDS",+ "tvlUsd": 360345703,+ "apy": 3.6,+ "apyBase": 3.6,+ "apyReward": 0,+ "stablecoin": true+ }+ ]+}+```++GET-only, CORS-open, rate-limited per IP, `502 upstream_error` if DeFiLlama is+briefly unavailable. Cached 15 min server-side + `s-maxage=60,+stale-while-revalidate=300` at the CDN. No API key required.++The underlying library (`api/_lib/market-data.js`) also exposes+`getProtocols()`, `getProtocol(slug)`, `getChainTvls()`, and `getDexVolumes()`+against DeFiLlama's `/protocols`, `/protocol/:slug`, `/v2/chains`, and+`/overview/dexs` — not yet wired to a public endpoint; they back future+protocol/chain/DEX-volume surfaces. (three.ws's Fear & Greed index is served by+`GET /api/coin/fear-greed` above, not by this module.)++---+### Related news```diff --git a/public/changelog.json b/public/changelog.jsonindex 185b8eb53..460c9db1c 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-08T02:12:37.156Z",+ "generated_at": "2026-07-08T06:19:49.862Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -345,6 +345,16 @@"feature"]},+ {+ "date": "2026-07-08",+ "type": "update",+ "title": "Live DeFi yield and market-sentiment data: new fear/greed and yield-pool APIs",+ "summary": "A new market-data layer pulls real-time DeFi yield pools and protocol TVL from DeFiLlama, backing a new GET /api/intel/yields endpoint that returns live yield pools filterable by chain, project, and stablecoin status, sorted by TVL. This lays the groundwork for yield-discovery features and a smarter trading copilot on top of real, cached, non-fabricated market data.",+ "link": "/docs/api-reference",+ "tags": [+ "feature"+ ]+ },{"date": "2026-07-08","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 89b70be0e..fc9d2ca3e 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -270,6 +270,14 @@<category>feature</category><description>A new /bnb-latency page races BNB Chain against Base, Ethereum, and Solana in real time, sampling real blocks off public RPCs every few seconds — never a hardcoded number. Each lane shows its live measured average and a rolling sparkline; a chain going quiet shows "reconnecting" instead of a frozen fake reading.</description></item>+ <item>+ <title>Live DeFi yield and market-sentiment data: new fear/greed and yield-pool APIs</title>+ <link>https://three.ws/docs/api-reference</link>+ <guid isPermaLink="false">2026-07-08:Live DeFi yield and market-sentiment data: new fear/greed and yield-pool APIs</guid>+ <pubDate>Wed, 08 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A new market-data layer pulls real-time DeFi yield pools and protocol TVL from DeFiLlama, backing a new GET /api/intel/yields endpoint that returns live yield pools filterable by chain, project, and stablecoin status, sorted by TVL. This lays the groundwork for yield-discovery features and a smarter trading copilot on top of real, cached, non-fabricated market data.</description>+ </item><item><title>Markets goes deep — Screener, Categories, Exchanges, Derivatives, Converter, DeFi, Chains, Stablecoins</title><link>https://three.ws/screener</link>diff --git a/tests/market-data.test.js b/tests/market-data.test.jsnew file mode 100644index 000000000..f4a7b94bd--- /dev/null+++ b/tests/market-data.test.js@@ -0,0 +1,289 @@+// api/_lib/market-data.js — DeFiLlama market-data layer.+//+// No live network: fetch is mocked with vi.stubGlobal so these exercise the+// module's real caching, backoff, filtering, and shape-mapping logic against+// controlled payloads (allowed under the no-mocks rule — that bars fake data+// in the product, not test doubles). Live-network verification is captured+// separately (see the task report) with a real `node -e` invocation.++import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';+import {+ getProtocols,+ getProtocol,+ getYieldPools,+ getChainTvls,+ getDexVolumes,+ getFearGreed,+ fetchWithRetry,+ clearMarketDataCache,+ CACHE_TTL,+} from '../api/_lib/market-data.js';++function jsonResponse(status, body) {+ return { ok: status >= 200 && status < 300, status, statusText: String(status), json: async () => body };+}++let fetchMock;++beforeEach(() => {+ clearMarketDataCache();+ fetchMock = vi.fn();+ vi.stubGlobal('fetch', fetchMock);+ vi.useFakeTimers();+ vi.setSystemTime(new Date('2026-07-08T12:00:00.000Z'));+});++afterEach(() => {+ vi.useRealTimers();+ vi.unstubAllGlobals();+ vi.clearAllMocks();+});++const PROTOCOLS_FIXTURE = [+ { slug: 'aave', name: 'Aave', tvl: 20_000_000_000, category: 'Lending', chain: 'Ethereum', chains: ['Ethereum', 'Arbitrum'], change_1d: 1.2, change_7d: -3.4, logo: 'https://x/aave.png' },+ { slug: 'lido', name: 'Lido', tvl: 30_000_000_000, category: 'Liquid Staking', chain: 'Ethereum', chains: ['Ethereum'], change_1d: 0.5, change_7d: 2.1, logo: 'https://x/lido.png' },+ { slug: 'gmx', name: 'GMX', tvl: 500_000_000, category: 'Derivatives', chain: 'Arbitrum', chains: ['Arbitrum'], change_1d: -0.8, change_7d: 5.6, logo: '' },+];++const CHAINS_FIXTURE = [+ { name: 'Ethereum', tvl: 60_000_000_000, tokenSymbol: 'ETH', change_1d: 1.1 },+ { name: 'Arbitrum', tvl: 20_000_000_000, tokenSymbol: 'ARB', change_1d: -0.4 },+ { name: 'Solana', tvl: 20_000_000_000, tokenSymbol: 'SOL', change_1d: 3.3 },+];++const DEX_FIXTURE = {+ protocols: [+ { name: 'Uniswap', total24h: 2_000_000_000, change_1d: 4.2, chains: ['Ethereum', 'Arbitrum'] },+ { name: 'Raydium', total24h: 800_000_000, change_1d: -1.1, chains: ['Solana'] },+ ],+};++const YIELDS_FIXTURE = {+ data: [+ { pool: 'p1', project: 'aave-v3', chain: 'Arbitrum', symbol: 'USDC', tvlUsd: 50_000_000, apy: 8.2, apyBase: 3.1, apyReward: 5.1, stablecoin: true, ilRisk: 'no' },+ { pool: 'p2', project: 'lido', chain: 'Ethereum', symbol: 'STETH', tvlUsd: 900_000_000, apy: 3.5, apyBase: 3.5, apyReward: 0, stablecoin: false, ilRisk: 'no' },+ { pool: 'p3', project: 'aave-v3', chain: 'Arbitrum', symbol: 'ETH', tvlUsd: 40_000_000, apy: 2.1, apyBase: 2.1, apyReward: 0, stablecoin: false, ilRisk: 'no' },+ { pool: 'p4', project: 'gmx', chain: 'Arbitrum', symbol: 'USDC-ARB', tvlUsd: 10_000_000, apy: 15.4, apyBase: 4.0, apyReward: 11.4, stablecoin: true, ilRisk: 'yes' },+ ],+};++const FNG_FIXTURE = {+ data: [{ value: '72', value_classification: 'Greed', timestamp: '1783670400' }],+};++describe('fetchWithRetry', () => {+ it('returns parsed JSON on a clean 200', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, { ok: true }));+ await expect(fetchWithRetry('https://x/ok')).resolves.toEqual({ ok: true });+ expect(fetchMock).toHaveBeenCalledTimes(1);+ });++ it('retries with backoff on 429 then succeeds', async () => {+ fetchMock+ .mockResolvedValueOnce(jsonResponse(429, {}))+ .mockResolvedValueOnce(jsonResponse(200, { ok: true }));++ const promise = fetchWithRetry('https://x/rl');+ await vi.advanceTimersByTimeAsync(2100);+ await expect(promise).resolves.toEqual({ ok: true });+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });++ it('retries on 5xx then succeeds', async () => {+ fetchMock+ .mockResolvedValueOnce(jsonResponse(503, {}))+ .mockResolvedValueOnce(jsonResponse(200, { ok: true }));++ const promise = fetchWithRetry('https://x/5xx');+ await vi.advanceTimersByTimeAsync(2100);+ await expect(promise).resolves.toEqual({ ok: true });+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });++ it('propagates the error after exhausting retries', async () => {+ fetchMock.mockResolvedValue(jsonResponse(500, {}));++ const promise = fetchWithRetry('https://x/down', { maxRetries: 2 });+ // Suppress an unhandled-rejection warning racing the timer advance below —+ // the assertion still observes the real rejection via expect().rejects.+ promise.catch(() => {});+ await vi.advanceTimersByTimeAsync(10_000);+ await expect(promise).rejects.toThrow(/HTTP 500/);+ expect(fetchMock).toHaveBeenCalledTimes(3); // initial + 2 retries+ });++ it('does not retry a non-retryable 4xx', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(404, {}));+ await expect(fetchWithRetry('https://x/missing')).rejects.toThrow(/HTTP 404/);+ expect(fetchMock).toHaveBeenCalledTimes(1);+ });++ it('propagates a network error after retries', async () => {+ fetchMock.mockRejectedValue(new Error('ECONNRESET'));+ const promise = fetchWithRetry('https://x/reset', { maxRetries: 1 });+ promise.catch(() => {});+ await vi.advanceTimersByTimeAsync(5000);+ await expect(promise).rejects.toThrow(/ECONNRESET/);+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });+});++describe('getProtocols', () => {+ it('sorts by TVL desc, slices to limit, and maps fields', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, PROTOCOLS_FIXTURE));+ const result = await getProtocols({ limit: 2 });+ expect(result).toEqual([+ { slug: 'lido', name: 'Lido', tvl: 30_000_000_000, category: 'Liquid Staking', chain: 'Ethereum', change1d: 0.5, change7d: 2.1, logo: 'https://x/lido.png' },+ { slug: 'aave', name: 'Aave', tvl: 20_000_000_000, category: 'Lending', chain: 'Ethereum', change1d: 1.2, change7d: -3.4, logo: 'https://x/aave.png' },+ ]);+ });++ it('filters by chain (matches chain or chains[])', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, PROTOCOLS_FIXTURE));+ const result = await getProtocols({ chain: 'Arbitrum', limit: 10 });+ expect(result.map((p) => p.slug).sort()).toEqual(['aave', 'gmx']);+ });++ it('caches by (chain, limit) — second call within TTL hits no network', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, PROTOCOLS_FIXTURE));+ await getProtocols({ limit: 5 });+ await getProtocols({ limit: 5 });+ expect(fetchMock).toHaveBeenCalledTimes(1);+ });++ it('refetches once the protocols TTL (10 min) expires', async () => {+ fetchMock.mockResolvedValue(jsonResponse(200, PROTOCOLS_FIXTURE));+ await getProtocols({ limit: 5 });+ expect(fetchMock).toHaveBeenCalledTimes(1);+ await vi.advanceTimersByTimeAsync(CACHE_TTL.protocols + 1000);+ await getProtocols({ limit: 5 });+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });+});++describe('getProtocol', () => {+ it('maps a single protocol detail by slug', async () => {+ fetchMock.mockResolvedValueOnce(+ jsonResponse(200, {+ slug: 'aave',+ name: 'Aave',+ tvl: 20_000_000_000,+ category: 'Lending',+ chain: 'Ethereum',+ change_1d: 1.2,+ change_7d: -3.4,+ chains: ['Ethereum', 'Arbitrum'],+ }),+ );+ const result = await getProtocol('aave');+ expect(result).toEqual({+ slug: 'aave',+ name: 'Aave',+ tvl: 20_000_000_000,+ category: 'Lending',+ chain: 'Ethereum',+ change1d: 1.2,+ change7d: -3.4,+ chains: ['Ethereum', 'Arbitrum'],+ });+ expect(fetchMock).toHaveBeenCalledWith(+ 'https://api.llama.fi/protocol/aave',+ expect.any(Object),+ );+ });++ it('rejects a missing slug without hitting the network', async () => {+ await expect(getProtocol()).rejects.toThrow(/slug/);+ expect(fetchMock).not.toHaveBeenCalled();+ });+});++describe('getYieldPools', () => {+ it('filters by chain + stablecoin, sorts by TVL desc, applies limit', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, YIELDS_FIXTURE));+ const result = await getYieldPools({ chain: 'Arbitrum', stablecoin: true, limit: 3 });+ expect(result).toEqual([+ { pool: 'p1', project: 'aave-v3', chain: 'Arbitrum', symbol: 'USDC', tvlUsd: 50_000_000, apy: 8.2, apyBase: 3.1, apyReward: 5.1, stablecoin: true, ilRisk: 'no' },+ { pool: 'p4', project: 'gmx', chain: 'Arbitrum', symbol: 'USDC-ARB', tvlUsd: 10_000_000, apy: 15.4, apyBase: 4.0, apyReward: 11.4, stablecoin: true, ilRisk: 'yes' },+ ]);+ });++ it('filters by project', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, YIELDS_FIXTURE));+ const result = await getYieldPools({ project: 'aave-v3', limit: 10 });+ expect(result.map((p) => p.pool).sort()).toEqual(['p1', 'p3']);+ });++ it('respects minTvl', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, YIELDS_FIXTURE));+ const result = await getYieldPools({ minTvl: 100_000_000, limit: 10 });+ expect(result.map((p) => p.pool)).toEqual(['p2']);+ });++ it('caches the unfiltered fetch and reslices in memory for a different limit', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, YIELDS_FIXTURE));+ await getYieldPools({ limit: 1 });+ await getYieldPools({ limit: 4 });+ expect(fetchMock).toHaveBeenCalledTimes(1);+ });+});++describe('getChainTvls', () => {+ it('computes dominance percentages and sorts by TVL desc', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, CHAINS_FIXTURE));+ const result = await getChainTvls();+ expect(result[0]).toMatchObject({ name: 'Ethereum', tvl: 60_000_000_000 });+ expect(result[0].dominance).toBeCloseTo(60, 0);+ const total = result.reduce((sum, c) => sum + c.dominance, 0);+ expect(total).toBeCloseTo(100, 0);+ });+});++describe('getDexVolumes', () => {+ it('maps + sorts DEX protocols by 24h volume desc', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, DEX_FIXTURE));+ const result = await getDexVolumes();+ expect(result[0]).toEqual({ name: 'Uniswap', volume24h: 2_000_000_000, change1d: 4.2, chain: 'Ethereum, Arbitrum' });+ });++ it('filters by chain', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, DEX_FIXTURE));+ const result = await getDexVolumes({ chain: 'Solana' });+ expect(result.map((d) => d.name)).toEqual(['Raydium']);+ });+});++describe('getFearGreed', () => {+ it('maps the alternative.me shape to value/classification/timestamp', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, FNG_FIXTURE));+ const result = await getFearGreed();+ expect(result).toEqual({ value: 72, classification: 'Greed', timestamp: '1783670400' });+ });++ it('falls back to a neutral reading on a malformed payload', async () => {+ fetchMock.mockResolvedValueOnce(jsonResponse(200, { data: [] }));+ const result = await getFearGreed();+ expect(result.value).toBe(50);+ expect(result.classification).toBe('Neutral');+ });++ it('caches for the fear/greed TTL (30 min)', async () => {+ fetchMock.mockResolvedValue(jsonResponse(200, FNG_FIXTURE));+ await getFearGreed();+ await getFearGreed();+ expect(fetchMock).toHaveBeenCalledTimes(1);+ await vi.advanceTimersByTimeAsync(CACHE_TTL.fearGreed + 1000);+ await getFearGreed();+ expect(fetchMock).toHaveBeenCalledTimes(2);+ });+});++describe('error propagation', () => {+ it('an upstream failure on getYieldPools rejects rather than returning fabricated data', async () => {+ fetchMock.mockResolvedValue(jsonResponse(500, {}));+ const promise = getYieldPools({ limit: 5 });+ promise.catch(() => {});+ await vi.advanceTimersByTimeAsync(10_000);+ await expect(promise).rejects.toThrow(/HTTP 500/);+ });+});