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.

test(sniper): assert the e2e ladder times out only while the stake is still at risk

nirholas7ea6dd0c1d84
diff --git a/tests/trading-experiment-e2e.test.js b/tests/trading-experiment-e2e.test.js
index 6a2b9ff1b..e7a9488f1 100644
--- a/tests/trading-experiment-e2e.test.js
+++ b/tests/trading-experiment-e2e.test.js
@@ -113,8 +113,14 @@ describe('position lifecycle — take initials, hold a moon bag, never cut 100%
expect(d.sellFraction).toBe(1);
});
- it('times out after 24h', () => {
- const d = decideLadderedExit(pos({ initials_recovered: true }), 1.5 * ENTRY, 1.6 * ENTRY, new Date('2026-07-04T01:00:00Z').getTime());
+ it('times out after 24h while the stake is still at risk', () => {
+ const d = decideLadderedExit(pos(), 1.5 * ENTRY, 1.6 * ENTRY, new Date('2026-07-04T01:00:00Z').getTime());
expect(d.reason).toBe('timeout');
+ expect(d.keepsMoonbag).toBe(true);
+ });
+
+ it('never times out a recovered moon bag: house money has no clock', () => {
+ const d = decideLadderedExit(pos({ initials_recovered: true }), 1.5 * ENTRY, 1.6 * ENTRY, new Date('2026-07-04T01:00:00Z').getTime());
+ expect(d).toBe(null);
});
});