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.

Add Oracle conviction badges to sniper positions and copy intents

nirholasd34d0582e7c3
diff --git a/src/dashboard-next/pages/copy.js b/src/dashboard-next/pages/copy.js
index 928167ecc..ac703db8d 100644
--- a/src/dashboard-next/pages/copy.js
+++ b/src/dashboard-next/pages/copy.js
@@ -66,6 +66,11 @@ const STYLE = `
.cp-skeleton { height: 56px; border-radius: 10px; background: var(--nxt-bg-2); animation: cp-pulse 1.4s ease infinite; }
@keyframes cp-pulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
.cp-note { font-size: 12px; color: var(--nxt-ink-faint); margin: 0 0 14px; }
+.cp-oracle { display: inline-flex; }
+.cp-ob { display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 2px 7px; text-decoration: none; font-size: 11px; transition: border-color .12s; }
+.cp-ob:hover { border-color: rgba(255,255,255,0.22); }
+.cp-ob-score { font-weight: 700; font-variant-numeric: tabular-nums; }
+.cp-ob-tier { font-size: 8.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
@media (max-width: 560px) { .cp-item { grid-template-columns: 1fr; } .cp-side { justify-content: flex-start; } .cp-av { display: none; } }
</style>`;
@@ -76,13 +81,15 @@ function intentRow(e) {
const isBuy = e.direction === 'buy';
const amount = isBuy ? `<span class="cp-amt">${fmtSol(e.planned_sol)}</span>` : `<span class="cp-tag sell">Exit your copy</span>`;
const proof = e.leader_buy_sig ? `<a href="https://solscan.io/tx/${esc(e.leader_buy_sig)}" target="_blank" rel="noopener">leader tx ↗</a>` : '';
+ const mintAttr = e.mint ? ` data-oracle-mint="${esc(e.mint)}"` : '';
return `
- <div class="cp-item" data-id="${esc(e.id)}">
+ <div class="cp-item" data-id="${esc(e.id)}"${mintAttr}>
<img class="cp-av" src="${esc(img(e))}" alt="" onerror="this.style.visibility='hidden'" />
<div class="cp-mid">
<div class="cp-title">
<span class="cp-tag ${isBuy ? 'buy' : 'sell'}">${isBuy ? 'BUY' : 'SELL'}</span>
${esc(e.symbol || e.name || 'coin')}
+ <span class="cp-oracle"></span>
<span class="cp-sub" style="margin:0">via <a href="${traderHref(e.leader_agent_id)}">${esc(e.leader_name || 'trader')}</a></span>
</div>
<div class="cp-sub">${relTime(e.created_at)} · ${proof}</div>
@@ -156,6 +163,33 @@ function historyRow(e) {
</div>`;
}
+const CP_TIER_COLOR = { prime: '#c084fc', strong: '#34d399', lean: '#fbbf24', watch: '#94a3b8', avoid: '#f87171' };
+
+async function enrichIntentOracle(container) {
+ if (!container) return;
+ const rows = container.querySelectorAll('[data-oracle-mint]');
+ if (!rows.length) return;
+ const mints = [...new Set([...rows].map((r) => r.dataset.oracleMint).filter(Boolean))];
+ if (!mints.length) return;
+ try {
+ const r = await fetch(`/api/oracle/batch?mints=${mints.map(encodeURIComponent).join(',')}&network=mainnet`);
+ if (!r.ok) return;
+ const { results = {} } = await r.json();
+ for (const row of rows) {
+ const mint = row.dataset.oracleMint;
+ const d = results[mint];
+ if (!d || d.score == null) continue;
+ const badge = row.querySelector('.cp-oracle');
+ if (!badge || badge.hasChildNodes()) continue;
+ const color = CP_TIER_COLOR[d.tier] || '#94a3b8';
+ badge.innerHTML = `<a class="cp-ob" href="/oracle?mint=${encodeURIComponent(mint)}" title="Oracle conviction: ${d.score} (${d.tier})">
+ <span class="cp-ob-score" style="color:${color}">${d.score}</span>
+ <span class="cp-ob-tier" style="color:${color}">${d.tier}</span>
+ </a>`;
+ }
+ } catch { /* non-fatal */ }
+}
+
async function loadAndRender(host) {
let subs, pending, history, earnings;
try {
@@ -194,6 +228,9 @@ async function loadAndRender(host) {
</section>
</div>`;
+ // Enrich pending intent rows with Oracle conviction badges
+ enrichIntentOracle(host.querySelector('#cp-pending'));
+
// Intent actions
host.querySelector('#cp-pending')?.addEventListener('click', async (e) => {
const btn = e.target.closest('[data-act]');
diff --git a/src/dashboard-next/pages/sniper.js b/src/dashboard-next/pages/sniper.js
index ad798da43..f98ecb860 100644
--- a/src/dashboard-next/pages/sniper.js
+++ b/src/dashboard-next/pages/sniper.js
@@ -114,7 +114,7 @@ const STYLE = `<style>
.sn-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nxt-success); animation: sn-pulse 2s ease infinite; }
@keyframes sn-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.sn-pos-list { padding: 0; }
-.sn-pos-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--nxt-line); }
+.sn-pos-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--nxt-line); }
.sn-pos-row:last-child { border-bottom: 0; }
.sn-pos-info { min-width: 0; }
.sn-pos-sym { font-weight: 600; font-size: 14px; }
@@ -122,6 +122,11 @@ const STYLE = `<style>
.sn-pos-pnl { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.sn-pos-link { font-size: 12px; color: var(--nxt-accent); text-decoration: none; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--nxt-accent) 35%, transparent); border-radius: var(--nxt-radius-sm); white-space: nowrap; transition: background .12s; }
.sn-pos-link:hover { background: color-mix(in srgb, var(--nxt-accent) 12%, transparent); }
+.sn-pos-oracle { display: inline-flex; }
+.sn-ob { display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 3px 7px; text-decoration: none; transition: border-color .12s; }
+.sn-ob:hover { border-color: rgba(255,255,255,0.22); }
+.sn-ob-score { font: 700 11px/1 var(--nxt-mono, monospace); font-variant-numeric: tabular-nums; }
+.sn-ob-tier { font: 600 8px/1 var(--nxt-mono, monospace); text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.sn-empty { color: var(--nxt-ink-faint); font-size: 13px; padding: 24px 16px; text-align: center; }
/* new strategy cta */
@@ -450,6 +455,7 @@ function renderPositions(positions) {
return;
}
el.innerHTML = positions.map(posRow).join('');
+ enrichPositionOracle();
}
function posRow(p) {
@@ -458,16 +464,46 @@ function posRow(p) {
const link = p.entry_buy_sig && p.entry_buy_sig !== 'SIMULATED'
? `<a class="sn-pos-link" href="${solscanTx(p.entry_buy_sig)}" target="_blank" rel="noopener">Solscan ↗</a>`
: p.mint ? `<a class="sn-pos-link" href="${pumpUrl(p.mint)}" target="_blank" rel="noopener">pump.fun ↗</a>` : '';
- return `<div class="sn-pos-row">
+ const mintAttr = p.mint ? ` data-oracle-mint="${esc(p.mint)}"` : '';
+ return `<div class="sn-pos-row"${mintAttr}>
<div class="sn-pos-info">
<div class="sn-pos-sym">${esc(p.symbol || p.mint?.slice(0, 8) || '—')}</div>
<div class="sn-pos-sub">${esc(p.agent_name || '')} · opened ${relTime(p.opened_at)}</div>
</div>
<div class="sn-pos-pnl">${pnlStr}</div>
+ <span class="sn-pos-oracle"></span>
${link}
</div>`;
}
+const SN_TIER_COLOR = { prime: '#c084fc', strong: '#34d399', lean: '#fbbf24', watch: '#94a3b8', avoid: '#f87171' };
+
+async function enrichPositionOracle() {
+ const el = document.getElementById('sn-positions');
+ if (!el) return;
+ const rows = el.querySelectorAll('[data-oracle-mint]');
+ if (!rows.length) return;
+ const mints = [...new Set([...rows].map((r) => r.dataset.oracleMint).filter(Boolean))];
+ if (!mints.length) return;
+ try {
+ const r = await fetch(`/api/oracle/batch?mints=${mints.map(encodeURIComponent).join(',')}&network=mainnet`);
+ if (!r.ok) return;
+ const { results = {} } = await r.json();
+ for (const row of rows) {
+ const mint = row.dataset.oracleMint;
+ const d = results[mint];
+ if (!d || d.score == null) continue;
+ const badge = row.querySelector('.sn-pos-oracle');
+ if (!badge || badge.hasChildNodes()) continue;
+ const color = SN_TIER_COLOR[d.tier] || '#94a3b8';
+ badge.innerHTML = `<a class="sn-ob" href="/oracle?mint=${encodeURIComponent(mint)}" title="Oracle conviction: ${d.score} (${d.tier})">
+ <span class="sn-ob-score" style="color:${color}">${d.score}</span>
+ <span class="sn-ob-tier" style="color:${color}">${d.tier}</span>
+ </a>`;
+ }
+ } catch { /* non-fatal */ }
+}
+
// ── New strategy CTA ──────────────────────────────────────────────────────────
function newStrategyCta() {