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: integrate market realness assessment into scoring logic

nirholasb8d106149023
diff --git a/workers/agent-sniper/llm-judge.js b/workers/agent-sniper/llm-judge.js
index 8cf8cb71f..ce04cdd90 100644
--- a/workers/agent-sniper/llm-judge.js
+++ b/workers/agent-sniper/llm-judge.js
@@ -20,6 +20,7 @@
import { log } from './log.js';
import { sql } from '../../api/_lib/db.js';
import { llmComplete } from '../../api/_lib/llm.js';
+import { assessMarketRealness } from '../../api/_lib/market-realness.js';
const OPENROUTER_URL = 'https://openrouter.ai/api/v1/chat/completions';
@@ -36,6 +37,12 @@ const SYSTEM_PROMPT = [
'time-boxed momentum position (held minutes, hard stop-loss) is worth taking.',
'Weigh: name/ticker memetic quality, narrative timing, socials, the creator\'s',
'launch history, the size of the dev\'s initial buy, and market cap.',
+ 'CRUCIAL: when market data is shown, judge the CHART like an experienced trader.',
+ 'A big opening candle that then stairsteps up on a handful of wallets with no',
+ 'sellers is a PAINTED chart meant to trap momentum bots, not real demand: skip',
+ 'it. Genuine momentum has a real two-sided market (many distinct buyers AND real',
+ 'sellers). A high market_realness score is a strong buy signal; a painted-pattern',
+ 'warning is a strong skip.',
'Most launches are worthless; be selective, but you are the only judge, there',
'are no other filters after you besides honeypot/safety checks.',
'Respond with ONLY a JSON object, no prose, no code fences:',
@@ -58,6 +65,20 @@ function launchBrief(mint) {
const lines = Object.entries(fields)
.filter(([, v]) => v != null && v !== '')
.map(([k, v]) => `${k}: ${v}`);
+
+ // The market shape the operator reads off the chart, handed to the model as
+ // data: buyer/seller diversity, concentration, timing. This is what separates a
+ // real mover from a painted stairstep, and without it the model is judging a
+ // coin blind on its name and socials the way a bot does.
+ const sig = mint.signals || mint.intel_signals || null;
+ if (sig) {
+ const m = assessMarketRealness(sig);
+ if (!m.flags.includes('insufficient_trades')) {
+ lines.push(`market: ${m.read}`);
+ lines.push(`market_realness: ${m.realness} (0=painted/one-sided, 1=genuine two-sided market)`);
+ if (m.painted) lines.push('WARNING: this matches a painted-stairstep pattern (a rise with no real two-sided market), which historically wins far below the base rate.');
+ }
+ }
return `New pump.fun launch:\n${lines.join('\n')}`;
}
diff --git a/workers/agent-sniper/scorer.js b/workers/agent-sniper/scorer.js
index 575013c92..19df60dd3 100644
--- a/workers/agent-sniper/scorer.js
+++ b/workers/agent-sniper/scorer.js
@@ -6,6 +6,7 @@
// logs show WHY a mint was passed over, which is what you stare at when tuning.
import { learnedScore } from './intel/learn.js';
+import { assessMarketRealness } from '../../api/_lib/market-realness.js';
function n(v) {
if (v == null) return null;
@@ -164,6 +165,23 @@ export function scoreIntel(rec, strat, weights = null) {
return { pass: false, score: 0, reasons: ['no_socials'] };
}
+ // Market-realness gate (the painted-stairstep defense). A big candle that then
+ // stairsteps up on a handful of wallets with no sellers is a chart painted to
+ // trap momentum bots; in the platform's own 62k labeled outcomes a genuine
+ // two-sided market (>=20 buyers & >=5 sellers) wins 52% vs a ~12% base, while a
+ // painted one-sided rise barely beats a coin flip. Two optional per-strategy
+ // hard gates, off by default so existing arms are unchanged:
+ // require_two_sided_market — demand the proven two-sided bar before buying.
+ // min_unique_sellers — demand a floor of real sellers (a two-sided market).
+ const market = assessMarketRealness(s);
+ if (strat.require_two_sided_market === true && !market.twoSided) {
+ return { pass: false, score: 0, reasons: [`not_two_sided:${market.read}`] };
+ }
+ const minSellers = n(strat.min_unique_sellers);
+ if (minSellers != null && (market.sellers == null || market.sellers < minSellers)) {
+ return { pass: false, score: 0, reasons: [`too_few_sellers:${market.sellers ?? 0}<${minSellers}`] };
+ }
+
// Smart-money gate (task 03). `rec.smart_money` is the live graph read attached
// by the worker (getSmartMoneyForMint). It honours two optional strategy knobs:
// require_smart_money — demand at least one reputable, non-sybil buyer.
@@ -191,6 +209,15 @@ export function scoreIntel(rec, strat, weights = null) {
const learned = learnedScore(s, weights);
if (learned != null) { score += learned; reasons.push(`learned:${learned}`); }
+ // Market realness: reward a genuine two-sided market, drag a painted stairstep.
+ // Always on (no knob) so EVERY intel arm's ranking reflects the single strongest
+ // signal in the data, centered so a neutral market neither helps nor hurts.
+ if (market.buyers != null && !market.flags.includes('insufficient_trades')) {
+ score += (market.realness - 0.5) * 0.8;
+ if (market.twoSided) reasons.push('two_sided');
+ if (market.painted) reasons.push(`painted:${market.read}`);
+ }
+
// Smart-money lifts the score (proven money in) and a dominant sybil cluster
// drags it (a manufactured "wide base"). Pure contribution — no I/O here.
if (smComputed) {