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
Sniper experiments board: track simulate-mode paper fills separately
nirholasd8067dcfe239
diff --git a/api/sniper/experiments.js b/api/sniper/experiments.jsindex 947699db8..97168607a 100644--- a/api/sniper/experiments.js+++ b/api/sniper/experiments.js@@ -66,22 +66,26 @@ export default wrap(async (req, res) => {s.min_oracle_score, s.min_quality_score, s.max_bundle_score, s.require_smart_money,s.stop_loss_pct, s.trailing_stop_pct, s.take_profit_pct, s.max_hold_seconds,a.id as agent_id, a.name as agent_name,- count(p.id) filter (where p.status = 'closed') as closed,- count(p.id) filter (where p.status = 'closed' and p.realized_pnl_lamports > 0) as wins,- count(p.id) filter (where p.status = 'open') as open,- coalesce(sum(p.realized_pnl_lamports) filter (where p.status = 'closed'), 0) as realized_pnl_lamports,- coalesce(sum(p.entry_quote_lamports) filter (where p.status = 'closed'), 0) as deployed_lamports,- avg(p.realized_pnl_pct) filter (where p.status = 'closed') as avg_pnl_pct,- max(p.realized_pnl_pct) filter (where p.status = 'closed') as best_pnl_pct,- min(p.realized_pnl_pct) filter (where p.status = 'closed') as worst_pnl_pct,- avg(extract(epoch from (p.closed_at - p.opened_at))) filter (where p.status = 'closed') as avg_hold_s,- max(p.closed_at) as last_closed_at+ count(p.id) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED') as closed,+ count(p.id) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED' and p.realized_pnl_lamports > 0) as wins,+ count(p.id) filter (where p.status = 'open' and p.buy_sig <> 'SIMULATED') as open,+ coalesce(sum(p.realized_pnl_lamports) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED'), 0) as realized_pnl_lamports,+ coalesce(sum(p.entry_quote_lamports) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED'), 0) as deployed_lamports,+ avg(p.realized_pnl_pct) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED') as avg_pnl_pct,+ max(p.realized_pnl_pct) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED') as best_pnl_pct,+ min(p.realized_pnl_pct) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED') as worst_pnl_pct,+ avg(extract(epoch from (p.closed_at - p.opened_at))) filter (where p.status = 'closed' and p.buy_sig <> 'SIMULATED') as avg_hold_s,+ max(p.closed_at) filter (where p.buy_sig <> 'SIMULATED') as last_closed_at,+ count(p.id) filter (where p.status = 'closed' and p.buy_sig = 'SIMULATED') as paper_closed,+ count(p.id) filter (where p.status = 'closed' and p.buy_sig = 'SIMULATED' and p.realized_pnl_lamports > 0) as paper_wins,+ count(p.id) filter (where p.status = 'open' and p.buy_sig = 'SIMULATED') as paper_open,+ coalesce(sum(p.realized_pnl_lamports) filter (where p.status = 'closed' and p.buy_sig = 'SIMULATED'), 0) as paper_pnl_lamportsfrom agent_sniper_strategies sjoin agent_identities a on a.id = s.agent_id and a.deleted_at is nullleft join agent_sniper_positions pon p.strategy_id = s.idand p.network = s.network- and p.buy_sig is not null and p.buy_sig <> 'SIMULATED'+ and p.buy_sig is not nulland (${interval}::text is null or p.opened_at > now() - (${interval}::text)::interval)where s.network = ${network}and (s.enabled = true or s.label is not null)@@ -124,6 +128,13 @@ export default wrap(async (req, res) => {worst_pnl_pct: r.worst_pnl_pct != null ? Number(Number(r.worst_pnl_pct).toFixed(2)) : null,avg_hold_seconds: r.avg_hold_s != null ? Math.round(Number(r.avg_hold_s)) : null,last_closed_at: r.last_closed_at || null,+ // Simulate-mode (paper) record, kept strictly separate from the real one:+ // the worker's SNIPER_MODE=simulate books quotes without broadcasting, so+ // these rows prove behavior but never claim on-chain results.+ paper_closed: Number(r.paper_closed) || 0,+ paper_wins: Number(r.paper_wins) || 0,+ paper_open: Number(r.paper_open) || 0,+ paper_pnl_sol: lamportsToSol(r.paper_pnl_lamports),};});diff --git a/src/sniper-experiments.js b/src/sniper-experiments.jsindex ae42f2f8b..9ec7bad59 100644--- a/src/sniper-experiments.js+++ b/src/sniper-experiments.js@@ -116,6 +116,9 @@ function renderBoard(experiments) {const rows = experiments.map((x) => {const record = x.closed > 0 ? `${x.wins}W · ${x.losses}L` : 'no fills';+ const paper = x.paper_closed > 0 || x.paper_open > 0+ ? `<div class="xp-paper" title="Simulate-mode record: real quotes, no broadcast">paper: ${x.paper_wins}W · ${x.paper_closed - x.paper_wins}L${x.paper_open ? ` · ${x.paper_open} open` : ''} · ${esc(sol(x.paper_pnl_sol))}</div>`+ : '';return `<tr class="${x.enabled ? '' : 'xp-off'}"><td>@@ -123,7 +126,7 @@ function renderBoard(experiments) {<div class="xp-agent"><a href="/a/${esc(x.agent_id)}">${esc(x.agent_name || 'agent')}</a> ${modeBadge(x)}</div></td><td class="xp-cond">${esc(x.conditions)}<div class="xp-cond-sub">${esc(String(x.per_trade_sol ?? '·'))} SOL/trade · SL ${esc(pct(-Math.abs(x.stop_loss_pct ?? 0), false))}${x.trailing_stop_pct != null ? ` · trail ${esc(pct(x.trailing_stop_pct, false))}` : ''}${x.max_hold_seconds != null ? ` · max ${esc(holdFmt(x.max_hold_seconds))}` : ''}</div></td>- <td>${esc(record)}${x.open > 0 ? ` <span class="xp-open">+${x.open} open</span>` : ''}</td>+ <td>${esc(record)}${x.open > 0 ? ` <span class="xp-open">+${x.open} open</span>` : ''}${paper}</td><td>${x.win_rate != null ? esc(String(x.win_rate)) + '%' : '·'}</td><td class="${pnlClass(x.realized_pnl_sol)}">${esc(sol(x.realized_pnl_sol))}</td><td class="${pnlClass(x.roi_pct)}">${esc(pct(x.roi_pct))}</td>@@ -191,6 +194,7 @@ function injectStyles() {.xp-pos{color:#4ade80}.xp-neg{color:#f87171}.xp-open{font-size:11px;color:#93c5fd}+ .xp-paper{font-size:11px;color:var(--cv-text-3,#888);margin-top:3px}.xp-paused{font-size:10.5px;color:var(--cv-text-3,#888);font-weight:400}.xp-off td{opacity:.55}`;