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
fix(agent-sniper fleet): enforce 10k-100k mcap on EVERY archetype + enrich USD mcap (stop buying rugs)
nrpo2ab4cffc0b92
diff --git a/packages/agent-sniper/scripts/fleet.js b/packages/agent-sniper/scripts/fleet.jsindex dd9386b3c..70c76bf06 100644--- a/packages/agent-sniper/scripts/fleet.js+++ b/packages/agent-sniper/scripts/fleet.js@@ -73,13 +73,26 @@ function archetypes(perTradeSol, dailyBudgetSol) {max_hold_seconds: 1800,require_socials: true,max_creator_launches: 10,+ // OWNER RULE: only newer projects, market cap $10k–$100k. Enforced on EVERY+ // archetype — never buy dust or already-run coins. The feed enriches+ // market_cap_usd (SOL mcap × live price); the scorer rejects a mint whose+ // mcap is unknown or outside the band (mc_below_min / mc_above_max), so a+ // missing price fails CLOSED (skips the buy) rather than buying a rug.+ min_market_cap_usd: 10000,+ max_market_cap_usd: 100000,+ // OWNER RULE: take initials at 2×, hold a moon bag, never a 100% exit up.+ initials_out_multiple: 2,+ moonbag_min_pct: 15,};return [{ key: 'scalp', ...base, take_profit_pct: 40, stop_loss_pct: 25, trailing_stop_pct: 15, max_hold_seconds: 600 },{ key: 'runner', ...base, take_profit_pct: 120, stop_loss_pct: 30, trailing_stop_pct: 25, max_hold_seconds: 3600 },- { key: 'degen', ...base, require_socials: false, max_price_impact_pct: 15, take_profit_pct: 80, stop_loss_pct: 35, max_creator_launches: 25 },- { key: 'strict', ...base, require_socials: true, max_creator_launches: 3, min_creator_graduated: 1, take_profit_pct: 60, stop_loss_pct: 20 },- { key: 'patient', ...base, min_market_cap_usd: 8000, take_profit_pct: 50, stop_loss_pct: 20, max_hold_seconds: 2400 },+ // 'degen' no longer drops socials or widens the creator filter — the owner's+ // rules apply to every archetype. It keeps only a slightly higher impact+ // tolerance for faster fills within the same 10k–100k, socials-required band.+ { key: 'degen', ...base, max_price_impact_pct: 15, take_profit_pct: 80, stop_loss_pct: 35 },+ { key: 'strict', ...base, max_creator_launches: 3, min_creator_graduated: 1, take_profit_pct: 60, stop_loss_pct: 20 },+ { key: 'patient', ...base, take_profit_pct: 50, stop_loss_pct: 20, max_hold_seconds: 2400 },{ key: 'momentum', ...base, take_profit_pct: 70, stop_loss_pct: 22, trailing_stop_pct: 18, max_hold_seconds: 1200 },];}diff --git a/packages/agent-sniper/src/adapters/feed/pumpportal.js b/packages/agent-sniper/src/adapters/feed/pumpportal.jsindex 544f42ef7..369a113a8 100644--- a/packages/agent-sniper/src/adapters/feed/pumpportal.js+++ b/packages/agent-sniper/src/adapters/feed/pumpportal.js@@ -36,6 +36,35 @@ const DEFAULT_WATCHDOG_MS = 180_000;const WSOL_MINT = 'So11111111111111111111111111111111111111112';const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';+// Live SOL price for market-cap enrichment. PumpPortal's firehose reports market+// cap in SOL (`marketCapSol`); the owner's entry rule gates on USD ($10k–$100k),+// so we MUST convert or the filter is blind and the fleet buys anything (rugs).+// Cached + refreshed in the background; a fetch failure keeps the last good value+// and, until we have ANY price, market_cap_usd stays unset so the scorer skips+// the buy (mc_below_min) — the gate fails CLOSED, never silently open.+let _solPriceUsd = 0;+let _solPriceTimer = null;+async function refreshSolPrice() {+ try {+ const r = await fetch(+ 'https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd',+ { signal: AbortSignal.timeout(5000) },+ );+ const j = await r.json();+ const p = Number(j?.solana?.usd);+ if (Number.isFinite(p) && p > 0) _solPriceUsd = p;+ } catch { /* keep last good price — never zero out a working value */ }+}+function startSolPriceRefresh() {+ if (_solPriceTimer) return;+ refreshSolPrice();+ _solPriceTimer = setInterval(refreshSolPrice, 60_000);+ if (_solPriceTimer.unref) _solPriceTimer.unref();+}+function stopSolPriceRefresh() {+ if (_solPriceTimer) { clearInterval(_solPriceTimer); _solPriceTimer = null; }+}+/*** Decide whether a launch is USDC-paired from whatever quote signal the event* carries. PumpPortal isn't fully consistent across coin versions, so we probe@@ -71,12 +100,15 @@ function toCandidate(d) {if (typeof d.symbol === 'string' && d.symbol.trim()) c.symbol = d.symbol.trim();if (typeof d.name === 'string' && d.name.trim()) c.name = d.name.trim();- // PumpPortal reports market cap in SOL (`marketCapSol`); the Candidate field- // is USD. We have no SOL price on the firehose path here, so we omit- // market_cap_usd rather than ship an unconverted SOL figure as if it were- // dollars — a wrong unit is worse than an absent field for the scorer.- // (The three.ws build enriches with a price feed; the standalone package- // leaves USD conversion to a price-aware Solana adapter / hook.)+ // PumpPortal reports market cap in SOL (`marketCapSol`); the owner's rule gates+ // on USD ($10k–$100k). Convert with the live SOL price. If we have no price yet+ // (startup / upstream blip), LEAVE market_cap_usd unset: the scorer treats an+ // unknown mcap under a configured min as mc_below_min and SKIPS the buy — the+ // gate fails closed rather than buying a coin whose size we can't verify.+ const mcSol = Number(d.marketCapSol ?? d.market_cap_sol);+ if (Number.isFinite(mcSol) && mcSol > 0 && _solPriceUsd > 0) {+ c.market_cap_usd = mcSol * _solPriceUsd;+ }// The dev's opening buy, in SOL — present on most create events.const initialBuy = d.initialBuy ?? d.solAmount;@@ -112,6 +144,9 @@ export function createPumpPortalFeed(opts = {}) {* @returns {Promise<() => void>} stop function*/async start(onEvent) {+ // Begin refreshing the SOL price so market_cap_usd enrichment (the owner's+ // $10k–$100k gate) is populated as launches arrive.+ startSolPriceRefresh();// `active` gates every async continuation. Once stop() flips it false,// late socket events and pending reconnect timers become no-ops, so the// feed can't resurrect itself after teardown.@@ -225,6 +260,7 @@ export function createPumpPortalFeed(opts = {}) {return function stop() {if (!active) return;active = false;+ stopSolPriceRefresh();clearTimeout(reconnectTimer);clearInterval(watchdogTimer);const sock = ws;