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.

Oracle: push live coins to 3D graph; structure signal panel + CSS

nirholasadba7dfe717c
diff --git a/pages/oracle.html b/pages/oracle.html
index 1526f201d..976125278 100644
--- a/pages/oracle.html
+++ b/pages/oracle.html
@@ -183,6 +183,12 @@
.rdot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.rdot.pedigree { background: var(--p-ped); } .rdot.structure { background: var(--p-str); }
.rdot.narrative { background: var(--p-nar); } .rdot.momentum { background: var(--p-mom); }
+ .struct-grid { display: grid; grid-template-columns: 1fr auto; gap: 0; }
+ .struct-row { display: contents; }
+ .struct-key { font: 500 12px/1.4 var(--font-body); color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--line); text-transform: capitalize; }
+ .struct-val { font: 600 12px/1.4 var(--mono); color: var(--ink); padding: 5px 0; border-bottom: 1px solid var(--line); text-align: right; }
+ .struct-val.flag { color: var(--down); }
+ .struct-row:last-child .struct-key, .struct-row:last-child .struct-val { border-bottom: none; }
.nwallet { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.nwallet:last-child { border: none; }
.nw-left { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
@@ -206,6 +212,14 @@
.note { font-size: 12px; color: var(--faint); margin-top: 10px; }
.note.warn { color: var(--amber); }
+ /* structure panel */
+ .str-grid { display: flex; flex-direction: column; gap: 7px; }
+ .str-row { display: grid; grid-template-columns: 92px 1fr 44px; gap: 8px; align-items: center; }
+ .str-lbl { font: 600 10.5px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
+ .str-track { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; }
+ .str-fill { height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.22,1,.36,1); }
+ .str-val { font: 700 11px/1 var(--mono); text-align: right; }
+
/* live trade tape */
.trade-tape { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: rgba(0,0,0,0.2); }
.tape-header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line);
diff --git a/src/oracle.js b/src/oracle.js
index 09beed477..169f6d0bb 100644
--- a/src/oracle.js
+++ b/src/oracle.js
@@ -104,6 +104,12 @@ function boot() {
loadFeed();
openStream();
+
+ // If the page was opened with ?mint= (e.g. from a shared link or Telegram alert),
+ // open that coin's drawer immediately after the feed loads.
+ const initialMint = new URLSearchParams(location.search).get('mint');
+ const MINT_RE2 = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+ if (initialMint && MINT_RE2.test(initialMint)) openCoin(initialMint);
}
function switchView(view) {
@@ -260,6 +266,8 @@ function onLiveCoin(it) {
if (state.minScore && it.score < state.minScore) return;
const isNew = !state.feed.has(it.mint);
state.feed.set(it.mint, it);
+ // Push fresh coin to the 3D graph if it's mounted.
+ if (graphHandle?.addCoin) graphHandle.addCoin(it);
if (state.view !== 'feed') return;
renderFeed();
if (isNew) {
@@ -342,6 +350,10 @@ async function openCoin(mint) {
dr.classList.add('open'); dr.setAttribute('aria-hidden', 'false');
$('#drTitle').textContent = 'Loading…';
$('#drBody').innerHTML = '<div class="state">Reading the order book…</div>';
+ // Update URL so this conviction view is shareable / bookmarkable.
+ const url = new URL(location.href);
+ url.searchParams.set('mint', mint);
+ history.replaceState(null, '', url.toString());
const { ok, data } = await api(`/api/oracle/coin?mint=${encodeURIComponent(mint)}&network=${NETWORK}`);
if (!ok || !data || !data.conviction) {
$('#drTitle').textContent = 'Not observed yet';
@@ -351,6 +363,50 @@ async function openCoin(mint) {
renderDrawer(data);
}
+function structurePanel(st) {
+ if (!st) return '';
+ const pct = (n) => (n == null ? '—' : `${Math.round(Number(n))}%`);
+ const bar = (val, color) => `<div class="str-track"><div class="str-fill" style="width:${Math.max(0,Math.min(100,val||0))}%;background:${color}"></div></div>`;
+ const organic = Number(st.organicScore ?? 0);
+ const bundle = Number(st.bundleScore ?? 0);
+ const top10 = Number(st.top10Pct ?? 0);
+ const connect = Number(st.bubblemapConnectivity ?? 0);
+ const devSold = Number(st.devSoldPct ?? 0);
+ const devBuy = st.creatorHoldPct != null ? `${Math.round(Number(st.creatorHoldPct))}%` : '—';
+ const buyers = st.uniqueBuyers ?? '—';
+ const bundleFl = st.bundleFlag;
+ if (!st.organicScore && !st.bundleScore && !st.top10Pct && !st.bubblemapConnectivity) return '';
+ return `
+ <div class="dr-sec">Structure <span style="color:var(--faint);font-weight:400;font-size:10px">wallet graph · buy pattern</span></div>
+ <div class="str-grid">
+ <div class="str-row">
+ <span class="str-lbl">Organic buy</span>
+ ${bar(organic, 'var(--up)')}
+ <span class="str-val" style="color:var(--up)">${pct(organic)}</span>
+ </div>
+ <div class="str-row">
+ <span class="str-lbl">Bundle / coord</span>
+ ${bar(bundle, bundleFl ? 'var(--down)' : 'var(--amber)')}
+ <span class="str-val" style="color:${bundleFl ? 'var(--down)' : 'var(--amber)'}">${pct(bundle)}${bundleFl ? ' ⚑' : ''}</span>
+ </div>
+ ${top10 ? `<div class="str-row">
+ <span class="str-lbl">Top 10 hold</span>
+ ${bar(top10, top10 > 60 ? 'var(--down)' : 'var(--gold)')}
+ <span class="str-val" style="color:${top10 > 60 ? 'var(--down)' : 'var(--gold)'}">${pct(top10)}</span>
+ </div>` : ''}
+ ${connect ? `<div class="str-row">
+ <span class="str-lbl">Graph density</span>
+ ${bar(connect, connect > 50 ? 'var(--down)' : 'var(--muted)')}
+ <span class="str-val" style="color:${connect > 50 ? 'var(--down)' : 'var(--muted)'}">${pct(connect)}</span>
+ </div>` : ''}
+ </div>
+ <div class="coin-meta" style="margin-top:10px">
+ ${buyers !== '—' ? `<span class="chip">buyers <b>${buyers}</b></span>` : ''}
+ ${devBuy !== '—' ? `<span class="chip ${devSold > 50 ? 'flag' : ''}">dev hold <b>${devBuy}</b>${devSold > 20 ? ` · sold ${Math.round(devSold)}%` : ''}</span>` : ''}
+ </div>`;
+}
+
+
function renderDrawer(d) {
const c = d.conviction; const p = c.pillars || {};
$('#drTitle').innerHTML = `${esc(c.symbol || '—')} <span style="color:var(--muted);font:600 13px var(--mono)">${esc(c.name || '')}</span>`;
@@ -379,6 +435,7 @@ function renderDrawer(d) {
${narr ? `<div class="dr-sec">Narrative</div><div style="font-size:13.5px;color:var(--ink)">${esc(narr.narrative || '')}</div>
<div class="coin-meta" style="margin-top:8px"><span class="chip cat">${esc(narr.category)}</span><span class="chip">virality <b>${narr.virality ?? '—'}</b></span><span class="chip">${esc(narr.source || '')}</span></div>` : ''}
<div class="dr-sec">Why this score</div>${reasons}
+ ${structurePanel(d.components?.structure)}
<div class="dr-sec">Who's in <span style="color:var(--faint)">(${(d.whos_in || []).length})</span></div>${whos}
${out ? `<div class="dr-sec">Outcome</div><div class="coin-meta">
<span class="chip ${out.graduated ? 'sm' : out.rugged ? 'flag' : ''}">${out.graduated ? 'graduated ✓' : out.rugged ? 'rugged ✕' : 'live'}</span>
@@ -424,6 +481,12 @@ function closeDrawer() {
// Tear down the trade tape so the PumpPortal SSE connection closes.
state.tape?.destroy();
state.tape = null;
+ // Clear the mint param so the URL reflects the closed state.
+ const url = new URL(location.href);
+ if (url.searchParams.has('mint')) {
+ url.searchParams.delete('mint');
+ history.replaceState(null, '', url.toString());
+ }
}
async function openWallet(wallet) {