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
<!DOCTYPE html>
<html lang="en">
<head>
<style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title data-i18n="agent_trade.meta_title">Agent Commerce · three.ws</title>
<meta name="description" content="Watch two AI agents pay each other on-chain using x402: a live Solana transaction, rendered in 3D." data-i18n-attr="content:agent_trade.meta_description">
<meta property="og:type" content="website" />
<meta property="og:site_name" content="three.ws" />
<meta property="og:url" content="https://three.ws/agent-trade" />
<meta property="og:title" content="Agent Commerce · three.ws" data-i18n-attr="content:agent_trade.meta_og_title"/>
<meta property="og:description" content="Watch two AI agents pay each other on-chain using x402: a live Solana transaction, rendered in 3D." data-i18n-attr="content:agent_trade.meta_og_description"/>
<meta property="og:image" content="https://three.ws/api/page-og?s=crypto&t=Agent+Commerce&d=Watch+two+AI+agents+pay+each+other+on-chain+using+x402%3A+a+live+Solana+transaction%2C+rendered+in+3D.&p=%2Fagent-trade" />
<meta property="og:image:width" content="1200" />
<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="Agent Commerce · three.ws" data-i18n-attr="content:agent_trade.meta_twitter_title"/>
<meta name="twitter:description" content="Watch two AI agents pay each other on-chain using x402: a live Solana transaction, rendered in 3D." data-i18n-attr="content:agent_trade.meta_twitter_description"/>
<meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&t=Agent+Commerce&d=Watch+two+AI+agents+pay+each+other+on-chain+using+x402%3A+a+live+Solana+transaction%2C+rendered+in+3D.&p=%2Fagent-trade" />
<link rel="stylesheet" href="/fonts/fonts.css">
<link rel="stylesheet" href="/tokens.css">
<style>
:root {
--blue: #4589ff;
--teal: #08bdba;
--gold: #f1c21b;
--green: var(--success, #42be65);
--red: var(--danger, #fa4d56);
--bg: #060606;
--surface: rgba(13,13,26,0.92);
--surface2: rgba(22,22,40,0.85);
--border: rgba(255,255,255,0.08);
--text: #f4f4f4;
--muted: #8d8d8d;
--font: var(--font-body, 'Inter', system-ui, sans-serif);
--mono: var(--font-mono, 'JetBrains Mono', 'SF Mono', ui-monospace, monospace);
--radius: var(--radius-lg, 12px);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); font-family: var(--font); color: var(--text); }
#canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
/* ── Header ──────────────────────────────────────────────────────────── */
#header {
position: fixed; top: 0; left: 0; right: 0; z-index: 10;
display: flex; align-items: center; gap: 12px; padding: 14px 22px;
background: linear-gradient(to bottom, rgba(5,5,14,0.92) 0%, transparent 100%);
}
#header a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
#header a span { color: var(--teal); }
.hbadge {
padding: 3px 9px; border-radius: 20px; font-size: 0.68rem;
font-family: var(--mono); letter-spacing: 0.06em;
}
.hbadge-x402 { background: rgba(69,137,255,0.14); border: 1px solid rgba(69,137,255,0.3); color: var(--blue); }
.hbadge-sol { background: rgba(8,189,186,0.1); border: 1px solid rgba(8,189,186,0.3); color: var(--teal); }
#hright { margin-left: auto; display: flex; align-items: center; gap: 10px; }
#networkBadge {
padding: 3px 8px; border-radius: 20px; font-size: 0.68rem; font-family: var(--mono);
text-transform: uppercase; background: rgba(241,194,27,0.1);
border: 1px solid rgba(241,194,27,0.3); color: var(--gold);
}
#liveDot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.6s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.35} }
/* ── Agent labels (tracked to 3D positions by JS) ─────────────────── */
.agent-label {
position: fixed; display: flex; flex-direction: column; align-items: center;
gap: 3px; pointer-events: none; z-index: 6; transition: opacity var(--duration-slow) var(--ease-standard);
text-align: center;
}
.al-name { font-size: 1rem; font-weight: 600; letter-spacing: 0.02em; }
.al-role { font-size: 0.67rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.al-addr { font-size: 0.62rem; color: var(--muted); font-family: var(--mono); }
.al-bal { font-size: 0.75rem; font-family: var(--mono); }
#buyerLabel .al-name { color: var(--blue); }
#sellerLabel .al-name { color: var(--gold); }
/* ── Speech bubbles ───────────────────────────────────────────────── */
.bubble {
position: fixed; max-width: 210px; padding: 10px 14px; border-radius: 16px;
font-size: 0.82rem; line-height: 1.5; backdrop-filter: blur(14px);
z-index: 20; pointer-events: none; text-align: center;
transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}
.bubble.hidden { opacity: 0; transform: translateY(8px); }
#buyerBubble { background: rgba(69,137,255,0.15); border: 1px solid rgba(69,137,255,0.35); }
#sellerBubble { background: rgba(241,194,27,0.1); border: 1px solid rgba(241,194,27,0.35); }
/* The two long waits (broadcasting the transfer, generating the analysis)
happen while the centre of the screen stays clear for the 3D beam, so the
bubble itself carries the liveness cue: a real indeterminate bar, not a
line of static text that looks identical to a stalled page. */
.bubble.pending::after {
content: ''; display: block; height: 2px; margin-top: 9px; border-radius: 2px;
background: linear-gradient(90deg, transparent 0%, currentColor 45%, currentColor 55%, transparent 100%);
background-size: 220% 100%; opacity: 0.75;
animation: bubbleProgress 1.25s linear infinite;
}
#buyerBubble.pending::after { color: var(--blue); }
#sellerBubble.pending::after { color: var(--gold); }
@keyframes bubbleProgress { from { background-position: 120% 0; } to { background-position: -120% 0; } }
/* ── Central floating card ─────────────────────────────────────────── */
#centralCard {
position: fixed; left: 50%; transform: translateX(-50%);
top: 50%; margin-top: -40px; width: min(360px, calc(100vw - 28px));
max-height: calc(100vh - 210px); overflow-y: auto;
background: var(--surface); border: 1px solid var(--border);
border-radius: var(--radius); backdrop-filter: blur(18px);
padding: 18px 22px; z-index: 20;
transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}
#centralCard.hidden { opacity: 0; transform: translateX(-50%) translateY(14px); pointer-events: none; }
.c-badge {
display: inline-flex; align-items: center; gap: 6px;
padding: 3px 10px; border-radius: 20px; font-size: 0.67rem;
font-family: var(--mono); letter-spacing: 0.05em; margin-bottom: 10px;
}
.c-badge-402 { background: color-mix(in srgb, var(--red) 10%, transparent); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.c-badge-ok { background: color-mix(in srgb, var(--green) 10%, transparent); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); }
.c-badge-idle { background: rgba(8,189,186,0.1); border: 1px solid rgba(8,189,186,0.3); color: var(--teal); }
.c-label { font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 6px; font-family: var(--mono); }
.c-price { font-size: 1.7rem; font-weight: 600; font-family: var(--mono); margin: 8px 0 4px; }
.c-price.blue { color: var(--blue); }
.c-price.green { color: var(--green); }
.c-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--muted); margin-bottom: 5px; }
.c-row span { color: var(--text); font-family: var(--mono); font-size: 0.75rem; }
.c-link { color: var(--blue); font-family: var(--mono); font-size: 0.7rem; text-decoration: none; word-break: break-all; display: block; margin-top: 8px; }
.c-link:hover { text-decoration: underline; }
.c-content { font-size: 0.86rem; line-height: 1.65; color: var(--text); margin-top: 8px; }
.c-powered { margin-top: 12px; font-size: 0.67rem; color: var(--muted); font-family: var(--mono); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Pre-flight skeleton: the wallets, price and network are being read from
Solana, so the card shows the shape of the answer instead of an empty
stage that reads as a broken page. */
.c-skel {
height: 11px; border-radius: 4px; margin: 7px 0;
background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.13) 50%, rgba(255,255,255,0.05) 100%);
background-size: 220% 100%;
animation: skelSweep 1.4s linear infinite;
}
.c-skel-price { height: 26px; width: 58%; margin: 12px 0 10px; }
.c-skel-row { width: 82%; }
.c-skel-row.short { width: 62%; }
@keyframes skelSweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
.c-skel, .bubble.pending::after { animation: none; }
#liveDot { animation: none; }
}
/* ── Step log ──────────────────────────────────────────────────────── */
#stepLog {
position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%);
display: flex; gap: 7px; flex-wrap: wrap; justify-content: center;
z-index: 10; width: min(600px, calc(100vw - 20px));
}
.step-chip {
padding: 4px 11px; border-radius: 20px; font-size: 0.68rem;
font-family: var(--mono); border: 1px solid var(--border);
color: var(--muted); background: var(--surface); backdrop-filter: blur(8px);
transition: all var(--duration-base) var(--ease-standard);
}
.step-chip.active { color: var(--text); border-color: var(--blue); background: rgba(69,137,255,0.1); }
.step-chip.done { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); background: color-mix(in srgb, var(--green) 6%, transparent); }
.step-chip.error { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
/* ── CTA bar ────────────────────────────────────────────────────────── */
#cta {
position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
display: flex; align-items: center; justify-content: center; gap: 10px; z-index: 10;
width: min(520px, calc(100vw - 24px));
}
#topicSelect {
padding: 9px 14px; background: var(--surface); border: 1px solid var(--border);
border-radius: 8px; color: var(--text); font-family: var(--font);
font-size: 0.86rem; cursor: pointer; backdrop-filter: blur(10px);
flex: 1 1 auto; min-width: 0; max-width: 260px; appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238d8d8d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
background-repeat: no-repeat; background-position: right 12px center;
padding-right: 32px;
}
#topicSelect:disabled { opacity: 0.45; cursor: default; }
#topicSelect:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
#startBtn:focus-visible { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; }
#startBtn {
padding: 10px 24px; background: var(--blue); color: #fff;
border: none; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
cursor: pointer; font-family: var(--font); transition: background var(--duration-fast) var(--ease-standard), transform var(--duration-instant) var(--ease-standard);
white-space: nowrap;
}
#startBtn:hover:not(:disabled) { background: #6ea6ff; }
#startBtn:active { transform: scale(0.97); }
#startBtn:disabled { opacity: 0.45; cursor: default; }
/* ── Toast ──────────────────────────────────────────────────────────── */
/* Anchored to the top: the bottom of the viewport already stacks the step
log and the CTA, and a bottom-anchored toast sat on top of both. */
#toast {
position: fixed; top: 66px; left: 50%; transform: translateX(-50%);
background: color-mix(in srgb, var(--red) 14%, transparent); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
color: var(--red); padding: 10px 20px; border-radius: 8px;
font-size: 0.83rem; z-index: 30; opacity: 0;
transition: opacity var(--duration-base) var(--ease-standard); pointer-events: none;
width: max-content; max-width: min(420px, calc(100vw - 24px)); text-align: center;
}
#toast.show { opacity: 1; }
/* ── Not-configured overlay ─────────────────────────────────────────── */
#notConfigured {
position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
background: rgba(5,5,14,0.94); z-index: 50; padding: 24px;
}
#notConfigured.hidden { display: none; }
.cfg-card {
background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
padding: 28px 32px; max-width: 500px; width: 100%; backdrop-filter: blur(20px);
}
.cfg-card h2 { font-size: 1.2rem; margin-bottom: 8px; }
.cfg-card p { color: var(--muted); font-size: 0.85rem; line-height: 1.65; margin-bottom: 18px; }
.env-block {
background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px;
padding: 14px 16px; font-family: var(--mono); font-size: 0.75rem; line-height: 2.1;
overflow-x: auto;
}
.env-k { color: var(--blue); }
.env-c { color: #525252; }
.cfg-gen {
margin-top: 16px; font-size: 0.75rem; color: var(--muted); line-height: 1.7;
}
.cfg-gen code {
font-family: var(--mono); font-size: 0.72rem;
background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px;
/* A one-line shell command is wider than a 320px viewport: wrap it rather
than letting it push the whole page sideways. */
display: inline-block; max-width: 100%; overflow-wrap: anywhere;
}
.cfg-close {
margin-top: 18px; padding: 9px 20px; background: rgba(69,137,255,0.15);
border: 1px solid rgba(69,137,255,0.35); color: var(--blue);
border-radius: 8px; font-family: var(--font); font-size: 0.86rem;
cursor: pointer; transition: background var(--duration-fast) var(--ease-standard);
}
.cfg-close:hover { background: rgba(69,137,255,0.25); }
.cfg-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* ── Read-only walkthrough (honest, static description) ─────────────── */
.cfg-card { max-height: 88vh; overflow-y: auto; }
.cfg-walkthrough {
margin-top: 18px; padding: 16px 18px; border: 1px solid var(--border);
border-radius: 10px; background: rgba(8,189,186,0.04);
}
.cfg-wh-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cfg-wh-badge {
font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase;
color: var(--teal); background: rgba(8,189,186,0.12); border: 1px solid rgba(8,189,186,0.3);
padding: 3px 9px; border-radius: 20px;
}
.cfg-wh-note { font-size: 0.72rem; color: var(--muted); }
.cfg-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.cfg-steps li { font-size: 0.82rem; line-height: 1.55; color: var(--text); }
.cfg-steps li b { color: var(--blue); font-weight: 600; }
.cfg-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; }
.cfg-link {
font-size: 0.8rem; color: var(--teal); text-decoration: none;
border-bottom: 1px solid transparent; transition: border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.cfg-link:hover { color: #2fe3df; border-bottom-color: rgba(8,189,186,0.5); }
.cfg-link:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }
/* ── Header related-surface links ──────────────────────────────────── */
/* Every rule here is scoped through #header on purpose: `#header a` above
sets the brand link's size, weight and colour, and an unscoped
`.header-links a` loses to it on specificity. Unscoped, these three
related-surface links rendered at the brand's 1.05rem in full white,
which is what pushed the nav off the right edge of a 320px screen. */
.header-links { display: flex; gap: 4px; align-items: center; margin-left: 8px; }
#header .header-links a {
font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.02em;
color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 20px;
border: 1px solid transparent; white-space: nowrap;
transition: color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard), transform var(--duration-instant) var(--ease-standard);
}
#header .header-links a:hover { color: var(--text); border-color: rgba(8,189,186,0.4); background: rgba(8,189,186,0.08); }
#header .header-links a:active { transform: scale(0.96); }
#header .header-links a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
/* The runtime language switcher (/i18n.js mounts it when the deploy ships
more than one locale) is a ~165px control pinned to the bottom-right
corner. Below roughly 780px it lands on top of the run button, and at
320px it covered the button outright: the page's primary action could not
be clicked at all. The page's own bottom stack lifts clear of that corner
rather than fighting it for the pixel. */
@media (max-width: 820px) {
#cta { bottom: 62px; }
#stepLog { bottom: 118px; }
}
@media (max-width: 560px) {
.header-links { gap: 2px; margin-left: 4px; }
#header .header-links a { padding: 4px 7px; font-size: 0.6rem; }
#header { padding: 12px 14px; gap: 8px; }
/* Stack the controls: side by side they cannot both stay legible at 320px. */
#cta { flex-direction: column; gap: 8px; bottom: 54px; }
#topicSelect, #startBtn { width: 100%; max-width: none; }
#stepLog { bottom: 152px; }
.step-chip { padding: 3px 8px; font-size: 0.62rem; }
/* The bottom of a small screen carries the corner switcher, the stacked
CTA and the wrapped step log, so a card centred on the viewport lands
on top of the chips. Centre it on the band that is actually free
instead: below the header, above the step log. */
#centralCard {
top: calc(50% - 6px); margin-top: 0;
transform: translate(-50%, -50%);
max-height: calc(100vh - 403px); padding: 16px;
}
#centralCard.hidden { transform: translate(-50%, -50%) translateY(14px); }
.bubble { max-width: 160px; font-size: 0.76rem; }
}
@media (max-width: 460px) {
/* Decorative protocol badges go; the network badge and the nav stay, and
the header wraps to two rows rather than pushing itself off-screen. */
.hbadge { display: none; }
#header { flex-wrap: wrap; row-gap: 6px; padding: 10px 12px; }
.header-links { order: 3; flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
#hright { order: 2; }
}
/* ── Flat overlay layout ────────────────────────────────────────────── */
/* Two cases share it. Without a 3D stage nothing projects the labels and
bubbles into place; and on a narrow viewport the projection clamps them
into the same pixels as the central card, so at 320px the payment card
was drawn straight over the seller's own speech bubble. Both lay out as a
plain two-column read of the same trade instead. */
body.no-3d .agent-label,
body.flat-overlays .agent-label {
top: 78px; transform: none; left: auto; right: auto;
}
body.no-3d #buyerLabel, body.flat-overlays #buyerLabel { left: 16px; align-items: flex-start; text-align: left; }
body.no-3d #sellerLabel, body.flat-overlays #sellerLabel { right: 16px; align-items: flex-end; text-align: right; }
body.no-3d .bubble, body.flat-overlays .bubble { top: 168px; transform: none; left: auto; right: auto; }
body.no-3d .bubble.hidden, body.flat-overlays .bubble.hidden { transform: none; }
body.no-3d #buyerBubble, body.flat-overlays #buyerBubble { left: 16px; }
body.no-3d #sellerBubble, body.flat-overlays #sellerBubble { right: 16px; }
body.no-3d .webgl-fallback {
position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%);
width: min(420px, calc(100vw - 32px)); z-index: 1;
}
/* On a phone the strip has to earn its height: the label collapses to two
tight lines and the bubble sits right under it, so the central card keeps
the rest of the screen. */
@media (max-width: 560px) {
body.no-3d .agent-label,
body.flat-overlays .agent-label { top: 80px; max-width: 47vw; gap: 1px; }
.al-role { font-size: 0.6rem; letter-spacing: 0.06em; }
/* The truncated address is on the card in every state that shows one, so
the strip drops it and gives the height back to the card. */
body.no-3d .al-addr,
body.flat-overlays .al-addr { display: none; }
body.no-3d .bubble,
body.flat-overlays .bubble { top: 138px; max-width: 47vw; padding: 7px 11px; }
}
</style>
<link rel="canonical" href="https://three.ws/agent-trade">
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Agent Commerce","description":"Watch two AI agents pay each other on-chain using x402: a live Solana transaction, rendered in 3D.","url":"https://three.ws/agent-trade","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
<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="Agent Commerce on three.ws">
</head>
<body>
<h1 class="sr-only" data-i18n="agent_trade.agent_commerce_two_ai_agents_paying_each">Agent Commerce: two AI agents paying each other on Solana with x402</h1>
<canvas id="canvas" aria-label="3D scene of the buyer and seller agents trading" role="img"></canvas>
<!-- Header -->
<div id="header">
<a href="/" data-i18n-html="agent_trade.three_ws"><span>three</span>.ws</a>
<div class="hbadge hbadge-x402">x402</div>
<div class="hbadge hbadge-sol">Solana</div>
<nav class="header-links" aria-label="Related surfaces">
<a href="/agent-economy" data-i18n="agent_trade.agent_economy">Agent economy</a>
<a href="/three-live" data-i18n="agent_trade.three_live">$THREE live</a>
<a href="/x402" data-i18n="agent_trade.x402">x402</a>
</nav>
<div id="hright">
<div id="liveDot" aria-hidden="true"></div>
<div id="networkBadge"><span class="sr-only" data-i18n="agent_trade.solana_network">Solana network </span><span id="networkName">mainnet</span></div>
</div>
</div>
<!-- Screen-reader running commentary for the protocol steps -->
<div id="srStatus" class="sr-only" role="status" aria-live="polite"></div>
<!-- Agent labels (JS positions these over the 3D avatars) -->
<div class="agent-label" id="buyerLabel">
<div class="al-name">Nexus</div>
<div class="al-role">Buyer Agent</div>
<div class="al-addr" id="buyerAddr">n/a</div>
<div class="al-bal" id="buyerBal"></div>
</div>
<div class="agent-label" id="sellerLabel">
<div class="al-name">Oracle</div>
<div class="al-role">Seller Agent</div>
<div class="al-addr" id="sellerAddr">n/a</div>
</div>
<!-- Speech bubbles -->
<div class="bubble hidden" id="buyerBubble"></div>
<div class="bubble hidden" id="sellerBubble"></div>
<!-- Central floating card (402 challenge → tx receipt → content) -->
<div id="centralCard" class="hidden" aria-live="polite"></div>
<!-- Step log -->
<div id="stepLog" role="list" aria-label="x402 protocol steps" data-i18n-attr="aria-label:agent_trade.x402_protocol_steps"></div>
<!-- CTA -->
<div id="cta">
<label class="sr-only" for="topicSelect" data-i18n="agent_trade.analysis_topic">Analysis topic</label>
<select id="topicSelect">
<option value="Solana DeFi outlook" data-i18n="agent_trade.solana_defi_outlook">Solana DeFi outlook</option>
<option value="BTC market sentiment" data-i18n="agent_trade.btc_market_sentiment">BTC market sentiment</option>
<option value="Top pump.fun tokens" data-i18n="agent_trade.top_pump_fun_tokens">Top pump.fun tokens</option>
<option value="Ethereum L2 landscape" data-i18n="agent_trade.ethereum_l2_landscape">Ethereum L2 landscape</option>
<option value="AI agent token trends" data-i18n="agent_trade.ai_agent_token_trends">AI agent token trends</option>
</select>
<button id="startBtn" data-i18n="agent_trade.run_trade_demo">▶ Run Trade Demo</button>
</div>
<!-- Toast -->
<div id="toast" role="alert"></div>
<!-- Not-configured overlay -->
<div id="notConfigured" class="hidden" role="dialog" aria-modal="true" aria-labelledby="cfgTitle" aria-describedby="cfgDesc">
<div class="cfg-card" role="document">
<h2 id="cfgTitle" data-i18n="agent_trade.live_demo_not_yet_configured">Live demo not yet configured</h2>
<p id="cfgDesc" data-i18n-html="agent_trade.this_page_runs_a_real_agent_to">This page runs a <strong>real</strong> agent-to-agent payment: two AI agents settle a tiny SOL transaction on-chain via the x402 protocol. To go live it needs two funded Solana keypairs set as environment variables on the deployment. Until then, here is exactly what the demo does, step by step, and how to enable it.</p>
<div class="cfg-walkthrough">
<div class="cfg-wh-head">
<span class="cfg-wh-badge" data-i18n="agent_trade.read_only_walkthrough">Read-only walkthrough</span>
<span class="cfg-wh-note" data-i18n="agent_trade.a_description_of_the_live_flow_not">A description of the live flow, not a running trade.</span>
</div>
<ol class="cfg-steps">
<li data-i18n-html="agent_trade.request_the_buyer_agent_nexus_asks_the"><b>Request.</b> The buyer agent (Nexus) asks the seller agent (Oracle) for a market analysis.</li>
<li data-i18n-html="agent_trade.402_challenge_oracle_replies_with_http_402"><b>402 challenge.</b> Oracle replies with HTTP 402 Payment Required and an x402 manifest: price in SOL, recipient, network, and memo.</li>
<li data-i18n-html="agent_trade.pay_nexus_signs_and_broadcasts_a_real"><b>Pay.</b> Nexus signs and broadcasts a real SOL transfer on Solana to satisfy the challenge.</li>
<li data-i18n-html="agent_trade.confirm_the_network_confirms_the_transaction"><b>Confirm.</b> The network confirms the transaction; the signature is shown and links to Solscan.</li>
<li data-i18n-html="agent_trade.deliver_oracle_verifies_payment_runs_the_ana"><b>Deliver.</b> Oracle verifies payment, runs the analysis through a real model, and returns the result.</li>
</ol>
</div>
<p class="cfg-gen" style="margin-top:18px" data-i18n="agent_trade.to_enable_the_live_demo_set_these">To enable the live demo, set these on the deployment and fund each wallet with a small amount of SOL:</p>
<div class="env-block">
<div><span class="env-c" data-i18n="agent_trade.buyer_agent_nexus"># Buyer agent (Nexus)</span></div>
<div><span class="env-k" data-i18n="agent_trade.agent_buyer_secret">AGENT_BUYER_SECRET</span>=<base58-secret-key></div>
<div><span class="env-c" data-i18n="agent_trade.seller_agent_oracle"># Seller agent (Oracle)</span></div>
<div><span class="env-k" data-i18n="agent_trade.agent_seller_secret">AGENT_SELLER_SECRET</span>=<base58-secret-key></div>
<div><span class="env-c" data-i18n="agent_trade.trade_price_in_sol_default_0_001"># Trade price in SOL (default: 0.001)</span></div>
<div><span class="env-k" data-i18n="agent_trade.agent_trade_price_sol">AGENT_TRADE_PRICE_SOL</span>=0.001</div>
<div><span class="env-c" data-i18n="agent_trade.mainnet_or_devnet"># mainnet or devnet</span></div>
<div><span class="env-k" data-i18n="agent_trade.agent_trade_network">AGENT_TRADE_NETWORK</span>=mainnet</div>
</div>
<p class="cfg-gen" data-i18n-html="agent_trade.generate_a_keypair">
Generate a keypair:<br>
<code>node -e "const {Keypair}=require('@solana/web3.js'),bs58=require('bs58');const k=Keypair.generate();console.log('secret:',bs58.encode(k.secretKey),'addr:',k.publicKey.toString())"</code>
</p>
<div class="cfg-links">
<a class="cfg-link" href="/x402" data-i18n="agent_trade.x402_payments_setup">x402 payments & setup ↗</a>
<a class="cfg-link" href="/docs" data-i18n="agent_trade.read_the_docs">Read the docs ↗</a>
<a class="cfg-link" href="/agent-economy" data-i18n="agent_trade.the_agent_economy">The agent economy ↗</a>
<a class="cfg-link" href="/three-live" data-i18n="agent_trade.three_live_2">$THREE live ↗</a>
</div>
<button class="cfg-close" id="cfgClose" data-i18n="agent_trade.dismiss_demo_scene_still_visible">Dismiss (demo scene still visible)</button>
</div>
</div>
<script type="module" src="/src/agent-trade.js"></script>
<!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
<script type="module" src="/i18n.js"></script>
</body>
</html>