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.

feat(duels): link trader duels from the arena, quests, trade room and trader profiles

nirholasae6f3f871b79
diff --git a/pages/play/arena.html b/pages/play/arena.html
index ea4b68402..9a0c29752 100644
--- a/pages/play/arena.html
+++ b/pages/play/arena.html
@@ -428,6 +428,10 @@
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="10" cy="10" r="7"/><circle cx="10" cy="10" r="3.5"/><circle cx="10" cy="10" r=".6" fill="currentColor"/></svg>
<span class="nav-lbl">Quests</span>
</a>
+ <a class="btn arena-nav" href="/duels" title="Call which trader books more, free to play">
+ <svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3l7 7"/><path d="M17 3l-7 7"/><path d="M5.5 11.5l-2.5 2.5 3 3 2.5-2.5"/><path d="M14.5 11.5l2.5 2.5-3 3-2.5-2.5"/></svg>
+ <span class="nav-lbl">Duels</span>
+ </a>
<div class="spacer"></div>
<button class="btn primary" id="pickBtn">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="10" cy="6.5" r="3.2"/><path d="M4 17a6 6 0 0 1 12 0"/></svg>
diff --git a/src/quests.js b/src/quests.js
index 7484cc53b..b8d46a760 100644
--- a/src/quests.js
+++ b/src/quests.js
@@ -206,6 +206,7 @@ function linksSection() {
<div class="sy-actions">
<a class="sy-btn" href="/syndicates">Join a syndicate</a>
<a class="sy-btn" href="/play/arena">Watch the Arena</a>
+ <a class="sy-btn" href="/duels">Call a trader duel</a>
<a class="sy-btn" href="/docs/trading-quests">How quests are scored</a>
</div>
</section>`;
diff --git a/src/trade-room/main.js b/src/trade-room/main.js
index 6b3c83d28..59fb483a6 100644
--- a/src/trade-room/main.js
+++ b/src/trade-room/main.js
@@ -152,7 +152,7 @@ function renderLobbyShell() {
<section class="tr-lobby" aria-labelledby="tr-lobby-h">
<div class="tr-lobby-head">
<h2 id="tr-lobby-h">Rooms</h2>
- <a class="lb-btn" href="/leaderboard">Trader leaderboard</a>
+ <span class="tr-lobby-links"><a class="lb-btn" href="/duels">Trader duels</a><a class="lb-btn" href="/leaderboard">Trader leaderboard</a></span>
</div>
<div id="tr-lobby-grid" class="tr-grid" aria-live="polite" aria-busy="true">${skeletonHTML(6, 'card')}</div>
</section>`;
@@ -287,6 +287,7 @@ function renderRoom(data) {
<a class="lb-btn lb-btn-primary" href="/ghost-copy?leader=${encodeURIComponent(L.id)}&window=30d">Ghost-copy</a>
<a class="lb-btn" href="${traderHref}#tp-copy-panel">Copy trades</a>
<button type="button" class="lb-btn" id="tr-share">Share room</button>
+ <a class="lb-btn" href="/duels?agent=${encodeURIComponent(L.id)}">Call a duel</a>
</div>
${L.copiers ? `<p class="tr-dim tr-copiers">${L.copiers} ${L.copiers === 1 ? 'person copies' : 'people copy'} this trader</p>` : ''}
</section>
diff --git a/src/trade-room/trade-room.css b/src/trade-room/trade-room.css
index ea89383e2..e4e861e6c 100644
--- a/src/trade-room/trade-room.css
+++ b/src/trade-room/trade-room.css
@@ -71,6 +71,7 @@
margin-bottom: var(--space-sm);
}
.tr-lobby-head h2 { margin: 0; font-size: var(--text-lg); color: var(--ink-bright); }
+.tr-lobby-links { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: flex-end; }
.tr-lobby-note {
grid-column: 1 / -1;
margin: 0 0 var(--space-2xs);
diff --git a/src/trader.js b/src/trader.js
index f0513e31e..033d7ec56 100644
--- a/src/trader.js
+++ b/src/trader.js
@@ -14,6 +14,7 @@ import {
} from './trader-format.js';
import { mountCopyPanel } from './copy-panel.js';
import { mountTraderSyndicates } from './trader-syndicates.js';
+import { mountTraderDuels } from './trader-duels.js';
import { mountPassport, resetPassport } from './trader-passport.js';
import { walletChipHTML, wireWalletChips } from './shared/agent-wallet-chip.js';
import { embedSnippet } from './shared/trader-embed.js';
@@ -452,6 +453,7 @@ function render(data) {
<section class="tp-copy" id="tp-copy-panel"></section>
<section class="tp-copy" id="tp-syndicates" aria-label="Syndicates following this trader"></section>
+ <section class="tp-copy" id="tp-duels" aria-label="Trader duels featuring this trader"></section>
`;
wireTabs();
@@ -462,6 +464,7 @@ function render(data) {
const panel = document.getElementById('tp-copy-panel');
if (panel) mountCopyPanel(panel, { leaderAgentId: a.id, leaderName: a.name, network: ctx.network });
mountTraderSyndicates(document.getElementById('tp-syndicates'), { agentId: a.id, name: a.name, network: ctx.network });
+ mountTraderDuels(document.getElementById('tp-duels'), { agentId: a.id, name: a.name, network: ctx.network });
// Sweep the score ring to its real fill, and count the headline score + realized
// P&L from their previously-shown real values (so switching the window animates