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(sniper): stop redeploys from clobbering the live service env, and record the 254-trade retune
nirholas5fbe3592674a
diff --git a/docs/trading-experiment.md b/docs/trading-experiment.mdindex 228e4af20..3f4c66d25 100644--- a/docs/trading-experiment.md+++ b/docs/trading-experiment.md@@ -148,6 +148,43 @@ channel when any answer exceeds that loop's cadence-derived limit. A loop withno rows at all is the worst finding, not an exemption. Policy is pure andtested: [api/_lib/sniper-loops-health.js](../api/_lib/sniper-loops-health.js).+## The 2026-08-09 retune (what 254 closed trades actually said)++A full autopsy of every closed mainnet trade (254 closes, 31.9% win rate, net+-0.159 SOL) reduced the fleet's whole history to five findings, and the strategy+table was rewritten to match them:++1. **Exits were the leak, not entries.** 132 of 254 trades were green at some+ point; peak unrealized gains summed to +0.93 SOL against -0.16 realized. 51+ trades went green and still closed red. The entry pickers found the upside;+ the exit policy gave it back.+2. **Stop-losses do not cap downside on this venue.** The five worst trades all+ had a 15% stop set and still closed -84% to -99.9%: a rug gaps through the+ stop before it can fire, and the entry-time firewall sim passes because the+ pool is honest until it isn't. Size every entry as if it can go to zero.+3. **The one net-positive pattern was the take-initials ladder.** The 5 trades+ that recovered initials at 2x: +0.41 SOL realized plus a moon bag still held.+ The other 249: -0.57 SOL. `initials_out_multiple=2` + `moonbag_always` is now+ enforced on every enabled arm instead of being an accident.+4. **Hold-time has a sweet spot.** Sub-400s scalps lost 0.36 SOL across 153+ trades even at a 49% win rate; the 10-15 minute band made +0.37 SOL on 5;+ everything past an hour went 0-for-20. Scalp arms were stretched into the+ band, and the timeout is treated as a failure mode, not an exit.+5. **A capped-upside/uncapped-downside arm loses even when it wins.** The+ graduation-ride arm won 63% of 90 trades and still lost money with TP 20 /+ SL 15 against occasional -99% rugs. Reward must be a multiple of risk+ everywhere: no arm keeps a TP below 2x its SL, and no arm trades with a null+ TP (that arm went 0-for-24).++The applied changes: six lifetime-negative `new_mint` spray arms disabled (that+trigger went 4-for-64, -0.17 SOL, worst in the fleet), TP set on all 14 arms+that had none, the graduation-ride arm retuned to TP 100 / hold 900s / size+matched to the auto-funder's top-up, the tightest LLM arm widened to TP 60, and+the ladder policy enforced fleet-wide. The oracle-crossing arm, the only+strategy with a real lifetime profit (+0.17 SOL on 8 selective trades, wide TP,+1-hour hold), was deliberately left untouched: the rebuilt fleet copies its+shape rather than diluting it.+## Why an arm shows zero trades (the silent-death class)A sniper arm can be enabled, funded, and evaluating every launch that crosses thediff --git a/scripts/deploy-sniper.mjs b/scripts/deploy-sniper.mjsindex c1ee451b3..bc0b6aea9 100644--- a/scripts/deploy-sniper.mjs+++ b/scripts/deploy-sniper.mjs@@ -183,7 +183,27 @@ function deploy() {const m = yaml.match(/name:\s*SNIPER_MODE[\s\S]*?value:\s*["']?(live|simulate)/);if (m) mode = m[1];} catch { /* fall back to "unknown" in the log */ }- log(`deploying service (minScale=maxScale=1, no CPU throttling, mode=${mode})…`);++ // An existing service may carry env the manifest does not know about: the+ // live cutover (SNIPER_MODE=live), WALLET_ENCRYPTION_KEY, the RPC failover+ // chain, LLM keys. `services replace` would wipe every one of them: that+ // exact footgun was caught mid-deploy on 2026-08-09, where a replace would+ // have silently flipped the live fleet back to simulate AND removed the+ // wallet decryption key. So: replace only on first deploy; after that, roll+ // code with `services update --image`, which preserves the running config.+ const existing = gcloud(['run', 'services', 'describe', SERVICE, `--region=${REGION}`,+ '--format=value(spec.template.spec.containers[0].image)'], { mutating: false, capture: true });+ if (existing.status === 0 && existing.stdout.trim()) {+ const image = existing.stdout.trim();+ log(`service exists: rolling a new revision of ${image} (running env preserved, incl. any live cutover)…`);+ const r = gcloud(['run', 'services', 'update', SERVICE, `--region=${REGION}`, `--image=${image}`]);+ if (r.status !== 0) die('gcloud run services update failed');+ ok('new revision rolled out with the running config intact');+ warn('the checked-in cloudrun.yaml was NOT applied (it would clobber the running env). To change service config, use `gcloud run services update --update-env-vars` per key.');+ return;+ }++ log(`first deploy: applying manifest (minScale=maxScale=1, no CPU throttling, mode=${mode})…`);if (mode === 'live') warn('LIVE mode: this service will sign + broadcast real trades from agent wallets.');const r = gcloud(['run', 'services', 'replace', CLOUDRUN, `--region=${REGION}`]);if (r.status !== 0) die('gcloud run services replace failed');@@ -231,7 +251,7 @@ async function main() {build();deploy();await verifyHeartbeat();- ok('done. Worker deployed in SIMULATE mode (zero spend).');+ ok('done. First deploys land in SIMULATE mode (zero spend); redeploys keep the running mode.');log('Live cutover (gated): see deploy/sniper/README.md → "Cutover to live".');log('Status surface: https://three.ws/api/sniper/status');}