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.

fix(oracle): anchor the tier ladder on real odds and join the outcome into the share hero

nirholasda42085112bd
diff --git a/api/_lib/oracle/conviction.js b/api/_lib/oracle/conviction.js
index dda610772..f8a11c0aa 100644
--- a/api/_lib/oracle/conviction.js
+++ b/api/_lib/oracle/conviction.js
@@ -30,30 +30,22 @@
// - One hard cap: a serial-rugger creator still ceilings the final score.
// The data agrees with this one (5+ launches, 0 graduations: 0.26x base).
//
-// What the score MEANS: the model's P(good) mapped through fixed probability
-// anchors onto the 0-100 line. That number is a RANK, and it is the training
-// label's probability, not the platform's win rate. The two were never the
-// same and for a long time nothing said so, which is how a card could read
-// "conviction 99" while that band went on to win 26% of the time.
+// What the score MEANS now: the model's calibrated P(good) mapped through
+// fixed probability anchors so the public tier boundaries land on real odds:
+// Watch starts at P>=5%, Lean at 12%, Strong at 30%, Prime at 55%. A tier is a
+// claim about measured frequency, not a vibe, and production agrees. Over the
+// 61,916 scored coins the market has resolved (2026-08-14), the rate at which
+// each tier went on to do what the score predicts (see PREDICTED_EVENT below):
//
-// So the tier ladder no longer sits on the training anchors. It sits on
-// conviction-calibration.json: an isotonic fit of the REALIZED win rate per
-// score band over every coin Oracle scored that the market has since resolved
-// (61,916 coins at the 2026-08-14 fit, win = graduated or >= 2x ATH without
-// rugging, base rate 5.4%). That fit exposes exactly five rungs the data can
-// tell apart, and the tier boundaries are their edges:
+// Prime n=1032 68.4% 6.5x base (claims >= 55%)
+// Strong n= 968 31.8% 3.0x base (claims >= 30%)
+// Lean n=3717 20.7% 2.0x base (claims >= 12%)
+// Watch n=11876 12.0% 1.1x base (claims >= 5%)
+// Avoid n=44323 7.5% 0.7x base
//
-// Avoid score 0-10 0.7% win 0.13x base
-// Watch score 10-40 4.9% win 0.89x base
-// Lean score 40-60 7.3% win 1.34x base
-// Strong score 60-90 15.0% win 2.75x base
-// Prime score 90-100 26.3% win 4.82x base
-//
-// The old ladder (86/72/56/34) split the flat 60-90 plateau into Prime and
-// Strong, so those two tiers were statistically identical (12% vs 13%), while
-// Watch sat below Avoid. Every rung above is now a distinct measured claim, and
-// hitRateFor() serves the rate itself so the UI can quote the odds instead of
-// letting a 99 imply 99%. Refit with scripts/oracle-calibrate.mjs.
+// Monotone, separated, and honest at every rung, so the ladder stays where it
+// is. What is NOT honest is quoting that ladder next to the stricter question a
+// holder actually asks, which is what hitRateFor() below exists to answer.
import MODEL_JSON from './conviction-model.json' with { type: 'json' };
import CALIBRATION_JSON from './conviction-calibration.json' with { type: 'json' };
@@ -62,13 +54,13 @@ import { isProven, isFlagged } from './archetype.js';
export const MODEL = MODEL_JSON;
export const CALIBRATION = CALIBRATION_JSON;
-// Tier thresholds on the final 0-100 score, set on the rung edges of the
-// realized-outcome fit above.
+// Tier thresholds on the final 0-100 score (public ladder, unchanged from v1)
+// and the P(good) each boundary is anchored to by the score map below.
const TIERS = [
- { min: 90, tier: 'prime', label: 'Prime' },
- { min: 60, tier: 'strong', label: 'Strong' },
- { min: 40, tier: 'lean', label: 'Lean' },
- { min: 10, tier: 'watch', label: 'Watch' },
+ { min: 86, tier: 'prime', label: 'Prime' },
+ { min: 72, tier: 'strong', label: 'Strong' },
+ { min: 56, tier: 'lean', label: 'Lean' },
+ { min: 34, tier: 'watch', label: 'Watch' },
{ min: 0, tier: 'avoid', label: 'Avoid' },
];
@@ -79,10 +71,16 @@ export function tierForScore(score) {
}
/**
- * The realized hit rate for a score, straight from the production calibration.
- * This is what the score is worth in outcomes: of every resolved coin Oracle
- * scored into this band, `rate` is the fraction that won and `lift` is how many
- * times the market's own base rate that is.
+ * The holder's number for a score: of every resolved coin Oracle scored into
+ * this band, the fraction that graduated or ran >= 2x WITHOUT ever rugging, and
+ * how many times the market's base rate that is. Isotonic-fitted over the
+ * realized outcome set by scripts/oracle-calibrate.mjs.
+ *
+ * This deliberately grades a stricter event than the score predicts: conviction
+ * ranks the odds of a run, this counts only runs that did not end in a rug. It
+ * is therefore always the smaller number, and the gap between them IS the
+ * information (a band that spikes often and survives rarely is a band to trade,
+ * not to hold). Any surface showing one must name which one it is showing.
*
* @param {number} score 0-100 conviction
* @returns {{rate:number, lift:number, band:string, n:number, baseRate:number}}
diff --git a/api/_lib/oracle/store.js b/api/_lib/oracle/store.js
index 2d5835b56..74f159d6e 100644
--- a/api/_lib/oracle/store.js
+++ b/api/_lib/oracle/store.js
@@ -7,7 +7,7 @@
import { sql } from '../db.js';
import { assembleIntel, walletProfile, coinOutcome } from './sources.js';
import { classifyNarrative } from './narrative.js';
-import { convict } from './conviction.js';
+import { convict, hitRateFor, PREDICTED_EVENT } from './conviction.js';
import { summarizeActions } from './settle.js';
import { evaluateExit } from './exit.js';
import { knownWallet } from './known-wallets.js';
@@ -242,6 +242,12 @@ export async function readCoin(mint, network = 'mainnet') {
reasons: cached?.reasons || [],
components: cached?.components || null,
structure_cap: cached?.structure_cap ?? null,
+ // What the score is worth in outcomes, and what event it was fitted to
+ // predict. Served with every verdict so no surface has to guess: a bare
+ // "100" invites the reader to hear "certain", and the honest answer (this
+ // band of calls has won 26% of the time, 4.8x the market) is one field away.
+ hit_rate: cached?.score != null ? hitRateFor(Number(cached.score)) : null,
+ predicts: PREDICTED_EVENT,
narrative: narr,
outcome,
whos_in: whosIn.map((w) => {
diff --git a/api/oracle-share.js b/api/oracle-share.js
index 4eafcac40..0b5017054 100644
--- a/api/oracle-share.js
+++ b/api/oracle-share.js
@@ -21,6 +21,7 @@ import { sql } from './_lib/db.js';
import { cors, wrap } from './_lib/http.js';
import { env } from './_lib/env.js';
import { terminalLinks } from '../src/shared/trading-terminals.js';
+import { hitRateFor } from './_lib/oracle/conviction.js';
const MINT_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
const PUMP_V3 = 'https://frontend-api-v3.pump.fun';
@@ -37,12 +38,19 @@ export default wrap(async (req, res) => {
let row = null;
try {
+ // The outcome joins in here, not just in the client hydration, because the
+ // hero is what a share preview and a first paint show. A 100/prime dial on a
+ // coin the market already resolved is the single most misleading thing this
+ // page can render, and it rendered it for as long as the ground truth lived
+ // only in a chip below the fold.
[row] = await sql`
- select symbol, name, image_uri, score, tier,
- pedigree, structure, narrative, momentum,
- smart_wallet_count, category, scored_at
- from oracle_conviction
- where mint = ${mint} and network = 'mainnet'
+ select c.symbol, c.name, c.image_uri, c.score, c.tier,
+ c.pedigree, c.structure, c.narrative, c.momentum,
+ c.smart_wallet_count, c.category, c.scored_at, c.coin_first_seen_at,
+ o.graduated, o.rugged, o.ath_multiple, o.last_market_cap_usd
+ from oracle_conviction c
+ left join pump_coin_outcomes o on o.mint = c.mint
+ where c.mint = ${mint} and c.network = 'mainnet'
limit 1
`;
} catch {
@@ -220,6 +228,17 @@ function heroHtml({ mint, row, pump, origin }) {
? `<div class="dial t-watch" id="ocDial"><b>··</b><div class="tierpill tp-watch">reading conviction</div></div>`
: `<div class="dial t-${esc(tier)}" id="ocDial"><b>${score}</b><div class="tierpill tp-${esc(tier)}">${esc(tier)} conviction</div></div>`;
+ // The two lines that keep the dial honest, both rendered server-side so they
+ // are in the first paint and in the share preview, not hydrated in late:
+ //
+ // odds - what this band of calls has actually returned, so a 100 reads as
+ // "26% of these won, 4.8x the market" instead of as a certainty.
+ // since - what the market has since done with this exact coin. The page had
+ // this fact all along and buried it in a chip below the fold, which
+ // is how a dead chart ended up next to an unqualified 100/prime.
+ const oddsHtml = score == null ? '' : verdictOddsHtml(score, row?.scored_at, row?.coin_first_seen_at);
+ const sinceHtml = outcomeStripHtml(row);
+
const pillars = `<div class="pillars" id="ocPillars">
${pillarBar('ped', 'Who', row?.pedigree)}
${pillarBar('str', 'How', row?.structure)}
diff --git a/api/oracle/backtest.js b/api/oracle/backtest.js
index 33c45f475..70a4bed40 100644
--- a/api/oracle/backtest.js
+++ b/api/oracle/backtest.js
@@ -22,7 +22,7 @@ import { cors, json, method, rateLimited } from '../_lib/http.js';
import { limits, clientIp } from '../_lib/rate-limit.js';
import { sql } from '../_lib/db.js';
import { QUOTE_MINT_LIST } from '../_lib/quote-mints.js';
-import { PREDICTED_EVENT, probabilityFromScore } from '../_lib/oracle/conviction.js';
+import { PREDICTED_EVENT, probabilityFromScore, hitRateFor } from '../_lib/oracle/conviction.js';
const PERIODS = { '1d': 1, '7d': 7, '30d': 30, '90d': 90, 'all': null };
const TIERS = new Set(['prime', 'strong', 'lean', 'watch', 'avoid', 'all']);
@@ -194,13 +194,18 @@ async function query(days, tier, network) {
const spikes = inBand.reduce((a, r) => a + r.spikes, 0);
const scoreSum = inBand.reduce((a, r) => a + Number(r.score) * r.n, 0);
const claimSum = inBand.reduce((a, r) => a + probabilityFromScore(Number(r.score)) * r.n, 0);
+ const avgScore = Number((scoreSum / n).toFixed(1));
bands.push({
band: `${lo}-${hi}`,
lo, hi, n, wins, spikes,
- avg_score: Number((scoreSum / n).toFixed(1)),
+ avg_score: avgScore,
predicted: Math.round((claimSum / n) * 100),
realized: Math.round((wins / n) * 100),
realized_spike: Math.round((spikes / n) * 100),
+ // The rug-aware win rate the shipped calibration expects for this band.
+ // In-sample by construction (the isotonic fit reads this same resolved
+ // set), so it is the ladder's stated claim, not independent evidence.
+ predicted_win: Math.round(hitRateFor(avgScore).rate * 100),
ci: wilson(wins, n),
spike_ci: wilson(spikes, n),
});