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(sniper): take-initials-at-2x is the fleet default exit policy

nirholas65d2d5b1cc5b
diff --git a/api/_lib/migrations/20260725133000_sniper_initials_ladder_default.sql b/api/_lib/migrations/20260725133000_sniper_initials_ladder_default.sql
new file mode 100644
index 000000000..60fea8b3f
--- /dev/null
+++ b/api/_lib/migrations/20260725133000_sniper_initials_ladder_default.sql
@@ -0,0 +1,28 @@
+-- Take-initials-at-2x becomes fleet-wide default (owner rule, 2026-07-25).
+--
+-- The owner's complaint: watching an arm ride a winner and give it all back, or
+-- exit a winner entirely. The laddered exit already encodes the fix (the FIRST
+-- time a position reaches initials_out_multiple x entry, sell exactly enough to
+-- recover the cost basis and let the remainder ride behind the trailing stop),
+-- but it was opt-in and most arms never opted in. From now on every strategy is
+-- born with the ladder armed at 2x: once a coin doubles, the initial buy-in is
+-- back in the wallet and whatever happens next costs nothing.
+--
+-- Explicit opt-out is preserved: setting initials_out_multiple to null through
+-- the strategy API restores the classic single-shot exit for that arm, and the
+-- earned-autonomy optimizer keeps tuning the multiple on trusted arms within
+-- its bounds (1.5-5x trusted, 1.5-10x autonomous).
+--
+-- Additive and idempotent, safe to re-run.
+
+ALTER TABLE agent_sniper_strategies
+ ALTER COLUMN initials_out_multiple SET DEFAULT 2;
+
+COMMENT ON COLUMN agent_sniper_strategies.initials_out_multiple IS
+ 'Entry multiple at which the ladder sells exactly enough to recover the cost basis and lets the rest ride (fleet default 2). Null = classic single-shot exit, explicit opt-out.';
+
+-- Arm the ladder on every strategy that never chose a value. Rows with an
+-- optimizer-tuned or hand-set multiple keep it.
+UPDATE agent_sniper_strategies
+SET initials_out_multiple = 2, updated_at = NOW()
+WHERE initials_out_multiple IS NULL;
diff --git a/api/sniper/strategy.js b/api/sniper/strategy.js
index dd93f28b6..046fdc1e9 100644
--- a/api/sniper/strategy.js
+++ b/api/sniper/strategy.js
@@ -321,6 +321,7 @@ async function upsertStrategy(req, res, userId) {
alpha_narrative_keywords: null, alpha_min_quality_score: null,
decision_mode: 'rules', llm_model: null, llm_min_confidence: null,
llm_max_confidence: null, llm_strict_model: false, moonbag_always: true,
+ initials_out_multiple: 2,
label: null, experiment_group: null,
};
@@ -368,9 +369,11 @@ async function upsertStrategy(req, res, userId) {
// wallet up from the launcher master. Arming a strategy never moves money
// on its own — this must be turned on deliberately.
auto_fund_enabled: 'auto_fund_enabled' in p ? Boolean(p.auto_fund_enabled) : (cur.auto_fund_enabled ?? false),
- // Laddered take-initials exit (opt-in). initials_out_multiple = the × entry
- // at which to sell enough to recover the cost basis and hold a moon bag;
- // null = classic single-shot exit. moonbag_min_pct = the floor always kept.
+ // Laddered take-initials exit (fleet default, owner rule 2026-07-25): at
+ // initials_out_multiple × entry, sell exactly enough to recover the cost
+ // basis and let the rest ride behind the trailing stop. New strategies get
+ // 2× unless the creator sets a value; an explicit null opts back into the
+ // classic single-shot exit. moonbag_min_pct = the floor always kept.
initials_out_multiple: 'initials_out_multiple' in p ? (p.initials_out_multiple == null || p.initials_out_multiple === '' ? null : Math.max(1.01, Number(p.initials_out_multiple))) : (cur.initials_out_multiple != null ? Number(cur.initials_out_multiple) : null),
moonbag_min_pct: 'moonbag_min_pct' in p ? Math.max(0, Math.min(95, Number(p.moonbag_min_pct))) : (cur.moonbag_min_pct != null ? Number(cur.moonbag_min_pct) : 15),
// Experiment identity + decision mode. 'llm' replaces the rule shields with
diff --git a/docs/trading-experiment.md b/docs/trading-experiment.md
index 8e2713d80..f5ee3c3bc 100644
--- a/docs/trading-experiment.md
+++ b/docs/trading-experiment.md
@@ -94,14 +94,18 @@ Set `moonbag_always = false` on a strategy to opt a single arm out. The column
defaults to true and a null is read as true, so every existing strategy has the
rule without a backfill.
-The proactive 2x ladder is **opt-in**: a strategy with no `initials_out_multiple`
-does not take initials early. It still never fully exits a winner, though: the
-fleet-wide moon-bag rule below covers that independently.
-
-There are two ways in. A human sets it directly (this script, or the arm API),
-**or** an arm earns it: once the autonomy engine places an arm at `trusted` or
-above and its winners demonstrably run past its average exit, the optimizer turns
-the ladder on by itself and records why. See
+The proactive 2x ladder is the **fleet default** (owner rule, 2026-07-25): every
+strategy is born with `initials_out_multiple = 2`, so the first time a position
+doubles, the initial stake comes off the table and the remainder rides. Setting
+the field to an explicit null through the arm API opts a single arm back into
+the classic single-shot exit; even then it never fully exits a winner, because
+the fleet-wide moon-bag rule below covers that independently.
+
+The multiple itself stays tunable. A human sets it directly (this script, or the
+arm API), **or** an arm earns the right to have it tuned: once the autonomy
+engine places an arm at `trusted` or above and its winners demonstrably run past
+its average exit, the optimizer adjusts the multiple by itself within its bounds
+and records why. See
[Earned autonomy](./sniper-autonomy.md). A losing arm cannot reach the field at
all, so the ladder is only ever switched on for a strategy whose record shows it
actually catches runners.
diff --git a/workers/agent-sniper/exit-logic.js b/workers/agent-sniper/exit-logic.js
index 21d6d6a47..a2749339d 100644
--- a/workers/agent-sniper/exit-logic.js
+++ b/workers/agent-sniper/exit-logic.js
@@ -165,9 +165,10 @@ export function moonbagExitFraction(entry, value, moonbag, houseMoney) {
* position to sell. This is the live-trading source of truth (positions.js);
* `decideExit` above stays the single-shot decider the backtester replays.
*
- * The ladder is OPT-IN: with no `initials_out_multiple` set it is byte-for-byte
- * the classic full-exit behavior (sellFraction 1 on any decideExit reason), so
- * existing strategies are unchanged. When set, it encodes the owner's rule:
+ * With no `initials_out_multiple` set this is byte-for-byte the classic
+ * full-exit behavior (sellFraction 1 on any decideExit reason). Since
+ * 2026-07-25 the fleet default is 2 (schema default + strategy-API default);
+ * a null is an explicit per-arm opt-out. When set, it encodes the owner's rule:
*
* - Protective exits are always FULL exits of whatever remains, and the hard
* stop-loss still wins: stop_loss → signal_flip → trailing_stop.