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.

Jupiter swap client + buyback and oracle-coin surfaces

nirholas2aa5ef933fbe
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9d7d5e317..a870481b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **AR Studio: fill your room with 3D models, and forge new ones without leaving the camera** — Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model, with keyboard shortcuts on desktop. The models look like they belong: on supported Android phones they are lit by your actual room light and reflect it on metal and glass, and they hide correctly behind your real furniture; on every phone the lighting matches your room's brightness and colour. On Android each model also gets its own world anchor; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code that carries the exact arrangement, not just the model list. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition. (`/ar/studio`) `[feature]`
- **Avatar gallery previews now read clearly at a glance** — Gallery previews used to be shot dead-on against a near-black background, so dark models vanished and every card looked the same. Previews are now framed from a natural three-quarter angle, fill the card, and stand on a subtly tinted stage unique to each avatar. Prompt-created avatars also got more distinctive: sparse prompts like 'a knight' now commit to a specific look (age, build, hairstyle, palette, one signature detail) instead of converging on the same generic person. Every platform-generated avatar still appears in the galleries. (`/gallery`) `[improvement, fix]`
- **Avatar renders look studio-lit, not murky** — Every generated avatar and 3D identity is now rendered with real studio lighting. The image-based lighting the renderer was missing is the reason materials like leather, fabric, and metal used to crush to near-black; adding it, plus faithful color tone mapping, makes those surfaces read the way they look in a real 3D viewer. Faces are lit, boots and belts look like leather again, and the whole character stands out from the backdrop. This lifts the profile pictures and full-body shots the Agent Identity Studio produces, and the avatar thumbnails across the site. `[improvement]`
+- **Avatars made from your photo now match your actual face shape** — When you create an avatar from a selfie, it used to paint your face onto a generic head, so the shape (jaw, nose, brow, how wide your face is) stayed the same for everyone. Now the head is reshaped to your real face structure, so the avatar reads as you, not just your photo on a mannequin. The avatar still arrives fully rigged with all its facial expressions and lip-sync shapes intact, ready to animate. This is the first step of a bigger push toward photoreal, self-hosted avatars that beat the best avatar makers out there. `[improvement, feature]`
- **Avatars you generate now come out truly animation-ready** — We rebuilt the auto-rigging engine that turns a generated 3D character into a living avatar. Rigging now finishes in seconds instead of stalling for 20 minutes, produces a full standard skeleton with fingers that our entire animation library (walk, wave, dance, emotes) can drive immediately, keeps the model's original textures perfectly intact, and adds the 52 facial expression shapes used for emotions and lip-sync. Every piece of the new pipeline is MIT-licensed open source, so it works for everyone, everywhere. (`/forge`) `[feature, improvement, fix]`
- **Build your agent before signing in** — The agent creator no longer asks you to sign in before you can do anything. Anyone can now name their agent, give it a 3D body, pick its skills, and set its personality straight away — the same try-first flow the Forge already has. You only sign in at the very end, when your agent needs its wallet and on-chain identity to ship. If you do sign in at that point, everything you built is saved and restored automatically, so you land right back on the final step and finish in one click with nothing lost. `[improvement]`
- **Community feed hover previews no longer blend into the photo underneath** — Hovering a card in the Fresh from the Forge strip spins the actual 3D model in place. The spinning model used to render on a nearly transparent background, so it visually collided with the card's photo thumbnail and looked broken, with a stray browser tooltip on top. The preview now draws on a solid backdrop, the redundant tooltip is gone, image-to-3D cards are labeled with their engine name (Hunyuan3D) instead of an internal id, and every card can now be opened from the keyboard. (`/forge`) `[fix, improvement]`
@@ -56,12 +57,14 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **The avatar shop and animation bazaar are now discoverable by paying agents** — Two paid endpoints, the premium cosmetic shop and the animation download bazaar, were being skipped during automated x402 discovery: a probe that arrived without a specific item id got a 400/404 before the payment layer could answer, so directory crawlers read them as "not a paid endpoint" and never listed them. They now return a proper payment challenge to any credential-less probe, so agents can find them, see the price, and pay, while real buyers still get precise errors for a missing or unknown item. `[fix]`
- **The homepage AR showcase is a real, live gallery now** — The "Your 3D agent, in your room" section on the homepage got a full rebuild. It now leads with the top-voted community Forge models (deduped and interleaved by category, so every slide is a different subject instead of three of the same), rendered on a soft-lit floor so they read as sitting in a space rather than floating in a void. The gallery auto-advances with progress dots, a thumbnail paints instantly while each model streams in, and the next one is prefetched so browsing is seamless. The desktop QR and the new "Open this model in AR" link both drop the exact model on screen into your room, a live count shows how many models the community has forged, and the whole carousel is keyboard-navigable with screen-reader announcements. (`/`) `[improvement]`
- **The homepage community feed is now a live, browsable loop** — The strip of community models on the homepage used to be a fixed set of six. It is now a live feed you can actually browse: switch between Fresh and Trending, and press Show more to see more. New models made by anyone appear at the top on their own while you watch, with a live indicator so Right now stays honest. Each card still spins the real 3D model and opens it when clicked. (`/`) `[feature, improvement]`
+- **The homepage Forge grew the full studio's brains** — The mini-forge on the homepage is no longer just a prompt box on the free lane. An Options panel now unfolds under it with the same controls the full Forge runs on: choose a quality tier (Draft, Standard, or the $THREE-holder High tier, with hold-or-pay-per-generation built in), pick a specific engine or leave it on Auto (which routes to the best live lane and shows each engine's real up or down status), set the aspect ratio, and add your own provider key for keyed lanes. Two new one-tap helpers sit in the bar: Enhance rewrites your prompt into a richer, single-subject spec for sharper geometry, and Surprise rolls a fresh idea. The controls read the exact same catalog and health feed as the full page, so the two never drift, and the default view stays the clean single bar until you open Options. (`/`) `[feature, improvement]`
- **The homepage no longer greets you with an empty stage** — The live 3D agent on the homepage is the first thing you see, but on a cold visit it could sit as a blank near-black panel for several seconds while the model and 3D engine loaded. That gap is now filled with a gently breathing agent silhouette and a "summoning your agent" cue, so the stage feels alive from the very first paint instead of looking broken. It fades out the instant the real avatar is ready, respects reduced-motion settings, and if the preview ever stalls it now surfaces a retry instead of hanging on the placeholder. `[improvement]`
- **The live money feed now refuels itself** — The Money Pulse at three.ws/pulse streams real on-chain agent activity, so it only moves when the autonomous agents have SOL to spend. When that fuel ran out, the feed went quiet until someone topped it up by hand. It now keeps itself running: when the funding root can't cover the agents' costs, it converts a small, capped slice of the platform's own USDC revenue into SOL automatically, and agents whose wallets can no longer be signed for are retired from the pool instead of stalling it. The feed stays live without manual intervention. (`/pulse`) `[infra, fix]`
- **The Money Pulse is beating again** — The live money feed went quiet after the July 7 infrastructure move: the switch that powers the autonomous agent activity loop did not survive the migration, so agents stopped tipping, trading, paying and launching. The switch is back on and the feed is live again, with real on-chain tips, trades, payments and coin launches flowing within minutes of the fix. The production runbook now documents the switch so a future migration cannot silently drop it. (`/pulse`) `[fix, infra]`
- **The Money Pulse now tells you which token each trade was** — Trade and snipe beats in the live Money Pulse at three.ws/pulse used to read only "traded ◎0.012" with no hint of what was bought or sold, while launches already named the coin. Every trade now leads with the token: its $SYMBOL when we can name it (resolved from our token cache and platform launches), or a short mint address when we can't, with the full mint on hover. Across the last 200 real trades, 198 resolve to a symbol. The same identity shows up in the compact pulse ticker embedded around the site. (`/pulse`) `[improvement]`
- **The status page now shows whether 3D generations are actually succeeding** — Until now the status page could only tell you the generation servers were online, not whether the models they produce are coming out successfully. Those are different things: a server can be up and still fail a large share of jobs, which is exactly what happened during a recent stretch where image-to-3D quietly failed far too often while every uptime check stayed green. The status page and health feed now report the live 3D generation success rate, and flag which engine and input type are struggling when it dips, so a bad patch surfaces in minutes instead of days. (`/status`) `[infra, improvement]`
- **The status page now tracks whether paid API calls actually settle, not just whether the payment rail is switched on** — The July payment-settlement bug ran for eight days before anyone noticed, because every health check reported the x402 rail as 'armed' and the discovery endpoint as 'up' while a third of real settlements were quietly failing. The public status page and /api/healthz now carry a new signal, x402 settlement success, that reads the actual settle outcomes over a rolling window and reports the success rate. It counts only genuine payment-rail faults (server errors, rejected payments, RPC failures) and ignores unrelated noise, and it pages operations the moment the rate drops, so a silent settlement regression surfaces in hours instead of days. (`/status`) `[infra, improvement]`
+- **The status page stopped falsely flagging Coin Intelligence** — The public status page (three.ws/status) had a Coin Intelligence line that was permanently stuck on "timeout", even though the feed itself was healthy and updating on schedule. The economy heartbeat was pinging the Coin Intelligence firehose on a one-minute clock and giving up after 60 seconds, but that firehose is designed to listen to the live pump.fun launch stream for about 85 seconds each run and already runs on its own dedicated two-minute schedule. So the extra ping never once finished in time and always reported a false failure. We removed the duplicate ping. Coin Intelligence keeps running on its proper schedule, and the status page now reflects reality instead of a phantom outage. (`/status`) `[fix, infra]`
- **The viewer's Create buttons now take you straight to the Forge** — On the shared-model viewer page, the "Create a 3D model" button (shown when a link is missing its model) and the "Make your own" button in the footer used to drop you on the homepage, leaving you to hunt for the generator. Both now go directly to the free text-to-3D Forge so you can start creating in one click. (`/viewer`) `[fix]`
- **three.ws now speaks 11 languages, across the whole site** — three.ws is now multilingual in 11 languages: English, Spanish, Simplified Chinese, Japanese, Korean, French, German, Brazilian Portuguese, Arabic, Hindi, and Russian. Translation went from the home page alone to the pages people actually read first: What is three.ws, Pricing, Partners, the pitch deck, the SDK and oracle docs, and more. Every page shows a language picker in the corner, your choice is remembered, and if your browser is set to one of these languages three.ws greets you in it automatically. Arabic lays out right-to-left. Brand and protocol terms like $THREE, USDC, and three.ws stay exact in every language, and search engines are told about each translated page so they can rank it. Behind the scenes a new tool annotates a page's copy for translation in one command, so adding the rest of the site is now fast. `[feature, improvement]`
- **You can now see exactly which build is live** — The status page at three.ws/status now shows the exact version running in production: the commit it was built from (linked to the source), the release version, the Cloud Run revision, and when it was built. Developers can read the same details as JSON from a new /api/version endpoint. It closes a real gap: before this, confirming that a deploy actually shipped meant cross-referencing server timestamps by hand. Now it's one glance, or one request. (`/status`) `[infra, improvement]`
diff --git a/api/_lib/token/buyback.js b/api/_lib/token/buyback.js
index 864b1f2c4..83f315db2 100644
--- a/api/_lib/token/buyback.js
+++ b/api/_lib/token/buyback.js
@@ -30,6 +30,7 @@ import { submitProtected } from '../execution-engine.js';
import { SOLANA_USDC_MINT } from '../../payments/_config.js';
import { TOKEN_MINT, TOKEN_DECIMALS } from './config.js';
import { treasuryWallet, treasuryWalletOrNull } from './config.js';
+import { jupiterQuote as jupQuote, jupiterSwapTx as jupSwapTx } from './jupiter.js';
import {
computeSpend,
deployedPct,
@@ -42,8 +43,6 @@ import {
atomicsToTokens,
} from './buyback-math.js';
-const JUP_QUOTE_URL = 'https://lite-api.jup.ag/swap/v1/quote';
-const JUP_SWAP_URL = 'https://lite-api.jup.ag/swap/v1/swap';
const MEMO_PROGRAM_ID = 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr';
// ── policy knobs (env, with safe defaults) ──────────────────────────────────
@@ -112,49 +111,19 @@ async function splBalanceAtomics(connection, ownerPk, mintPk) {
}
}
-async function fetchJson(url, opts) {
- const r = await fetch(url, opts);
- const body = await r.json().catch(() => ({}));
- if (!r.ok) {
- throw Object.assign(new Error(`jupiter ${r.status}: ${JSON.stringify(body).slice(0, 200)}`), {
- code: 'jupiter_error',
- status: r.status,
- });
- }
- return body;
-}
-
/** ExactIn quote: how much $THREE `usdcAtomics` of USDC buys. */
async function jupiterQuote(usdcAtomics) {
- const u = new URL(JUP_QUOTE_URL);
- u.searchParams.set('inputMint', SOLANA_USDC_MINT);
- u.searchParams.set('outputMint', TOKEN_MINT);
- u.searchParams.set('amount', String(usdcAtomics));
- u.searchParams.set('slippageBps', String(slippageBps()));
- u.searchParams.set('swapMode', 'ExactIn');
- return fetchJson(u.toString(), { headers: { accept: 'application/json' } });
+ return jupQuote({
+ inputMint: SOLANA_USDC_MINT,
+ outputMint: TOKEN_MINT,
+ amount: usdcAtomics,
+ slippageBps: slippageBps(),
+ });
}
-/** Build the signed-by-us swap transaction (base64) for `quote`. */
+/** Build the (unsigned) swap transaction (base64) for `quote`. */
async function jupiterSwapTx(quote, userPublicKey) {
- const data = await fetchJson(JUP_SWAP_URL, {
- method: 'POST',
- headers: { 'content-type': 'application/json', accept: 'application/json' },
- body: JSON.stringify({
- quoteResponse: quote,
- userPublicKey,
- // USDC→$THREE never touches wrapped SOL; let Jupiter manage the $THREE ATA.
- wrapAndUnwrapSol: false,
- dynamicComputeUnitLimit: true,
- prioritizationFeeLamports: {
- priorityLevelWithMaxLamports: { maxLamports: 1_000_000, priorityLevel: 'medium' },
- },
- }),
- });
- if (!data.swapTransaction) {
- throw Object.assign(new Error('jupiter returned no swapTransaction'), { code: 'no_swap_tx' });
- }
- return data.swapTransaction;
+ return jupSwapTx({ quote, userPublicKey, wrapAndUnwrapSol: false });
}
// ── plan ──────────────────────────────────────────────────────────────────-
diff --git a/api/_lib/token/jupiter.js b/api/_lib/token/jupiter.js
new file mode 100644
index 000000000..f29a93478
--- /dev/null
+++ b/api/_lib/token/jupiter.js
@@ -0,0 +1,78 @@
+// Shared Jupiter (lite-api) swap client for the $THREE token lanes.
+//
+// The programmatic buyback (buyback.js) and the x402 micro-buy loop (microbuy.js)
+// both market-buy $THREE on Jupiter. This module is the ONE place that talks to
+// the Jupiter quote + swap API so the two lanes can never drift on endpoint, error
+// handling, or transaction-build options. It builds nothing on-chain and holds no
+// keys — callers own signing, broadcasting, and confirmation.
+//
+// BUY-ONLY by construction: nothing here sells $THREE. Every helper is a generic
+// (inputMint → outputMint) swap primitive; the $THREE lanes only ever call it with
+// outputMint = $THREE, and there is no sell path anywhere in the token/ tree.
+
+const JUP_QUOTE_URL = 'https://lite-api.jup.ag/swap/v1/quote';
+const JUP_SWAP_URL = 'https://lite-api.jup.ag/swap/v1/swap';
+
+/**
+ * GET a Jupiter route + throw a coded error on a non-2xx / unparseable response,
+ * so a caller records the precise reason instead of an opaque failure.
+ */
+export async function fetchJson(url, opts) {
+ const r = await fetch(url, opts);
+ const body = await r.json().catch(() => ({}));
+ if (!r.ok) {
+ throw Object.assign(new Error(`jupiter ${r.status}: ${JSON.stringify(body).slice(0, 200)}`), {
+ code: 'jupiter_error',
+ status: r.status,
+ });
+ }
+ return body;
+}
+
+/**
+ * ExactIn quote: how much `outputMint` a given `amount` of `inputMint` buys.
+ * @param {{ inputMint: string, outputMint: string, amount: bigint|number|string, slippageBps: number }} args
+ * @returns {Promise<object>} the raw Jupiter quoteResponse
+ */
+export async function jupiterQuote({ inputMint, outputMint, amount, slippageBps }) {
+ const u = new URL(JUP_QUOTE_URL);
+ u.searchParams.set('inputMint', inputMint);
+ u.searchParams.set('outputMint', outputMint);
+ u.searchParams.set('amount', String(amount));
+ u.searchParams.set('slippageBps', String(slippageBps));
+ u.searchParams.set('swapMode', 'ExactIn');
+ return fetchJson(u.toString(), { headers: { accept: 'application/json' } });
+}
+
+/**
+ * Build the (unsigned) swap transaction (base64) for a quote. The caller
+ * deserializes, signs, broadcasts, and confirms it.
+ * @param {{ quote: object, userPublicKey: string, wrapAndUnwrapSol?: boolean, maxPriorityLamports?: number, priorityLevel?: string }} args
+ * @returns {Promise<string>} base64 VersionedTransaction bytes
+ */
+export async function jupiterSwapTx({
+ quote,
+ userPublicKey,
+ wrapAndUnwrapSol = false,
+ maxPriorityLamports = 1_000_000,
+ priorityLevel = 'medium',
+}) {
+ const data = await fetchJson(JUP_SWAP_URL, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', accept: 'application/json' },
+ body: JSON.stringify({
+ quoteResponse: quote,
+ userPublicKey,
+ // USDC→$THREE never touches wrapped SOL; let Jupiter manage the $THREE ATA.
+ wrapAndUnwrapSol,
+ dynamicComputeUnitLimit: true,
+ prioritizationFeeLamports: {
+ priorityLevelWithMaxLamports: { maxLamports: maxPriorityLamports, priorityLevel },
+ },
+ }),
+ });
+ if (!data.swapTransaction) {
+ throw Object.assign(new Error('jupiter returned no swapTransaction'), { code: 'no_swap_tx' });
+ }
+ return data.swapTransaction;
+}
diff --git a/api/pulse.js b/api/pulse.js
index b5a332b21..dc375d2e1 100644
--- a/api/pulse.js
+++ b/api/pulse.js
@@ -938,6 +938,8 @@ export default async function handler(req, res) {
const view = url.searchParams.get('view') || 'feed';
const agentId = url.searchParams.get('agent_id') || null;
if (agentId && !isUuid(agentId)) return error(res, 400, 'validation_error', 'agent_id must be a uuid');
+ const mint = url.searchParams.get('mint') || null;
+ if (mint && !/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(mint)) return error(res, 400, 'validation_error', 'mint must be a base58 address');
const typeRaw = url.searchParams.get('type') || 'all';
const type = TYPE_KINDS[typeRaw] ? typeRaw : 'all';
const cursor = url.searchParams.get('cursor');
@@ -988,7 +990,7 @@ export default async function handler(req, res) {
// Default: feed. A delta poll (`since`) is never cached — it must be live.
// A first page (no cursor/since) of the GLOBAL feed is cached briefly to
// shield the DB from a thundering herd of pollers.
- const isFirstGlobalPage = !cursor && !since && !agentId;
+ const isFirstGlobalPage = !cursor && !since && !agentId && !mint;
if (isFirstGlobalPage) {
// `limit` is part of the cache key: handleFeed returns exactly `limit` rows
// (plus has_more / next_cursor computed from it), so two callers asking for
@@ -999,14 +1001,14 @@ export default async function handler(req, res) {
const cacheKey = `pulse:feed:${network}:${type}:${limit}`;
let body = await cacheGet(cacheKey);
if (body === null) {
- body = await handleFeed(req, res, { network, type, agentId, cursor, since });
+ body = await handleFeed(req, res, { network, type, agentId, mint, cursor, since });
await cacheSet(cacheKey, body, FEED_TTL_S);
}
res.setHeader('cache-control', 'public, max-age=8');
return json(res, 200, { data: body });
}
- const body = await handleFeed(req, res, { network, type, agentId, cursor, since });
+ const body = await handleFeed(req, res, { network, type, agentId, mint, cursor, since });
return json(res, 200, { data: body });
} catch (e) {
if (isDbUnavailableError(e)) {
diff --git a/data/changelog.json b/data/changelog.json
index 0a22340d5..39f4e1415 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$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-17",
+ "title": "The status page stopped falsely flagging Coin Intelligence",
+ "summary": "The public status page (three.ws/status) had a Coin Intelligence line that was permanently stuck on \"timeout\", even though the feed itself was healthy and updating on schedule. The economy heartbeat was pinging the Coin Intelligence firehose on a one-minute clock and giving up after 60 seconds, but that firehose is designed to listen to the live pump.fun launch stream for about 85 seconds each run and already runs on its own dedicated two-minute schedule. So the extra ping never once finished in time and always reported a false failure. We removed the duplicate ping. Coin Intelligence keeps running on its proper schedule, and the status page now reflects reality instead of a phantom outage.",
+ "tags": [
+ "fix",
+ "infra"
+ ],
+ "link": "/status"
+ },
{
"date": "2026-07-17",
"title": "The homepage Forge grew the full studio's brains",
diff --git a/pages/home.html b/pages/home.html
index c2b014d4a..0356f30dd 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -4799,6 +4799,9 @@
}
// Warm the browser cache for the next model's GLB so cycling feels instant.
+ // A bare rel=prefetch is a low-priority speculative hint: unlike as=fetch with
+ // a CORS mode, it never forces a preflight the CDN might reject, so it stays
+ // silent when a bucket omits cross-origin headers. Best-effort by design.
let prefetchLink = null;
function prefetchNext() {
if (models.length < 2) return;
@@ -4807,8 +4810,6 @@
if (!prefetchLink) {
prefetchLink = document.createElement('link');
prefetchLink.rel = 'prefetch';
- prefetchLink.as = 'fetch';
- prefetchLink.crossOrigin = 'anonymous';
document.head.appendChild(prefetchLink);
}
prefetchLink.href = next.glb_url;
diff --git a/public/changelog.json b/public/changelog.json
index 6f600c11d..d69953118 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-17T23:32:41.630Z",
+ "generated_at": "2026-07-17T23:34:02.259Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -109,6 +109,17 @@
"improvement"
]
},
+ {
+ "date": "2026-07-17",
+ "type": "update",
+ "title": "Avatars made from your photo now match your actual face shape",
+ "summary": "When you create an avatar from a selfie, it used to paint your face onto a generic head, so the shape (jaw, nose, brow, how wide your face is) stayed the same for everyone. Now the head is reshaped to your real face structure, so the avatar reads as you, not just your photo on a mannequin. The avatar still arrives fully rigged with all its facial expressions and lip-sync shapes intact, ready to animate. This is the first step of a bigger push toward photoreal, self-hosted avatars that beat the best avatar makers out there.",
+ "link": null,
+ "tags": [
+ "improvement",
+ "feature"
+ ]
+ },
{
"date": "2026-07-17",
"type": "update",
@@ -532,6 +543,17 @@
"improvement"
]
},
+ {
+ "date": "2026-07-17",
+ "type": "update",
+ "title": "The homepage Forge grew the full studio's brains",
+ "summary": "The mini-forge on the homepage is no longer just a prompt box on the free lane. An Options panel now unfolds under it with the same controls the full Forge runs on: choose a quality tier (Draft, Standard, or the $THREE-holder High tier, with hold-or-pay-per-generation built in), pick a specific engine or leave it on Auto (which routes to the best live lane and shows each engine's real up or down status), set the aspect ratio, and add your own provider key for keyed lanes. Two new one-tap helpers sit in the bar: Enhance rewrites your prompt into a richer, single-subject spec for sharper geometry, and Surprise rolls a fresh idea. The controls read the exact same catalog and health feed as the full page, so the two never drift, and the default view stays the clean single bar until you open Options.",
+ "link": "/",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-07-17",
"type": "update",
@@ -596,6 +618,17 @@
"improvement"
]
},
+ {
+ "date": "2026-07-17",
+ "type": "update",
+ "title": "The status page stopped falsely flagging Coin Intelligence",
+ "summary": "The public status page (three.ws/status) had a Coin Intelligence line that was permanently stuck on \"timeout\", even though the feed itself was healthy and updating on schedule. The economy heartbeat was pinging the Coin Intelligence firehose on a one-minute clock and giving up after 60 seconds, but that firehose is designed to listen to the live pump.fun launch stream for about 85 seconds each run and already runs on its own dedicated two-minute schedule. So the extra ping never once finished in time and always reported a false failure. We removed the duplicate ping. Coin Intelligence keeps running on its proper schedule, and the status page now reflects reality instead of a phantom outage.",
+ "link": "/status",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-07-17",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 07d55554c..6af057bde 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -86,6 +86,14 @@
<category>improvement</category>
<description>Every generated avatar and 3D identity is now rendered with real studio lighting. The image-based lighting the renderer was missing is the reason materials like leather, fabric, and metal used to crush to near-black; adding it, plus faithful color tone mapping, makes those surfaces read the way they look in a real 3D viewer. Faces are lit, boots and belts look like leather again, and the whole character stands out from the backdrop. This lifts the profile pictures and full-body shots the Agent Identity Studio produces, and the avatar thumbnails across the site.</description>
</item>
+ <item>
+ <title>Avatars made from your photo now match your actual face shape</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-17:Avatars made from your photo now match your actual face shape</guid>
+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>When you create an avatar from a selfie, it used to paint your face onto a generic head, so the shape (jaw, nose, brow, how wide your face is) stayed the same for everyone. Now the head is reshaped to your real face structure, so the avatar reads as you, not just your photo on a mannequin. The avatar still arrives fully rigged with all its facial expressions and lip-sync shapes intact, ready to animate. This is the first step of a bigger push toward photoreal, self-hosted avatars that beat the best avatar makers out there.</description>
+ </item>
<item>
<title>Avatars you generate now come out truly animation-ready</title>
<link>https://three.ws/forge</link>
@@ -406,6 +414,14 @@
<category>feature</category>
<description>The strip of community models on the homepage used to be a fixed set of six. It is now a live feed you can actually browse: switch between Fresh and Trending, and press Show more to see more. New models made by anyone appear at the top on their own while you watch, with a live indicator so Right now stays honest. Each card still spins the real 3D model and opens it when clicked.</description>
</item>
+ <item>
+ <title>The homepage Forge grew the full studio's brains</title>
+ <link>https://three.ws/</link>
+ <guid isPermaLink="false">2026-07-17:The homepage Forge grew the full studio's brains</guid>
+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The mini-forge on the homepage is no longer just a prompt box on the free lane. An Options panel now unfolds under it with the same controls the full Forge runs on: choose a quality tier (Draft, Standard, or the $THREE-holder High tier, with hold-or-pay-per-generation built in), pick a specific engine or leave it on Auto (which routes to the best live lane and shows each engine's real up or down status), set the aspect ratio, and add your own provider key for keyed lanes. Two new one-tap helpers sit in the bar: Enhance rewrites your prompt into a richer, single-subject spec for sharper geometry, and Surprise rolls a fresh idea. The controls read the exact same catalog and health feed as the full page, so the two never drift, and the default view stays the clean single bar until you open Options.</description>
+ </item>
<item>
<title>The homepage no longer greets you with an empty stage</title>
<link>https://three.ws/changelog</link>
@@ -454,6 +470,14 @@
<category>infra</category>
<description>The July payment-settlement bug ran for eight days before anyone noticed, because every health check reported the x402 rail as 'armed' and the discovery endpoint as 'up' while a third of real settlements were quietly failing. The public status page and /api/healthz now carry a new signal, x402 settlement success, that reads the actual settle outcomes over a rolling window and reports the success rate. It counts only genuine payment-rail faults (server errors, rejected payments, RPC failures) and ignores unrelated noise, and it pages operations the moment the rate drops, so a silent settlement regression surfaces in hours instead of days.</description>
</item>
+ <item>
+ <title>The status page stopped falsely flagging Coin Intelligence</title>
+ <link>https://three.ws/status</link>
+ <guid isPermaLink="false">2026-07-17:The status page stopped falsely flagging Coin Intelligence</guid>
+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The public status page (three.ws/status) had a Coin Intelligence line that was permanently stuck on &quot;timeout&quot;, even though the feed itself was healthy and updating on schedule. The economy heartbeat was pinging the Coin Intelligence firehose on a one-minute clock and giving up after 60 seconds, but that firehose is designed to listen to the live pump.fun launch stream for about 85 seconds each run and already runs on its own dedicated two-minute schedule. So the extra ping never once finished in time and always reported a false failure. We removed the duplicate ping. Coin Intelligence keeps running on its proper schedule, and the status page now reflects reality instead of a phantom outage.</description>
+ </item>
<item>
<title>The viewer's Create buttons now take you straight to the Forge</title>
<link>https://three.ws/viewer</link>
diff --git a/public/features.json b/public/features.json
index 0c9e808b4..5e6acf5b9 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-17T23:32:41.560Z",
+ "generated_at": "2026-07-17T23:34:02.240Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/locales/en.json b/public/locales/en.json
index d7619286d..8d5fc098e 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -3447,6 +3447,7 @@
"gate_any_skill_wrap_any_mcp_tool": "<strong>Gate any skill</strong> — wrap any MCP tool or agent response behind a paywall",
"gate_skills_behind_pay_per_call_micropayment": "Gate skills behind <span data-term=\"pay-per-call\">pay-per-call (micropayments)</span> USDC payments. Keep 100% during open beta. Watch earnings flow in real-time from your dashboard.",
"generate_your_own_model": "Generate your own model →",
+ "open_this_model_in_ar": "Open this model in AR →",
"generate_yours": "Generate yours →",
"generation_failed": "Generation failed",
"get_api_key": "Get API key <span class=\"arrow\">&rarr;</span>",
diff --git a/public/locales/es.json b/public/locales/es.json
index 6cf6577cd..978c01275 100644
--- a/public/locales/es.json
+++ b/public/locales/es.json
@@ -3783,8 +3783,8 @@
"forge_it": "Forge it",
"hero_forge_placeholder": "describe anything: a brass compass, weathered…",
"hero_forge_note": "Free, no sign-up, a real textured model in about a minute. <a href=\"/forge\">Open the full Forge →</a>",
- "feed_empty_top": "",
- "feed_empty_fresh": ""
+ "feed_empty_top": "No trending models yet this week. Check back after a few votes, or browse Fresh.",
+ "feed_empty_fresh": "Nothing here yet. Be the first to forge one."
},
"ibm_hello": {
"01forge": "<span class=\"n\">01</span>Forge",
diff --git a/public/oracle-coin.css b/public/oracle-coin.css
index 83f83960e..1ac9ff3e3 100644
--- a/public/oracle-coin.css
+++ b/public/oracle-coin.css
@@ -218,7 +218,34 @@ button { font: inherit; color: inherit; cursor: pointer; }
.oc-chart-readout { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px 0; font: 700 15px/1 var(--mono); }
.oc-chart-readout .mkt-up, .oc-chart-readout .mkt-down, .oc-chart-readout .mkt-flat { font-size: 12px; }
.oc-chart-price { color: var(--ink); }
-@media (prefers-reduced-motion: reduce) { .oc-chart-skel { animation: none; } }
+/* agent-trade markers on the native chart */
+.oc-chart-svg .oc-mk { cursor: default; }
+.oc-chart-svg .oc-mk circle { transition: r .12s ease; }
+.oc-chart-svg .oc-mk:hover circle { r: 6.4; }
+.oc-chart-legend { display: flex; align-items: center; gap: 7px; padding: 6px 14px 12px; font: 600 10.5px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
+.oc-chart-legend .oc-lg { width: 9px; height: 9px; border-radius: 50%; border: 1.4px solid var(--bg); display: inline-block; }
+.oc-chart-legend .oc-lg.buy { background: var(--up); margin-left: 4px; }
+.oc-chart-legend .oc-lg.sell { background: var(--down); margin-left: 12px; }
+.oc-chart-legend .oc-lg-ct { margin-left: auto; color: var(--muted); text-transform: none; letter-spacing: 0; }
+@media (prefers-reduced-motion: reduce) { .oc-chart-skel { animation: none; } .oc-chart-svg .oc-mk circle { transition: none; } }
+
+/* agent transactions list */
+.oc-agent-tx { margin-top: 22px; }
+.oc-agent-tx:empty { display: none; }
+.oc-atx-list { display: flex; flex-direction: column; gap: 3px; }
+.oc-atx-row { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,0.035); border: 1px solid var(--line); font-size: 12.5px; }
+.oc-atx-side { font: 700 10.5px/1 var(--mono); letter-spacing: .04em; min-width: 52px; flex-shrink: 0; }
+.oc-atx-side.buy { color: var(--up); }
+.oc-atx-side.sell { color: var(--down); }
+.oc-atx-agent { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+a.oc-atx-agent:hover { text-decoration: underline; }
+.oc-atx-amt { font: 600 12px/1 var(--mono); color: var(--ink); white-space: nowrap; flex-shrink: 0; }
+.oc-atx-amt .oc-atx-usd { color: var(--muted); }
+.oc-atx-time { color: var(--faint); font-size: 11px; white-space: nowrap; flex-shrink: 0; min-width: 40px; text-align: right; }
+.oc-atx-tx { color: var(--faint); font-size: 11px; text-decoration: none; flex-shrink: 0; }
+.oc-atx-tx:hover { color: var(--ink); }
+.oc-atx-more { display: inline-block; margin-top: 10px; }
+@media (max-width: 560px) { .oc-atx-time { display: none; } }
/* states */
.state { padding: 40px 22px; text-align: center; color: var(--muted); }
diff --git a/public/oracle-coin.js b/public/oracle-coin.js
index b9c05c8ba..5c0376e96 100644
--- a/public/oracle-coin.js
+++ b/public/oracle-coin.js
@@ -363,22 +363,69 @@
// ── price chart ────────────────────────────────────────────────────────────
// A TradingView-grade candlestick view via the DexScreener embed (keyed by the
- // mint, resolves the most-liquid pair itself), plus a native SVG line chart from
- // /api/pump/price-history for coins still on the bonding curve with no DEX pair.
+ // mint, resolves the most-liquid pair itself), a native SVG line chart from
+ // /api/pump/price-history for coins still on the bonding curve with no DEX pair,
+ // and an "Agent trades" view that overlays every three.ws agent's buys and sells
+ // as bubbles on that native series — each plotted at the candle close nearest its
+ // on-chain timestamp (the same at-or-before-the-event technique the tweet-price
+ // chart uses), so you can see exactly where the machine economy moved this coin.
const CHART_KEY = 'oc_chart_view';
+ // Agent transactions for this coin (from /api/pulse?mint=…). Fetched once per
+ // mint, shared by the chart-marker overlay and the "Agent transactions" list.
+ let AGENT_TRADES = [];
+
function dexEmbedUrl(mint) {
const theme = document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark';
const p = new URLSearchParams({ embed: '1', loadChartSettings: '0', theme, chartTheme: theme, chartType: 'usd', interval: '15', info: '0' });
return `https://dexscreener.com/solana/${encodeURIComponent(mint)}?${p}`;
}
- function areaChartSvg(points) {
+ // Every three.ws agent transaction in one coin, newest first. Normalised for
+ // both the marker overlay (needs tSec + side) and the list (needs labels). Never
+ // throws: a failure just yields an empty overlay and an empty list.
+ async function fetchAgentTrades(mint) {
+ try {
+ const { ok, data } = await api(`/api/pulse?type=trades&mint=${encodeURIComponent(mint)}&network=${NETWORK}&limit=50`, { timeout: 10000 });
+ const body = data && data.data; // /api/pulse wraps its payload as { data: { events } }
+ if (!ok || !body || !Array.isArray(body.events)) { AGENT_TRADES = []; return AGENT_TRADES; }
+ AGENT_TRADES = body.events.map((e) => {
+ const ms = new Date(e.ts).getTime();
+ return {
+ tSec: Math.floor(ms / 1000),
+ tsMs: ms,
+ side: e.side === 'sell' ? 'sell' : 'buy',
+ sol: e.sol != null ? Number(e.sol) : null,
+ usd: e.usd != null ? Number(e.usd) : null,
+ agent_name: e.agent?.name || 'Agent',
+ agent_url: e.agent?.url || null,
+ explorer: e.explorer || null,
+ };
+ }).filter((t) => Number.isFinite(t.tSec));
+ return AGENT_TRADES;
+ } catch { AGENT_TRADES = []; return AGENT_TRADES; }
+ }
+
+ // Price at (or just before) an epoch-seconds instant — the candle close at or
+ // immediately preceding it, so a marker sits on the line the way the trade saw
+ // the market. `pts` is ascending by `t`.
+ function priceAt(pts, tSec) {
+ let lo = 0, hi = pts.length - 1, ans = 0;
+ while (lo <= hi) { const mid = (lo + hi) >> 1; if (pts[mid].t <= tSec) { ans = mid; lo = mid + 1; } else hi = mid - 1; }
+ return pts[ans]?.c ?? pts[0]?.c ?? 0;
+ }
+
+ function areaChartSvg(points, markers = []) {
const w = 720, h = 240, volH = 38, priceH = h - volH, pad = { t: 12, r: 8, b: 4, l: 8 };
const closes = points.map((p) => p.c), vols = points.map((p) => p.v || 0);
const min = Math.min(...closes), max = Math.max(...closes), span = (max - min) || max || 1, maxVol = Math.max(...vols) || 1;
const innerW = w - pad.l - pad.r, innerH = priceH - pad.t - pad.b;
- const x = (i) => pad.l + (i / Math.max(1, points.length - 1)) * innerW;
+ // Time-based x so on-chain trade timestamps land on the right spot, not on an
+ // evenly-spaced index. Falls back to index spacing if the series has no time.
+ const t0 = points[0].t, t1 = points[points.length - 1].t, tspan = (t1 - t0) || 1;
+ const hasTime = Number.isFinite(t0) && Number.isFinite(t1) && t1 > t0;
+ const xt = (tSec) => pad.l + ((Math.max(t0, Math.min(t1, tSec)) - t0) / tspan) * innerW;
+ const x = hasTime ? ((i) => xt(points[i].t)) : ((i) => pad.l + (i / Math.max(1, points.length - 1)) * innerW);
const y = (v) => pad.t + innerH - ((v - min) / span) * innerH;
const up = points.length > 1 && closes[closes.length - 1] >= closes[0];
const col = up ? 'var(--up)' : 'var(--down)';
@@ -389,35 +436,97 @@
const bh = Math.max(1, (p.v / maxVol) * (volH - 6)), bx = x(i) - barW / 2, by = h - bh - 2;
return `<rect x="${bx.toFixed(1)}" y="${by.toFixed(1)}" width="${barW.toFixed(1)}" height="${bh.toFixed(1)}" rx="1" fill="${p.c >= p.o ? 'var(--up)' : 'var(--down)'}" opacity="0.45"/>`;
}).join('');
- return `<svg viewBox="0 0 ${w} ${h}" preserveAspectRatio="none" class="oc-chart-svg" role="img" aria-label="Price history chart" style="color:${col}">
+ // Agent-trade bubbles. Cluster markers that collapse to the same ~9px column +
+ // side so a busy window reads as a few labelled dots, not a smear; a cluster of
+ // N shows a count. Buys sit just under the price line, sells just over it.
+ let markSvg = '';
+ if (hasTime && markers.length) {
+ const buckets = new Map();
+ for (const m of markers) {
+ if (m.tSec < t0 - tspan * 0.02) continue; // far left of window → skip
+ const px = xt(m.tSec), py = y(priceAt(points, m.tSec));
+ const key = `${Math.round(px / 9)}:${m.side}`;
+ const b = buckets.get(key);
+ if (b) { b.n++; b.usd += m.usd || 0; }
+ else buckets.set(key, { px, py, side: m.side, n: 1, usd: m.usd || 0, name: m.agent_name });
+ }
+ markSvg = [...buckets.values()].map((b) => {
+ const buy = b.side === 'buy';
+ const mc = buy ? 'var(--up)' : 'var(--down)';
+ const cy = b.py + (buy ? 8 : -8);
+ const label = b.n > 1
+ ? `${b.n} agent ${buy ? 'buys' : 'sells'} · $${b.usd.toFixed(2)} total`
+ : `${b.name} ${buy ? 'bought' : 'sold'}${b.usd ? ` · $${b.usd.toFixed(2)}` : ''}`;
+ const badge = b.n > 1
+ ? `<text x="${b.px.toFixed(1)}" y="${(cy + 2.6).toFixed(1)}" text-anchor="middle" font-size="6.5" font-weight="700" fill="#0b0f14">${b.n > 9 ? '9+' : b.n}</text>`
+ : '';
+ return `<g class="oc-mk"><title>${esc(label)}</title>`
+ + `<line x1="${b.px.toFixed(1)}" y1="${b.py.toFixed(1)}" x2="${b.px.toFixed(1)}" y2="${cy.toFixed(1)}" stroke="${mc}" stroke-width="1" opacity="0.5"/>`
+ + `<circle cx="${b.px.toFixed(1)}" cy="${cy.toFixed(1)}" r="${b.n > 1 ? 5.4 : 4}" fill="${mc}" stroke="var(--bg,#0b0f14)" stroke-width="1.4"/>`
+ + badge + `</g>`;
+ }).join('');
+ }
+ return `<svg viewBox="0 0 ${w} ${h}" preserveAspectRatio="none" class="oc-chart-svg" role="img" aria-label="Price history with agent trades" style="color:${col}">
<defs><linearGradient id="ocgrad" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="currentColor" stop-opacity="0.25"/><stop offset="100%" stop-color="currentColor" stop-opacity="0"/></linearGradient></defs>
${bars}
<line x1="${pad.l}" y1="${priceH}" x2="${w - pad.r}" y2="${priceH}" stroke="var(--line)" stroke-width="1"/>
<path d="${area}" fill="url(#ocgrad)" stroke="none"/>
<path d="${line}" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/>
+ ${markSvg}
</svg>`;
}
- async function loadNativeChart(canvas, mint) {
+ // Choose an OHLC window + interval wide enough to contain the agent trades we
+ // want to plot, so markers never pile up against the right edge. Without markers
+ // it stays the tight 36h live view.
+ function chartWindow(markers) {
+ const now = Math.floor(Date.now() / 1000);
+ let from = now - 36 * 3600;
+ if (markers.length) {
+ const earliest = Math.min(...markers.map((m) => m.tSec));
+ from = Math.min(from, earliest - 3600); // one candle of lead-in
+ }
+ const span = now - from, DAY = 86400;
+ const cap = 30 * DAY;
+ if (span > cap) from = now - cap;
+ const s = now - from;
+ const interval = s <= 2 * DAY ? '15m' : s <= 7 * DAY ? '1h' : s <= 21 * DAY ? '4h' : '1D';
+ const label = s <= 2 * DAY ? `${Math.round(s / 3600)}h` : `${Math.round(s / DAY)}d`;
+ return { from, to: now, interval, label };
+ }
+
+ async function loadNativeChart(canvas, mint, opts = {}) {
+ const markers = opts.markers || [];
canvas.innerHTML = '<div class="oc-chart-skel"></div>';
- const to = Math.floor(Date.now() / 1000), from = to - 36 * 3600;
- const { ok, data } = await api(`/api/pump/price-history?mint=${encodeURIComponent(mint)}&interval=15m&from=${from}&to=${to}`, { timeout: 12000 });
+ const { from, to, interval, label } = chartWindow(markers);
+ const { ok, data } = await api(`/api/pump/price-history?mint=${encodeURIComponent(mint)}&interval=${interval}&from=${from}&to=${to}`, { timeout: 12000 });
const pts = ((data && data.data) || []).filter((p) => Number.isFinite(p.c));
if (!ok || pts.length < 2) { canvas.innerHTML = '<div class="state" style="padding:34px 0">Chart appears once this coin has trade history.</div>'; return; }
const first = pts[0].c, last = pts[pts.length - 1].c;
const chg = changeStr(first ? ((last - first) / first) * 100 : 0);
- canvas.innerHTML = `<div class="oc-chart-readout"><span class="oc-chart-price">${fmtPrice(last)}</span><span class="mkt-${chg.cls}">${chg.txt} · 36h</span></div>${areaChartSvg(pts)}`;
+ const plotted = markers.filter((m) => m.tSec >= pts[0].t).length;
+ const legend = markers.length
+ ? `<div class="oc-chart-legend"><span class="oc-lg buy"></span>agent buy<span class="oc-lg sell"></span>agent sell<span class="oc-lg-ct">${plotted} plotted</span></div>`
+ : '';
+ canvas.innerHTML = `<div class="oc-chart-readout"><span class="oc-chart-price">${fmtPrice(last)}</span><span class="mkt-${chg.cls}">${chg.txt} · ${label}</span></div>${areaChartSvg(pts, markers)}${legend}`;
}
function mountChart(container, mint) {
let stored = null; try { stored = localStorage.getItem(CHART_KEY); } catch {}
+ const hasTrades = AGENT_TRADES.length > 0;
const preCurve = BOOT.pump && !BOOT.pump.complete; // no DEX pair yet → native by default
- const view = stored || (preCurve ? 'line' : 'candles');
+ // When agents have traded this coin, lead with the annotated view so their
+ // moves are on the chart the instant the page opens; otherwise honour the last
+ // choice, then default to candles (or native pre-DEX).
+ let view = stored || (hasTrades ? 'trades' : preCurve ? 'line' : 'candles');
+ if (view === 'trades' && !hasTrades) view = preCurve ? 'line' : 'candles';
+ const tradesBtn = hasTrades ? `<button type="button" class="oc-seg-btn${view === 'trades' ? ' on' : ''}" data-view="trades">Agent trades</button>` : '';
container.innerHTML = `<div class="dr-sec" style="margin-top:0">Price <span style="color:var(--faint);font-weight:400;font-size:10px">live</span></div>
<div class="oc-chart-controls">
<div class="oc-seg">
<button type="button" class="oc-seg-btn${view === 'candles' ? ' on' : ''}" data-view="candles">Candles</button>
<button type="button" class="oc-seg-btn${view === 'line' ? ' on' : ''}" data-view="line">Line</button>
+ ${tradesBtn}
</div>
<a class="dr-act" href="https://dexscreener.com/solana/${encodeURIComponent(mint)}" target="_blank" rel="noopener">DexScreener ↗</a>
</div>
@@ -437,14 +546,48 @@
// Embed blocked / offline → fall back to the native line chart.
watchdog = setTimeout(() => { if (!canvas.classList.contains('ready')) loadNativeChart(canvas, mint); }, 9000);
}
+ function render(v) {
+ clearTimeout(watchdog);
+ if (v === 'candles') renderCandles();
+ else if (v === 'trades') loadNativeChart(canvas, mint, { markers: AGENT_TRADES });
+ else loadNativeChart(canvas, mint);
+ }
function apply(v) {
try { localStorage.setItem(CHART_KEY, v); } catch {}
container.querySelectorAll('.oc-seg-btn').forEach((b) => b.classList.toggle('on', b.dataset.view === v));
- clearTimeout(watchdog);
- if (v === 'candles') renderCandles(); else loadNativeChart(canvas, mint);
+ render(v);
}
container.querySelectorAll('.oc-seg-btn').forEach((b) => b.addEventListener('click', () => apply(b.dataset.view)));
- if (view === 'candles') renderCandles(); else loadNativeChart(canvas, mint);
+ render(view);
+ }
+
+ // ── agent transactions list ─────────────────────────────────────────────────
+ // The same events the chart plots, as a scannable ledger: who traded, which way,
+ // how much, when, and a link out to the on-chain proof and the agent's profile.
+ function renderAgentTx(mint) {
+ const wrap = $('#ocAgentTx');
+ if (!wrap) return;
+ const trades = AGENT_TRADES;
+ if (!trades.length) { wrap.innerHTML = ''; return; }
+ const buys = trades.filter((t) => t.side === 'buy').length;
+ const rows = trades.slice(0, 12).map((t) => {
+ const buy = t.side === 'buy';
+ const amt = t.sol != null ? fmtSol(t.sol) : '';
+ const usd = t.usd != null ? `$${t.usd.toFixed(2)}` : '';
+ const name = esc(t.agent_name);
+ const nameEl = t.agent_url ? `<a class="oc-atx-agent" href="${esc(t.agent_url)}">${name}</a>` : `<span class="oc-atx-agent">${name}</span>`;
+ const tx = t.explorer ? `<a class="oc-atx-tx" href="${esc(t.explorer)}" target="_blank" rel="noopener">tx ↗</a>` : '';
+ return `<div class="oc-atx-row">
+ <span class="oc-atx-side ${buy ? 'buy' : 'sell'}">${buy ? '▲ BUY' : '▼ SELL'}</span>
+ ${nameEl}
+ <span class="oc-atx-amt">${esc(amt)}${usd ? ` <span class="oc-atx-usd">${esc(usd)}</span>` : ''}</span>
+ <span class="oc-atx-time">${esc(ago(t.tsMs))}</span>
+ ${tx}
+ </div>`;
+ }).join('');
+ wrap.innerHTML = `<div class="dr-sec">Agent transactions <span style="color:var(--faint);font-weight:400;font-size:10px">${trades.length} on three.ws · ${buys} buys / ${trades.length - buys} sells</span></div>
+ <div class="oc-atx-list">${rows}</div>
+ ${trades.length > 12 ? `<a class="dr-act oc-atx-more" href="/pulse?mint=${encodeURIComponent(mint)}">Every agent transaction in this coin →</a>` : ''}`;
}
async function loadSentiment(mint) {
@@ -623,12 +766,13 @@
// The conviction-independent scaffold: identity is already in the SSR hero, so
// market + live trades render immediately for ANY mint. The conviction column
// fills in (or shows an "observing" state) once /api/oracle/coin resolves.
- function buildScaffold(mint) {
+ async function buildScaffold(mint) {
const deep = $('#ocDeep');
if (!deep) return;
deep.innerHTML = `
<div id="ocTake"></div>
<div id="ocChart" class="oc-chart"></div>
+ <div id="ocAgentTx" class="oc-agent-tx"></div>
<div id="ocHistory"></div>
<div class="oc-cols">
<div id="ocConviction">
@@ -645,6 +789,11 @@
<div id="ocRelated"></div>
</div>
</div>`;
+ // Load this coin's agent transactions before the chart mounts so the annotated
+ // "Agent trades" view can lead by default and the list renders together. The
+ // fetch is fast and never throws; on failure both simply stay empty.
+ await fetchAgentTrades(mint);
+ renderAgentTx(mint);
const chartEl = $('#ocChart');
if (chartEl) mountChart(chartEl, mint);
loadMarket(mint);
diff --git a/src/shared/money-pulse.js b/src/shared/money-pulse.js
index 52d0c611b..1f093b4ae 100644
--- a/src/shared/money-pulse.js
+++ b/src/shared/money-pulse.js
@@ -211,6 +211,18 @@ function shortMint(mint) {
return `${mint.slice(0, 4)}…${mint.slice(-4)}`;
}
+// Where a row navigates. Coin-moving events (a trade, a snipe, a launch that
+// resolved a mint) link straight to that coin's rich detail page — so "traded
+// $three" is one click from the token's chart, market, and every agent that has
+// traded it. Everything else (tips, payments, skill purchases) links to the
+// agent whose wallet moved. The coin page is the same destination the ticker and
+// the coin-scoped feed use, so the linkage is consistent across every surface.
+function eventHref(ev) {
+ const coinKind = ev.kind === 'trade' || ev.kind === 'snipe' || ev.kind === 'launch';
+ if (coinKind && ev.mint) return `/oracle/coin/${ev.mint}`;
+ return ev.agent?.url || (ev.mint ? `/oracle/coin/${ev.mint}` : '#');
+}
+
// The traded-token chip: "$SYMBOL" when the mint resolves to a known token,
// otherwise the elided mint (e.g. "4h3K…9xQr"). Empty when no token is known
// (generic SOL spends), so the sentence gracefully reads "traded ◎0.012".
@@ -284,9 +296,10 @@ function rowEl(ev) {
const k = KIND_META[ev.kind] || KIND_META.trade;
const a = document.createElement('a');
a.className = `mp-row ${k.cls}`;
- a.href = ev.agent?.url || (ev.mint ? `/oracle/coin/${ev.mint}` : '#');
+ a.href = eventHref(ev);
a.dataset.id = ev.id;
- a.setAttribute('aria-label', `${ev.agent?.name || 'Agent'} ${k.verb} — ${timeAgo(ev.ts)}`);
+ const coinPart = (ev.symbol || ev.coin_name) ? ` ${ev.symbol ? `$${ev.symbol}` : ev.coin_name}` : '';
+ a.setAttribute('aria-label', `${ev.agent?.name || 'Agent'} ${k.verb}${coinPart} — ${timeAgo(ev.ts)}`);
a.appendChild(avatarEl(ev.agent));
@@ -363,7 +376,7 @@ function tickEl(ev) {
const k = KIND_META[ev.kind] || KIND_META.trade;
const a = document.createElement('a');
a.className = `mp-tick ${k.cls}`;
- a.href = ev.agent?.url || (ev.mint ? `/oracle/coin/${ev.mint}` : '/pulse');
+ a.href = eventHref(ev) === '#' ? '/pulse' : eventHref(ev);
const amt = fmtAmount(ev);
// Name the token on trade/snipe ticks too, mirroring the full feed row.
const tradeTok = (ev.kind === 'trade' || ev.kind === 'snipe') && (ev.symbol || ev.mint)