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): label coin outcomes again by moving per-coin lookups to pump.fun's coins-v2 route

nirholasd3c518b79595
diff --git a/api/_lib/pump-alert-runner.js b/api/_lib/pump-alert-runner.js
index 8b6a069b5..2aecf4b00 100644
--- a/api/_lib/pump-alert-runner.js
+++ b/api/_lib/pump-alert-runner.js
@@ -42,7 +42,9 @@ const MAX_MARKETS = 120; // distinct prediction markets priced per run
const TRADES_LIMIT = 50;
const FETCH_TIMEOUT_MS = 2_500;
-const PUMPFUN_COIN_API = 'https://frontend-api-v3.pump.fun/coins';
+// Per-coin lookups use the v2 route: pump.fun retired `/coins/:mint` on this host
+// around 2026-09-17 (404 "Cannot GET"); `/coins-v2/:mint` returns the same fields.
+const PUMPFUN_COIN_API = 'https://frontend-api-v3.pump.fun/coins-v2';
const PUMPFUN_TRADES_API = 'https://frontend-api-v3.pump.fun/trades/all';
/**
diff --git a/api/_lib/pumpfun-ws-feed.js b/api/_lib/pumpfun-ws-feed.js
index e549b129f..f80a82767 100644
--- a/api/_lib/pumpfun-ws-feed.js
+++ b/api/_lib/pumpfun-ws-feed.js
@@ -437,6 +437,9 @@ function normalizeTrade(d, solPrice = 0) {
// keep stalls bounded so a slow upstream can't pin the SSE worker.
const PUMPFUN_COIN_API = 'https://frontend-api-v3.pump.fun/coins';
+// Per-coin lookups use the v2 route: pump.fun retired `/coins/:mint` on this host
+// around 2026-09-17 (404 "Cannot GET"); `/coins-v2/:mint` returns the same fields.
+const PUMPFUN_COIN_DETAIL_API = 'https://frontend-api-v3.pump.fun/coins-v2';
const PUMPFUN_USER_COINS_API = 'https://frontend-api-v3.pump.fun/coins/user-created-coins';
const ENRICH_TIMEOUT_MS = 2_500;
const COIN_CACHE_TTL_MS = 30_000;
@@ -459,7 +462,7 @@ async function fetchJsonWithTimeout(url, ms = ENRICH_TIMEOUT_MS) {
async function fetchCoin(mint) {
const hit = _coinCache.get(mint);
if (hit && Date.now() - hit.t < COIN_CACHE_TTL_MS) return hit.v;
- const v = await fetchJsonWithTimeout(`${PUMPFUN_COIN_API}/${encodeURIComponent(mint)}`);
+ const v = await fetchJsonWithTimeout(`${PUMPFUN_COIN_DETAIL_API}/${encodeURIComponent(mint)}`);
if (_coinCache.size > 500) _coinCache.clear();
_coinCache.set(mint, { t: Date.now(), v });
return v;
diff --git a/api/agents/alpha.js b/api/agents/alpha.js
index 12fca17f0..a906de19e 100644
--- a/api/agents/alpha.js
+++ b/api/agents/alpha.js
@@ -38,7 +38,9 @@ const NETWORKS = new Set(['mainnet', 'devnet']);
const netOf = (v) => (NETWORKS.has(v) ? v : 'mainnet');
const BASE58_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
const LAMPORTS_PER_SOL = 1_000_000_000;
-const PUMPFUN_COIN_API = 'https://frontend-api-v3.pump.fun/coins';
+// Per-coin lookups use the v2 route: pump.fun retired `/coins/:mint` on this host
+// around 2026-09-17 (404 "Cannot GET"); `/coins-v2/:mint` returns the same fields.
+const PUMPFUN_COIN_API = 'https://frontend-api-v3.pump.fun/coins-v2';
const REFERENCE_BUY_SOL = 0.1; // probe size for a real, non-binding price-impact read
const num = (v) => (v == null || !Number.isFinite(Number(v)) ? null : Number(v));
diff --git a/workers/agent-sniper/intel/learn.js b/workers/agent-sniper/intel/learn.js
index 4db7dca8a..617523232 100644
--- a/workers/agent-sniper/intel/learn.js
+++ b/workers/agent-sniper/intel/learn.js
@@ -11,7 +11,13 @@
// Run both from a cron (see api/cron or the worker loop). Pure-math helpers are
// exported for testing.
-const PUMPFUN_COIN_API = 'https://frontend-api-v3.pump.fun/coins';
+// The v2 coin route. pump.fun retired `/coins/:mint` on this host around
+// 2026-09-17 ("Cannot GET", 404), and because fetchCoin() reads any non-2xx as
+// "no data", the labeler silently stopped labeling: oracle_training_set froze and
+// every Oracle refit retrained on the same rows. `/coins-v2/:mint` carries every
+// field this module reads (complete, pump_swap_pool, usd_market_cap, market_cap,
+// ath_market_cap) with the same types.
+const PUMPFUN_COIN_API = 'https://frontend-api-v3.pump.fun/coins-v2';
const FETCH_TIMEOUT_MS = 4_000;
// Signals we train on - all are ~0..1 (or normalized below). Counts are excluded;