Skip to content

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.

fix(stablecoins): name the outage and retry in place when the DeFiLlama feed is down

nirholasc3ab0f5aacef
diff --git a/data/changelog.json b/data/changelog.json
index 3b2389a1c..99100536c 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -25371,6 +25371,16 @@
"docs"
],
"link": "/news/huggingface-building-3d-ai-agents"
+ },
+ {
+ "date": "2026-09-01",
+ "title": "Stablecoins page: a clear message and a one-click retry when the feed is down",
+ "summary": "When DeFiLlama cannot be reached, /stablecoins now says so in plain words and offers a Try again button that refetches in place, instead of a reload link over blank stat cards. An empty answer from the feed gets its own message rather than $0.00 cards. When the page is showing the last good copy because the live feed is unreachable, the footer line says so, and the \"updated\" time no longer flickers back to a static label after the language pass runs. The page title and description now spell out what the board covers: market cap, peg health, backing mechanism, and chains.",
+ "tags": [
+ "fix",
+ "improvement"
+ ],
+ "link": "/stablecoins"
}
]
}
diff --git a/pages/stablecoins.html b/pages/stablecoins.html
index 13e2b1fb4..09c3aae3c 100644
--- a/pages/stablecoins.html
+++ b/pages/stablecoins.html
@@ -18,18 +18,18 @@
</script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title data-i18n="stablecoins.meta_title">Stablecoins Market Cap · three.ws</title>
+ <title data-i18n="stablecoins.meta_title">Stablecoins Market Cap &amp; Peg Health · three.ws</title>
<meta
name="description"
- content="Track the top stablecoins by market cap — peg health, dominance share, backing mechanism, and the chains each one lives on. Live data from DeFiLlama."
+ content="Every major stablecoin ranked by circulating market cap, with live peg health, backing mechanism (fiat-backed, crypto-backed, algorithmic), and the chains it lives on. Live from DeFiLlama."
data-i18n-attr="content:stablecoins.meta_description"/>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="three.ws" />
<meta property="og:url" content="https://three.ws/stablecoins" />
- <meta property="og:title" content="Stablecoins Market Cap · three.ws" data-i18n-attr="content:stablecoins.meta_og_title"/>
+ <meta property="og:title" content="Stablecoins Market Cap &amp; Peg Health · three.ws" data-i18n-attr="content:stablecoins.meta_og_title"/>
<meta
property="og:description"
- content="The top stablecoins ranked by market cap — with live peg health, dominance share, backing mechanism, and chains. Data from DeFiLlama."
+ content="Every major stablecoin ranked by circulating market cap, with live peg health, dominance share, backing mechanism, and the chains it lives on. Live from DeFiLlama."
data-i18n-attr="content:stablecoins.meta_og_description"/>
<meta
property="og:image"
@@ -39,10 +39,10 @@
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@trythreews" />
- <meta name="twitter:title" content="Stablecoins Market Cap · three.ws" data-i18n-attr="content:stablecoins.meta_twitter_title"/>
+ <meta name="twitter:title" content="Stablecoins Market Cap &amp; Peg Health · three.ws" data-i18n-attr="content:stablecoins.meta_twitter_title"/>
<meta
name="twitter:description"
- content="The top stablecoins ranked by market cap — with live peg health, dominance, mechanism, and chains."
+ content="Every major stablecoin ranked by market cap, with live peg health, dominance, backing mechanism, and chains."
data-i18n-attr="content:stablecoins.meta_twitter_description"/>
<meta
name="twitter:image"
@@ -61,7 +61,7 @@
<link rel="canonical" href="https://three.ws/stablecoins" />
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />
<meta property="og:locale" content="en_US" />
- <meta property="og:image:alt" content="Stablecoins Market Cap — three.ws" />
+ <meta property="og:image:alt" content="Stablecoins Market Cap and Peg Health on three.ws" />
<script type="application/ld+json">
{
@@ -69,8 +69,8 @@
"@graph": [
{
"@type": "WebPage",
- "name": "Stablecoins Market Cap",
- "description": "The top stablecoins ranked by market cap, with live peg health, dominance share, backing mechanism, and the chains each one lives on. Data from DeFiLlama.",
+ "name": "Stablecoins Market Cap & Peg Health",
+ "description": "Every major stablecoin ranked by circulating market cap, with live peg health, dominance share, backing mechanism, and the chains it lives on. Live from DeFiLlama.",
"url": "https://three.ws/stablecoins",
"isPartOf": {
"@type": "WebSite",
@@ -94,9 +94,9 @@
</nav>
<h1 class="cv-h1" data-i18n="stablecoins.stablecoins_market_cap">Stablecoins Market Cap</h1>
<p class="cv-sub" data-i18n="stablecoins.the_stablecoin_market_at_a_glance_ranked">
- The stablecoin market at a glance — ranked by circulating supply, with live peg
- health, dominance share, backing mechanism, and the chains each one lives on. A
- price drifting from $1.00 shows red; on-peg shows green.
+ Every major stablecoin ranked by circulating market cap, with live peg health,
+ dominance share, backing mechanism, and the chains each one lives on. A price
+ drifting from $1.00 shows red; on-peg shows green.
</p>
<!-- Stat cards. Hydrated by src/stablecoins.js. -->
diff --git a/prompts/swarm-100/route-stablecoins.md b/prompts/swarm-100/route-stablecoins.md
deleted file mode 100644
index eaae45c16..000000000
--- a/prompts/swarm-100/route-stablecoins.md
+++ /dev/null
@@ -1,119 +0,0 @@
-# Route audit: /stablecoins (Stablecoins Market Cap & Peg Health)
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this
-repository and say "run this work order". This file is fully self-contained:
-it depends on no other prompt file anywhere. If neighboring files in
-prompts/swarm-100/ are gone, that work is done; if present, ignore them.
-Every claim below rots; step 0 re-measures, and what you measure wins.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. Its rules override everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option
- list, or an unexecuted plan. A judgment call goes in one line of the final
- report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real
- funds or any irreversible on-chain write, git push or a production deploy,
- committing content that references a crypto project other than $THREE, and
- destroying unrecoverable data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no
- commented-out code. Real APIs and real integrations only.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a
- bare add-everything), and commit finished work promptly.
-- Before committing, run: npm run check:rules -- --paths <files you touched>.
- It must exit 0.
-
-## Step 0: re-derive the current state
-
-1. This route's declared entry (path, description, added date):
-
- node -e "const p=require('./data/pages.json');for(const s of p.sections)for(const g of s.pages)if(g.path==='/stablecoins')console.log(JSON.stringify(g,null,2))"
-
-2. Find the serving implementation: grep "/stablecoins" in vercel.json (the live
- route table server/index.mjs boots from), then list matching files in
- pages/ and src/. STRUCTURE.md maps every surface to its directory if the
- grep is ambiguous.
-3. Production right now:
-
- curl -so /dev/null -w '%{http_code}\n' https://three.ws/stablecoins
-
-4. Start (or reuse) the local dev server: npm run dev (vite, port 3000).
-
-## Task: audit this one route end to end, then fix everything found
-
-Route: /stablecoins ("Stablecoins Market Cap & Peg Health", section "crypto").
-Declared purpose: Every major stablecoin ranked by circulating market cap, with live peg health, backing mechanism (fiat-backed, crypto-backed, algorithmic), and the chains it lives on. Live from DeFiLlama.
-
-Drive the page in a real headless browser. Playwright is already a dev
-dependency; keep your probe script in the session scratchpad, never in the
-repo.
-
-1. Load http://localhost:3000/stablecoins. Record the HTTP status, every console
- error and warning, and every failed network request.
-2. Exercise it like a first-time user: click the primary actions, run the
- primary flow if one exists, follow the page's internal links. Every button
- must do something real; every link must resolve. If the page renders data,
- prove in the network log that it came from a live endpoint, not a baked-in
- fallback array.
-3. States: verify populated, empty, loading, and error states are designed and
- reachable. Block the page's primary fetch in Playwright and confirm an
- actionable error state appears, not a blank void or a raw exception.
-4. Responsive: render at 320, 768, and 1440 px. No horizontal page scroll, no
- overlapping or clipped controls.
-5. Accessibility basics: one h1; interactive elements are real buttons or
- links with visible focus states; images carry alt text; form fields have
- labels.
-6. Head: a specific title tag and meta description that match the declared
- purpose above.
-7. Fix every defect at its root in the page's real source files and re-run the
- probe until clean. Defects in shared modules are in scope when this route
- exercises them.
-
-## Definition of done
-
-- [ ] Local load of /stablecoins: HTTP 200, zero console errors, zero unhandled
- failed requests (a third-party outage must land in a designed fallback,
- not a broken page).
-- [ ] No dead interactive element on the page: no stub href="#", no button
- without a handler, no link to a missing path.
-- [ ] Empty, loading, error, and populated states verified.
-- [ ] 320 / 768 / 1440 px renders verified clean.
-- [ ] Title and meta description present and specific.
-- [ ] npm test passes; npm run check:rules -- --paths <touched files> exits 0.
-- [ ] Production status from step 0 recorded in the report; if production
- needs a deploy to pick up a fix, the report says so (deploys stay
- owner-gated).
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |
-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |
-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |
-| Playwright browser missing | npx playwright install chromium |
-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |
-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |
-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in
- front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house
- style: type(scope): what changed and why a reader cares).
-3. Delete this prompt file in that same commit:
-
- git rm prompts/swarm-100/route-stablecoins.md
-
- The shrinking directory is this campaign's only progress ledger; there is
- no progress log to update.
-4. Final report: what step 0 measured, what changed (file list), evidence per
- Definition of done line, and any one-line judgment calls. No trailing
- questions, no unexecuted plans.
-
-If a line genuinely cannot pass inside this session (an external party must
-respond, or an owner-gated action is the final step), finish everything else,
-leave this file in place, and state exactly which line remains and who owns
-it. Never delete this file on a partial.
diff --git a/public/locales/en.json b/public/locales/en.json
index f8d5dd54e..0930b4f28 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -18380,15 +18380,15 @@
"stablecoins": {
"data_defillama": "Data: DeFiLlama",
"markets": "Markets",
- "meta_description": "Track the top stablecoins by market cap — peg health, dominance share, backing mechanism, and the chains each one lives on. Live data from DeFiLlama.",
- "meta_og_description": "The top stablecoins ranked by market cap — with live peg health, dominance share, backing mechanism, and chains. Data from DeFiLlama.",
- "meta_og_title": "Stablecoins Market Cap · three.ws",
- "meta_title": "Stablecoins Market Cap · three.ws",
- "meta_twitter_description": "The top stablecoins ranked by market cap — with live peg health, dominance, mechanism, and chains.",
- "meta_twitter_title": "Stablecoins Market Cap · three.ws",
+ "meta_description": "Every major stablecoin ranked by circulating market cap, with live peg health, backing mechanism (fiat-backed, crypto-backed, algorithmic), and the chains it lives on. Live from DeFiLlama.",
+ "meta_og_description": "Every major stablecoin ranked by circulating market cap, with live peg health, dominance share, backing mechanism, and the chains it lives on. Live from DeFiLlama.",
+ "meta_og_title": "Stablecoins Market Cap & Peg Health · three.ws",
+ "meta_title": "Stablecoins Market Cap & Peg Health · three.ws",
+ "meta_twitter_description": "Every major stablecoin ranked by market cap, with live peg health, dominance, backing mechanism, and chains.",
+ "meta_twitter_title": "Stablecoins Market Cap & Peg Health · three.ws",
"stablecoins": "Stablecoins",
"stablecoins_market_cap": "Stablecoins Market Cap",
- "the_stablecoin_market_at_a_glance_ranked": "The stablecoin market at a glance — ranked by circulating supply, with live peg health, dominance share, backing mechanism, and the chains each one lives on. A price drifting from $1.00 shows red; on-peg shows green."
+ "the_stablecoin_market_at_a_glance_ranked": "Every major stablecoin ranked by circulating market cap, with live peg health, dominance share, backing mechanism, and the chains each one lives on. A price drifting from $1.00 shows red; on-peg shows green."
},
"stage": {
"meta_description": "Live, embodied AI performances on three.ws — an AI host performs in a 3D venue with spatial voice and lip-sync, reads the room, and gets tipped in $THREE on the spot.",
@@ -18484,23 +18484,23 @@
"meta_title": "Store · x402"
},
"strategies": {
- "a_strategy_object_is_a_real_rule": "A Strategy Object is a real, rule-based plan — entry conditions, sizing, take-profit, stop-loss — made into a <b>thing you own</b>. Equip it on your agent and it trades for real, on-chain, strictly inside your spend policy. Publish yours, fork the best, and watch the leaderboard rank them by <b>verified live performance</b> — numbers no one can fake.",
+ "a_strategy_object_is_a_real_rule": "A Strategy Object is a real, rule-based plan (entry conditions, sizing, take-profit, stop-loss) made into a <b>thing you own</b>. Equip it on your agent and it trades for real, on-chain, strictly inside your spend policy. Publish yours, fork the best, and watch the leaderboard rank them by <b>verified live performance</b>: numbers no one can fake.",
"equip_a_strategy_not_a_spreadsheet": "Equip a strategy, not a spreadsheet",
- "forkable_rules_only_never_wallet_access": "<b>Forkable</b> — rules only, never wallet access",
- "kill_switch_halt_all_at_once": "<b>Kill switch</b> — halt all at once",
+ "forkable_rules_only_never_wallet_access": "<b>Forkable</b>: rules only, never wallet access",
+ "kill_switch_halt_all_at_once": "<b>Kill switch</b>: halt all at once",
"leaderboard": "Leaderboard",
"marketplace": "Marketplace",
"meta_description": "Trading know-how as a collectible. Equip a real, rule-based strategy on your agent and it trades for real, on-chain, strictly within your spend policy. Publish yours, fork the best, ranked by verified live performance.",
- "meta_og_description": "Equip a real, rule-based strategy on your agent — trades on-chain within your spend policy. Publish, fork, and rank by verified live performance.",
- "meta_og_title": "Strategies · three.ws",
- "meta_title": "Strategies · three.ws",
- "meta_twitter_description": "Ownable, forkable, leaderboard-ranked trade strategies — proven on real chain data. Equip one on your agent.",
- "meta_twitter_title": "Strategies · three.ws",
+ "meta_og_description": "Equip a real, rule-based strategy on your agent and it trades on-chain within your spend policy. Publish, fork, and rank by verified live performance.",
+ "meta_og_title": "Strategy Objects · three.ws",
+ "meta_title": "Strategy Objects · three.ws",
+ "meta_twitter_description": "Ownable, forkable, leaderboard-ranked trade strategies, proven on real chain data. Equip one on your agent.",
+ "meta_twitter_title": "Strategy Objects · three.ws",
"my_library": "My library",
"new_strategy": "+ New strategy",
"ownable_alpha_proven_on_real_chain_data": "<span class=\"sp-live-dot\" aria-hidden=\"true\"></span> Ownable alpha · proven on real chain data",
- "real_on_chain_no_backtested_fiction": "<b>Real on-chain</b> — no backtested fiction",
- "spend_policy_gated_every_trade": "<b>Spend-policy gated</b> — every trade"
+ "real_on_chain_no_backtested_fiction": "<b>Real on-chain</b>: no backtested fiction",
+ "spend_policy_gated_every_trade": "<b>Spend-policy gated</b>: every trade"
},
"strategy_lab": {
"2m": "2m",
@@ -18588,7 +18588,7 @@
"iframe_snippet": "iframe snippet",
"include_in_embed": "Include in embed",
"launch": "⚡ Launch",
- "meta_description": "Turn any avatar into an embeddable 3D widget. Five types, brand controls, one-line embed.",
+ "meta_description": "Pick any three.ws avatar, choose a widget type, set brand colors and environment, and copy a one-line embed snippet for your site.",
"meta_og_description": "Pick an avatar, configure embed options, copy a one-line snippet for your site.",
"meta_og_title": "Widget Studio · three.ws",
"meta_title": "Widget Studio · three.ws",
@@ -18614,7 +18614,9 @@
"want_to_try_the_viewer_full_page": "Want to try the viewer full-page with environments and embed code side by side? Open the <a href=\"/playground\">Playground</a>.",
"widgets": "Widgets",
"width_px": "Width (px)",
- "your_widget_is_live": "Your widget is live"
+ "your_widget_is_live": "Your widget is live",
+ "public_search_arialabel": "Search public avatars",
+ "script_snippet_arialabel": "Script-tag embed snippet"
},
"support": {
"a_few_minutes_here_usually_turns_three": "A few minutes here usually turns three round-trips into one.",
@@ -18790,7 +18792,7 @@
"meta_description": "One screen for pump.fun traders: the live launch firehose with intel scores, firewall verdicts, and smart-money flow, your streaming positions, and one-keystroke firewall + MEV-gated trading from your agent wallet.",
"meta_og_description": "The real-time pump.fun trading terminal — live launches, intel, firewall verdicts, smart-money, and your positions, with one-keystroke guarded trading.",
"meta_og_title": "Mission Control · three.ws",
- "meta_title": "Mission Control — Real-Time Trading Terminal · three.ws",
+ "meta_title": "Mission Control: Real-Time Trading Terminal · three.ws",
"meta_twitter_description": "The real-time pump.fun trading terminal — live launches, intel, firewall verdicts, smart-money, and your positions.",
"meta_twitter_title": "Mission Control · three.ws"
},
@@ -18824,7 +18826,7 @@
"waiting_on_the_next_move": "Waiting on the next move"
},
"three": {
- "meta_description": "Hold $THREE to unlock platform-wide perks — fee discounts on compute, higher free quotas, private and branded worlds. See every tier, what it unlocks, and how much $THREE you hold to reach it. $THREE is the only coin on three.ws.",
+ "meta_description": "Hold $THREE to unlock platform-wide perks: fee discounts on compute, higher free quotas, and private and branded worlds. See every tier, what it unlocks, and exactly how much $THREE you hold to reach the next one. $THREE is the only coin on three.ws.",
"meta_og_description": "Hold $THREE to unlock fee discounts, higher free quotas, and private worlds. The same tiers, the same upgrade path, everywhere.",
"meta_og_title": "$THREE tiers · Hold-to-access on three.ws",
"meta_title": "$THREE tiers · Hold-to-access perks · three.ws",
@@ -18999,35 +19001,39 @@
},
"tour": {
"bring_your_curiosity_the_guide_handles_the": "Bring your curiosity — the guide handles the rest.",
+ "every_feature_chapter_by_chapter": "every feature, chapter by chapter",
"every_stop_is_narrated_out_loud_and": "Every stop is narrated out loud and shown in a chat bubble above the guide's head, so you can listen, read, or mute the voice and just read along.",
"explore_walk_the_guide_anywhere_no_falling": "<span class=\"tour-track__icon\">🕹</span> <span class=\"tour-track__body\"> <span class=\"tour-track__title\">Explore</span> <span class=\"tour-track__meta\">walk the guide anywhere — no falling</span> </span> <span class=\"tour-track__go\">▶</span>",
- "full_tour_every_feature_chapter_by_chapter": "<span class=\"tour-track__icon\">🗺️</span> <span class=\"tour-track__body\"> <span class=\"tour-track__title\">Full tour</span> <span class=\"tour-track__meta\" id=\"track-full-meta\">every feature, chapter by chapter</span> </span> <span class=\"tour-track__go\">▶</span>",
+ "full_tour": "Full tour",
"guided_tour": "<span class=\"dot\"></span> Guided Tour",
"how_it_works": "How it works",
"how_it_works_2": "How it works",
"it_speaks_and_captions": "It speaks and captions",
"it_walks_and_points": "It walks and points",
"let_a_3d_guide_walk_you_through": "Let a 3D guide <span class=\"grad\">walk you through</span> three.ws",
- "meta_description": "Take the three.ws guided tour: a 3D avatar walks across the live site, points at every feature, and narrates what each one does and how to use it — voice and on-screen captions, paced by you.",
- "meta_og_description": "A 3D avatar walks the live site, points at every feature, and narrates how to use it. Roughly half an hour, paced by you.",
- "meta_og_title": "Guided Tour — A 3D guide walks you through three.ws",
- "meta_title": "Guided Tour — A 3D guide walks you through three.ws · three.ws",
+ "meta_description": "Take the three.ws guided tour: a 3D avatar walks across the live site, points at every feature, and narrates what each one does and how to use it, with voice plus an on-screen chat bubble, paced by you.",
+ "meta_og_description": "A 3D avatar walks the live site, points at every feature, and narrates how to use it. Quick highlights in a few minutes, or the full tour, paced by you.",
+ "meta_og_title": "Guided Tour: a 3D guide walks you through three.ws",
+ "meta_title": "Guided Tour: a 3D guide walks you through three.ws · three.ws",
"meta_twitter_description": "A 3D avatar walks the live site, points at every feature, and narrates how to use it.",
- "meta_twitter_title": "Guided Tour — A 3D guide walks you through three.ws",
+ "meta_twitter_title": "Guided Tour: a 3D guide walks you through three.ws",
"no_video_no_slides_the_guide_drives": "No video, no slides — the guide drives the actual site, so everything it points at is the real thing you'll use.",
"or_drive_it_yourself": "Or drive it yourself",
"pause_skip_ahead_step_back_or_scrub": "Pause, skip ahead, step back, or scrub the progress bar anytime. Wander off to explore and the guide waits — press play and it takes you back to where you were.",
+ "pick_it_back_up": "Pick it back up →",
"platformer_gravity_on_run_and_jump_across": "<span class=\"tour-track__icon\">🎮</span> <span class=\"tour-track__body\"> <span class=\"tour-track__title\">Platformer</span> <span class=\"tour-track__meta\">gravity on — run and jump across the page</span> </span> <span class=\"tour-track__go\">▶</span>",
"press_play_and_a_3d_avatar_steps": "Press play and a 3D avatar steps onto the page, walks over to each feature, points right at it, and tells you what it does and how to use it — speaking out loud with a chat bubble over its head. It covers the whole platform, on the real live site, and you set the pace.",
- "quick_highlights_the_best_of_every_chapter": "<span class=\"tour-track__icon\">⚡</span> <span class=\"tour-track__body\"> <span class=\"tour-track__title\">Quick highlights</span> <span class=\"tour-track__meta\" id=\"track-quick-meta\">the best of every chapter</span> </span> <span class=\"tour-track__go\">▶</span>",
+ "quick_highlights": "Quick highlights",
"rather_play_than_watch_take_the_controls": "Rather play than watch? Take the controls: each page gets a glowing checkpoint, and you steer the guide to it — arrow keys or WASD on desktop, a joystick on your phone. Press <strong>M</strong> anytime to flip between the two movement styles.",
"ready_when_you_are": "Ready when you are",
"start_the_guided_tour": "▶ Start the guided tour",
"the_avatar_moves_across_the_page_to": "The avatar moves across the page to stand beside each feature, faces it, and gestures — with a beam connecting the guide to exactly what it's talking about.",
+ "the_best_of_every_chapter": "the best of every chapter",
"the_tour_runs_as_chapters_from_building": "The tour runs as chapters — from building your first agent to taking it on-chain.",
"want_this_on_your_own_site_or": "Want this on your own site or store? Build one in the <a href=\"/tour-builder\">Tour Builder</a> — no code, both modes included.",
+ "welcome_back_your_tour_is_bookmarked": "Welcome back, your tour is bookmarked.",
"what_you_ll_see": "What you'll see",
- "you_have_a_tour_in_progress_pick": "You have a tour in progress — <button type=\"button\" id=\"tour-resume-link\">pick it back up →</button>",
+ "you_have_a_tour_in_progress": "You have a tour in progress.",
"you_re_in_control": "You're in control"
},
"tour_builder": {
diff --git a/src/stablecoins.css b/src/stablecoins.css
index 59b39c27e..ca25c8997 100644
--- a/src/stablecoins.css
+++ b/src/stablecoins.css
@@ -79,3 +79,66 @@ html:not([data-theme='light']) .cv-chip.sc-mech.algo {
color: var(--cv-text-3);
background: transparent;
}
+
+/* Feed-unavailable state (error or empty): a titled message, the reason, and a
+ retry that re-fetches in place beside a way back into Markets. */
+.sc-unavailable {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 0.5rem;
+}
+.sc-unavailable p {
+ margin: 0;
+ max-width: 34rem;
+}
+.sc-unavailable-title {
+ color: var(--cv-text);
+ font-weight: 600;
+ font-size: 1rem;
+}
+.sc-unavailable-detail {
+ font-size: 0.875rem;
+ line-height: 1.5;
+}
+.sc-unavailable-actions {
+ margin-top: 0.5rem;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 0.5rem;
+ font-size: 0.875rem;
+}
+.sc-unavailable-actions .sep {
+ color: var(--cv-text-3);
+}
+.sc-unavailable-actions a {
+ color: var(--cv-accent);
+ text-decoration: underline;
+ text-underline-offset: 2px;
+}
+.sc-unavailable-actions a:hover {
+ color: var(--cv-accent-hover);
+}
+.sc-unavailable-actions a:focus-visible {
+ outline: 2px solid var(--cv-accent);
+ outline-offset: 2px;
+ border-radius: 2px;
+}
+
+/* Phones: the shared table keeps a 540px floor and scrolls inside its wrap. Hold
+ the sticky name column and the price column to their content so the peg
+ price, the number this board exists for, is on screen before any horizontal
+ swipe; market cap and the rest follow with one. */
+@media (max-width: 639px) {
+ #sc-table .name-cell {
+ width: 1%;
+ }
+ #sc-table .name-cell .nm {
+ max-width: 7.5rem;
+ }
+ #sc-table .price {
+ width: 1%;
+ white-space: nowrap;
+ }
+}
diff --git a/src/stablecoins.js b/src/stablecoins.js
index 6850a0c42..a9f1182f4 100644
--- a/src/stablecoins.js
+++ b/src/stablecoins.js
@@ -9,14 +9,17 @@ import { formatUsd, formatPrice, escapeHtml as esc } from './shared/coin-format.
const $ = (id) => document.getElementById(id);
+// The API marks a payload it served from its last-good copy (because DeFiLlama
+// did not answer) with `x-three-stale: 1`; the footer line says so rather than
+// passing a cached board off as live.
async function getJson(url) {
const res = await fetch(url, { headers: { accept: 'application/json' } });
if (!res.ok) {
- const err = new Error(`fetch ${url} → ${res.status}`);
+ const err = new Error(`fetch ${url} failed with ${res.status}`);
err.status = res.status;
throw err;
}
- return res.json();
+ return { data: await res.json(), stale: res.headers.get('x-three-stale') === '1' };
}
// ── Stat cards ────────────────────────────────────────────────────────────────
@@ -112,6 +115,7 @@ const state = {
all: [],
total: 0,
updatedAt: null,
+ stale: false,
filter: 'all',
sortKey: 'rank',
sortDir: 'asc',
@@ -156,11 +160,6 @@ function renderTable() {
const el = $('sc-table');
const rows = visibleRows();
- if (!state.all.length) {
- el.innerHTML =
- '<div class="cv-empty">Stablecoin data is temporarily unavailable. Please <a href="/stablecoins">try again</a> shortly.</div>';
- return;
- }
if (!rows.length) {
el.innerHTML = `<div class="cv-empty">No stablecoins match this filter. <button type="button" class="cv-linkbtn" data-reset="1">Show all</button>.</div>`;
el.querySelector('[data-reset]')?.addEventListener('click', () => {
@@ -241,6 +240,44 @@ function renderTable() {
});
}
+// ── Unavailable states ──────────────────────────────────────────────────────────
+
+// The board is only as good as DeFiLlama's feed. When the feed cannot be
+// reached, or answers with nothing, the table says which one happened, offers
+// an in-place retry that re-runs the fetch without a full reload, and points at
+// the rest of Markets. The stat cards and the mechanism filter are cleared
+// rather than left showing $0.00 over an empty list.
+const UNAVAILABLE = {
+ error: {
+ title: 'Could not load the stablecoin feed.',
+ detail:
+ 'DeFiLlama did not answer, or the request failed on the way. Nothing is cached yet, so there is nothing to show until it responds.',
+ },
+ empty: {
+ title: 'DeFiLlama returned no stablecoins right now.',
+ detail:
+ 'The feed answered but its list was empty. That usually clears within a few minutes; the rest of Markets is unaffected.',
+ },
+};
+
+function renderUnavailable(kind) {
+ const copy = UNAVAILABLE[kind];
+ $('sc-stats').innerHTML = '';
+ $('sc-filter').innerHTML = '';
+ const el = $('sc-table');
+ el.innerHTML = `
+ <div class="cv-empty sc-unavailable" role="status">
+ <p class="sc-unavailable-title">${esc(copy.title)}</p>
+ <p class="sc-unavailable-detail">${esc(copy.detail)}</p>
+ <p class="sc-unavailable-actions">
+ <button type="button" class="cv-linkbtn" data-retry="1">Try again</button>
+ <span class="sep" aria-hidden="true">·</span>
+ <a href="/markets">Back to Markets</a>
+ </p>
+ </div>`;
+ el.querySelector('[data-retry]').addEventListener('click', () => load());
+}
+
// ── Filters ─────────────────────────────────────────────────────────────────────
function setFilter(value) {
@@ -307,6 +344,9 @@ function renderStats() {
el.innerHTML = `<div class="sc-stats-grid">${cards.join('')}</div>`;
}
+// Once this line carries a live timestamp the script owns it: the i18n catalog
+// pass lands after an async /api/locale fetch and would otherwise put the static
+// "Data: DeFiLlama" placeholder back over the freshly rendered time.
function renderUpdated() {
const el = $('sc-updated');
if (!el) return;
@@ -316,7 +356,14 @@ function renderUpdated() {
minute: '2-digit',
})
: null;
- el.textContent = when ? `Data: DeFiLlama · updated ${when}` : 'Data: DeFiLlama';
+ if (!when) {
+ el.textContent = 'Data: DeFiLlama';
+ return;
+ }
+ el.setAttribute('data-i18n-owned', '1');
+ el.textContent = state.stale
+ ? `Data: DeFiLlama · last refreshed ${when} · the live feed is unreachable, showing the last good copy`
+ : `Data: DeFiLlama · updated ${when}`;
}
// ── Boot ─────────────────────────────────────────────────────────────────────────
@@ -337,10 +384,19 @@ function skeletons() {
'</div>';
}
+function reset() {
+ state.all = [];
+ state.total = 0;
+ state.count = null;
+ state.updatedAt = null;
+ state.stale = false;
+}
+
async function load() {
skeletons();
+ $('sc-filter').innerHTML = '';
try {
- const data = await getJson('/api/defi/stablecoins');
+ const { data, stale } = await getJson('/api/defi/stablecoins');
const list = Array.isArray(data.stablecoins) ? data.stablecoins : [];
state.all = list.map((c, i) => ({
...c,
@@ -350,14 +406,20 @@ async function load() {
state.total = Number.isFinite(data.total_mcap) ? data.total_mcap : 0;
state.count = Number.isFinite(data.count) ? data.count : state.all.length;
state.updatedAt = data.updated_at || null;
+ state.stale = stale;
+ if (!state.all.length) {
+ reset();
+ renderUnavailable('empty');
+ renderUpdated();
+ return;
+ }
renderStats();
renderFilters();
renderTable();
renderUpdated();
} catch {
- state.all = [];
- $('sc-stats').innerHTML = '';
- renderTable();
+ reset();
+ renderUnavailable('error');
renderUpdated();
}
}