@senpi/runtime 3.0.0-dev.runtime-phase-2.20260623210537 → 3.0.1-dev.openclaw-upgrade-mai.20260625140818

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/README.md +10 -9
  2. package/dist/actions/action-runtime-module.d.ts.map +1 -1
  3. package/dist/actions/action-runtime-module.js +1 -1
  4. package/dist/actions/action-runtime-module.js.map +1 -1
  5. package/dist/actions/decision-engine.d.ts.map +1 -1
  6. package/dist/actions/decision-engine.js +3 -0
  7. package/dist/actions/decision-engine.js.map +1 -1
  8. package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
  9. package/dist/actions/open-position/open-position.action.js +54 -14
  10. package/dist/actions/open-position/open-position.action.js.map +1 -1
  11. package/dist/actions/types.d.ts +10 -2
  12. package/dist/actions/types.d.ts.map +1 -1
  13. package/dist/actions/types.js +8 -0
  14. package/dist/actions/types.js.map +1 -1
  15. package/dist/cli/guide-commands.d.ts.map +1 -1
  16. package/dist/cli/guide-commands.js +80 -74
  17. package/dist/cli/guide-commands.js.map +1 -1
  18. package/dist/cli/senpi-commands.d.ts.map +1 -1
  19. package/dist/cli/senpi-commands.js +0 -108
  20. package/dist/cli/senpi-commands.js.map +1 -1
  21. package/dist/constants/dsl/index.d.ts +2 -0
  22. package/dist/constants/dsl/index.d.ts.map +1 -1
  23. package/dist/constants/dsl/index.js +2 -0
  24. package/dist/constants/dsl/index.js.map +1 -1
  25. package/dist/dsl/config/parse-tiers.d.ts.map +1 -1
  26. package/dist/dsl/config/parse-tiers.js +6 -2
  27. package/dist/dsl/config/parse-tiers.js.map +1 -1
  28. package/dist/dsl/engine-client/config-mapping.d.ts +7 -0
  29. package/dist/dsl/engine-client/config-mapping.d.ts.map +1 -1
  30. package/dist/dsl/engine-client/config-mapping.js +16 -2
  31. package/dist/dsl/engine-client/config-mapping.js.map +1 -1
  32. package/dist/dsl/events/handlers.d.ts +18 -2
  33. package/dist/dsl/events/handlers.d.ts.map +1 -1
  34. package/dist/dsl/events/handlers.js +302 -213
  35. package/dist/dsl/events/handlers.js.map +1 -1
  36. package/dist/dsl/monitor/create-monitor.d.ts +15 -0
  37. package/dist/dsl/monitor/create-monitor.d.ts.map +1 -1
  38. package/dist/dsl/monitor/create-monitor.js +46 -9
  39. package/dist/dsl/monitor/create-monitor.js.map +1 -1
  40. package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
  41. package/dist/dsl/monitor/process-one-position.js +138 -77
  42. package/dist/dsl/monitor/process-one-position.js.map +1 -1
  43. package/dist/dsl/plugin/index.d.ts +16 -1
  44. package/dist/dsl/plugin/index.d.ts.map +1 -1
  45. package/dist/dsl/plugin/index.js +35 -4
  46. package/dist/dsl/plugin/index.js.map +1 -1
  47. package/dist/dsl/plugin/options.d.ts +18 -0
  48. package/dist/dsl/plugin/options.d.ts.map +1 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +4 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/runtime/create-scanner-module.d.ts +4 -3
  53. package/dist/runtime/create-scanner-module.d.ts.map +1 -1
  54. package/dist/runtime/create-scanner-module.js +14 -5
  55. package/dist/runtime/create-scanner-module.js.map +1 -1
  56. package/dist/runtime/create-scanner-providers-for-run.d.ts.map +1 -1
  57. package/dist/runtime/create-scanner-providers-for-run.js +12 -1
  58. package/dist/runtime/create-scanner-providers-for-run.js.map +1 -1
  59. package/dist/runtime/load-runtime-config.js +1 -1
  60. package/dist/runtime/load-runtime-config.js.map +1 -1
  61. package/dist/runtime/map-strategies-registration.js +7 -8
  62. package/dist/runtime/map-strategies-registration.js.map +1 -1
  63. package/dist/runtime/map-strategies.d.ts.map +1 -1
  64. package/dist/runtime/map-strategies.js +12 -3
  65. package/dist/runtime/map-strategies.js.map +1 -1
  66. package/dist/runtime/reconcile-decide.d.ts +73 -0
  67. package/dist/runtime/reconcile-decide.d.ts.map +1 -0
  68. package/dist/runtime/reconcile-decide.js +186 -0
  69. package/dist/runtime/reconcile-decide.js.map +1 -0
  70. package/dist/runtime/reconcile-run.d.ts +62 -0
  71. package/dist/runtime/reconcile-run.d.ts.map +1 -0
  72. package/dist/runtime/reconcile-run.js +173 -0
  73. package/dist/runtime/reconcile-run.js.map +1 -0
  74. package/dist/runtime/reconcile-state.d.ts +44 -0
  75. package/dist/runtime/reconcile-state.d.ts.map +1 -1
  76. package/dist/runtime/reconcile-state.js +80 -44
  77. package/dist/runtime/reconcile-state.js.map +1 -1
  78. package/dist/runtime/risk-guard.d.ts.map +1 -1
  79. package/dist/runtime/risk-guard.js +17 -12
  80. package/dist/runtime/risk-guard.js.map +1 -1
  81. package/dist/runtime/runtime-schema.d.ts +2912 -1052
  82. package/dist/runtime/runtime-schema.d.ts.map +1 -1
  83. package/dist/runtime/runtime-schema.js +136 -42
  84. package/dist/runtime/runtime-schema.js.map +1 -1
  85. package/dist/runtime/runtime.d.ts +26 -0
  86. package/dist/runtime/runtime.d.ts.map +1 -1
  87. package/dist/runtime/runtime.js +254 -8
  88. package/dist/runtime/runtime.js.map +1 -1
  89. package/dist/runtime/scanner-registry.d.ts +1 -1
  90. package/dist/runtime/scanner-registry.d.ts.map +1 -1
  91. package/dist/runtime/scanner-registry.js +3 -12
  92. package/dist/runtime/scanner-registry.js.map +1 -1
  93. package/dist/runtime/supervisor/long-running-supervisor.d.ts.map +1 -1
  94. package/dist/runtime/supervisor/long-running-supervisor.js +1 -1
  95. package/dist/runtime/supervisor/long-running-supervisor.js.map +1 -1
  96. package/dist/runtime/supervisor/orphan-sweep.js +1 -1
  97. package/dist/runtime/supervisor/orphan-sweep.js.map +1 -1
  98. package/dist/runtime/supervisor/supervisor-utils.d.ts +1 -1
  99. package/dist/runtime/supervisor/supervisor-utils.d.ts.map +1 -1
  100. package/dist/runtime/supervisor/supervisor-utils.js +1 -1
  101. package/dist/runtime/supervisor/supervisor-utils.js.map +1 -1
  102. package/dist/runtime-api/intake/acceptance-record.d.ts +10 -0
  103. package/dist/runtime-api/intake/acceptance-record.d.ts.map +1 -1
  104. package/dist/runtime-api/intake/acceptance-record.js +28 -0
  105. package/dist/runtime-api/intake/acceptance-record.js.map +1 -1
  106. package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
  107. package/dist/runtime-api/intake/intake-mount.js +28 -36
  108. package/dist/runtime-api/intake/intake-mount.js.map +1 -1
  109. package/dist/runtime-api/intake/process-signal-post.d.ts +20 -1
  110. package/dist/runtime-api/intake/process-signal-post.d.ts.map +1 -1
  111. package/dist/runtime-api/intake/process-signal-post.js +57 -6
  112. package/dist/runtime-api/intake/process-signal-post.js.map +1 -1
  113. package/dist/runtime-api/intake/scanner-launcher.d.ts +18 -4
  114. package/dist/runtime-api/intake/scanner-launcher.d.ts.map +1 -1
  115. package/dist/runtime-api/intake/scanner-launcher.js +24 -3
  116. package/dist/runtime-api/intake/scanner-launcher.js.map +1 -1
  117. package/dist/runtime-api/intake/types.d.ts +16 -0
  118. package/dist/runtime-api/intake/types.d.ts.map +1 -1
  119. package/dist/runtime-api/routes/signals.schema.d.ts +4 -0
  120. package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
  121. package/dist/runtime-api/routes/signals.schema.js +12 -0
  122. package/dist/runtime-api/routes/signals.schema.js.map +1 -1
  123. package/dist/scanners/external/scaffold/__main__.py +65 -24
  124. package/dist/scanners/external/scaffold/ctx.py +78 -0
  125. package/dist/scanners/external/scaffold/delivery.py +56 -22
  126. package/dist/scanners/external/scaffold/entrypoint_loader.py +42 -48
  127. package/dist/scanners/external/scaffold/journal.py +13 -2
  128. package/dist/scanners/external/scaffold/requirements.txt +11 -0
  129. package/dist/scanners/external/scaffold/scaffold.py +159 -128
  130. package/dist/scanners/external/scaffold/senpi_mcp.py +250 -0
  131. package/dist/scanners/external/scaffold/signal_envelope.py +177 -34
  132. package/dist/scanners/external/scaffold/state_manager.py +175 -0
  133. package/dist/scanners/external-scanner-receiver.d.ts +6 -0
  134. package/dist/scanners/external-scanner-receiver.d.ts.map +1 -1
  135. package/dist/scanners/external-scanner-receiver.js +14 -1
  136. package/dist/scanners/external-scanner-receiver.js.map +1 -1
  137. package/dist/scripts/run-dsl-standalone-live.d.ts +1 -1
  138. package/dist/scripts/run-dsl-standalone-live.js +5 -3
  139. package/dist/scripts/run-dsl-standalone-live.js.map +1 -1
  140. package/dist/senpi/client.d.ts +37 -4
  141. package/dist/senpi/client.d.ts.map +1 -1
  142. package/dist/senpi/client.js +101 -24
  143. package/dist/senpi/client.js.map +1 -1
  144. package/dist/state/state-manager.d.ts +17 -0
  145. package/dist/state/state-manager.d.ts.map +1 -1
  146. package/dist/state/state-manager.js +50 -4
  147. package/dist/state/state-manager.js.map +1 -1
  148. package/dist/strategy/strategy-state.d.ts +9 -1
  149. package/dist/strategy/strategy-state.d.ts.map +1 -1
  150. package/dist/strategy/strategy-state.js +62 -9
  151. package/dist/strategy/strategy-state.js.map +1 -1
  152. package/dist/tracking/constants.d.ts.map +1 -1
  153. package/dist/tracking/constants.js +2 -0
  154. package/dist/tracking/constants.js.map +1 -1
  155. package/dist/types/dsl/index.d.ts +1 -1
  156. package/dist/types/dsl/index.d.ts.map +1 -1
  157. package/dist/types/scanner.d.ts +7 -0
  158. package/dist/types/scanner.d.ts.map +1 -1
  159. package/dist/types/strategy.d.ts +3 -1
  160. package/dist/types/strategy.d.ts.map +1 -1
  161. package/dist/utils/keyed-mutex.d.ts +37 -0
  162. package/dist/utils/keyed-mutex.d.ts.map +1 -0
  163. package/dist/utils/keyed-mutex.js +77 -0
  164. package/dist/utils/keyed-mutex.js.map +1 -0
  165. package/examples/strategies/README.md +17 -12
  166. package/examples/strategies/iguana/README.md +135 -0
  167. package/examples/strategies/iguana/recipe.yaml +137 -0
  168. package/examples/strategies/iguana/scanners/scan.py +243 -0
  169. package/examples/strategies/iguana/scanners/scoring.py +152 -0
  170. package/examples/strategies/raptor/README.md +156 -0
  171. package/examples/strategies/raptor/recipe.yaml +154 -0
  172. package/examples/strategies/raptor/scanners/scan.py +349 -0
  173. package/examples/strategies/raptor/scanners/scoring.py +452 -0
  174. package/examples/strategies/spider/README.md +89 -0
  175. package/examples/strategies/spider/scalp/recipe.yaml +129 -0
  176. package/examples/strategies/spider/scalp/scanners/scan.py +219 -0
  177. package/examples/strategies/spider/scalp/scanners/scoring.py +179 -0
  178. package/examples/strategies/spider/swing/recipe.yaml +137 -0
  179. package/examples/strategies/spider/swing/scanners/scan.py +334 -0
  180. package/examples/strategies/spider/swing/scanners/scoring.py +184 -0
  181. package/examples/strategies/turbine/README.md +166 -0
  182. package/examples/strategies/turbine/recipe-runners.yaml +123 -0
  183. package/examples/strategies/turbine/recipe-volume.yaml +129 -0
  184. package/examples/strategies/turbine/scanners/scan.py +283 -0
  185. package/examples/strategies/turbine/scanners/scoring.py +190 -0
  186. package/openclaw.plugin.json +1 -1
  187. package/package.json +1 -1
  188. package/dist/scanners/external/liquidation-watchdog/README.md +0 -107
  189. package/dist/scanners/external/liquidation-watchdog/liquidation-watchdog.yaml +0 -48
  190. package/dist/scanners/external/liquidation-watchdog/producer.mjs +0 -336
  191. package/dist/scanners/external/momentum/README.md +0 -148
  192. package/dist/scanners/external/momentum/momentum.yaml +0 -116
  193. package/dist/scanners/external/momentum/producer.mjs +0 -251
  194. package/dist/scanners/external/shared/ingest.mjs +0 -112
  195. package/examples/README.md +0 -89
  196. package/examples/scanners-consumer-quickstart.mjs +0 -134
  197. package/examples/scanners-emerging-movers-v4.mjs +0 -287
  198. package/examples/scanners-liquidation-watchdog.mjs +0 -341
  199. package/examples/scanners-live-mcp.mjs +0 -208
  200. package/examples/scanners-multi-strategy.mjs +0 -165
  201. package/examples/scanners-position-tracker-e2e.mjs +0 -225
  202. package/examples/scanners-scheduled-events.mjs +0 -96
  203. package/examples/scanners-senpi-provider-client.mjs +0 -182
  204. package/examples/scanners-single-strategy.mjs +0 -198
  205. package/examples/strategies/dsl-showcase.yaml +0 -68
  206. package/examples/strategies/dsl.yaml +0 -51
  207. package/examples/strategies/fox-minimal-loosened.yaml +0 -240
  208. package/examples/strategies/fox-minimal.yaml +0 -242
  209. package/examples/strategies/minimal.yaml +0 -46
  210. package/examples/strategies/momentum/how-it-works.md +0 -48
  211. package/examples/strategies/momentum/momentum-guarded.yaml +0 -161
  212. package/examples/strategies/risk-showcase.yaml +0 -93
  213. package/examples/strategies/viper.yaml +0 -67
  214. package/examples/strategies/wolf.yaml +0 -72
  215. package/examples/yamls/sample-with-dsl-and-emerging-movers.yaml +0 -123
@@ -1,198 +0,0 @@
1
- import { mkdtemp, rm } from "node:fs/promises";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
- import {
5
- createScannerRuntimeModule,
6
- emergingMoversScanner,
7
- momentumScanner,
8
- oiTrackerScanner,
9
- prescreenerScanner,
10
- } from "../dist/scanners/index.js";
11
-
12
- function createInstruments() {
13
- return [
14
- {
15
- name: "BTC",
16
- isDelisted: false,
17
- maxLeverage: 10,
18
- context: {
19
- markPx: 106,
20
- prevDayPx: 100,
21
- midPx: 106,
22
- dayNtlVlm: 80_000_000,
23
- openInterest: 2_000_000_000,
24
- funding: 0.001,
25
- },
26
- },
27
- {
28
- name: "ETH",
29
- isDelisted: false,
30
- maxLeverage: 8,
31
- context: {
32
- markPx: 101,
33
- prevDayPx: 100,
34
- midPx: 101,
35
- dayNtlVlm: 40_000_000,
36
- openInterest: 1_000_000_000,
37
- funding: 0.001,
38
- },
39
- },
40
- ];
41
- }
42
-
43
- function createCandles() {
44
- return {
45
- BTC: {
46
- candles: {
47
- "1h": [
48
- {
49
- timestamp: 1,
50
- open: 100,
51
- high: 102,
52
- low: 99,
53
- close: 100,
54
- volume: 1000,
55
- },
56
- {
57
- timestamp: 2,
58
- open: 100,
59
- high: 107,
60
- low: 100,
61
- close: 106,
62
- volume: 1400,
63
- },
64
- ],
65
- },
66
- },
67
- ETH: {
68
- candles: {
69
- "1h": [
70
- {
71
- timestamp: 1,
72
- open: 100,
73
- high: 101,
74
- low: 99,
75
- close: 100,
76
- volume: 900,
77
- },
78
- {
79
- timestamp: 2,
80
- open: 100,
81
- high: 101,
82
- low: 99,
83
- close: 100.4,
84
- volume: 920,
85
- },
86
- ],
87
- },
88
- },
89
- };
90
- }
91
-
92
- function createSmDataRun1() {
93
- return [
94
- {
95
- token: "SOL",
96
- direction: "up",
97
- pctOfTopTradersGain: 0.18,
98
- traderCount: 220,
99
- tokenPriceChangePct4h: 2.1,
100
- },
101
- {
102
- token: "AVAX",
103
- direction: "up",
104
- pctOfTopTradersGain: 0.16,
105
- traderCount: 200,
106
- tokenPriceChangePct4h: 1.9,
107
- },
108
- ];
109
- }
110
-
111
- function createSmDataRun2() {
112
- return [
113
- {
114
- token: "AVAX",
115
- direction: "up",
116
- pctOfTopTradersGain: 0.17,
117
- traderCount: 230,
118
- tokenPriceChangePct4h: 2.0,
119
- },
120
- {
121
- token: "SOL",
122
- direction: "up",
123
- pctOfTopTradersGain: 0.35,
124
- traderCount: 250,
125
- tokenPriceChangePct4h: 4.2,
126
- },
127
- ];
128
- }
129
-
130
- async function main() {
131
- const stateDir = await mkdtemp(join(tmpdir(), "scanners-example-single-"));
132
- let smDataRun = 0;
133
-
134
- const module = createScannerRuntimeModule({
135
- stateDir,
136
- scanners: [prescreenerScanner, oiTrackerScanner, momentumScanner, emergingMoversScanner],
137
- strategies: [
138
- {
139
- id: "alpha",
140
- name: "Alpha",
141
- scannerOverrides: {
142
- momentum: {
143
- config: {
144
- timeframe: "1h",
145
- minMovePct: 1.5,
146
- maxCandidates: 10,
147
- minDayVolume: 1_000_000,
148
- minSignalScore: 0.2,
149
- requirePrescreened: true,
150
- },
151
- },
152
- "emerging-movers": {
153
- config: {
154
- topN: 10,
155
- minRankJump: 1,
156
- minTopTradersGain: 0.15,
157
- minScansBeforeSignals: 2,
158
- historyLimit: 30,
159
- },
160
- },
161
- },
162
- },
163
- ],
164
- providers: {
165
- getInstruments: async () => createInstruments(),
166
- getCandles: async () => createCandles(),
167
- getSmData: async () => {
168
- smDataRun += 1;
169
- return smDataRun === 1 ? createSmDataRun1() : createSmDataRun2();
170
- },
171
- },
172
- });
173
-
174
- try {
175
- await module.runOnce("alpha", "prescreener");
176
- await module.runOnce("alpha", "oi-tracker");
177
- const momentumResult = await module.runOnce("alpha", "momentum");
178
- await module.runOnce("alpha", "emerging-movers");
179
- const emergingResult = await module.runOnce("alpha", "emerging-movers");
180
-
181
- const signals = await module.querySignals({
182
- strategyId: "alpha",
183
- limit: 20,
184
- });
185
-
186
- console.log("single-strategy: momentum signals =", momentumResult.signals.length);
187
- console.log("single-strategy: emerging signals =", emergingResult.signals.length);
188
- console.log("single-strategy: queried signals =", signals.length);
189
- } finally {
190
- await module.stop();
191
- await rm(stateDir, { recursive: true, force: true });
192
- }
193
- }
194
-
195
- main().catch((error) => {
196
- console.error(error);
197
- process.exit(1);
198
- });
@@ -1,68 +0,0 @@
1
- # DSL showcase — every DSL field annotated for reference.
2
- # Use as a copy-paste reference when tuning exit behavior.
3
- name: dsl-showcase
4
- version: 1.0.0
5
- description: >
6
- Annotated DSL exit config reference.
7
- Onchain position tracker — monitors the strategy wallet on Hyperliquid
8
- for position lifecycle events (open, close, edit, flip) and wires them
9
- into the DSL exit engine for automated trailing stop-loss management.
10
-
11
-
12
- notifications:
13
- telegram_chat_id: "${TELEGRAM_CHAT_ID}"
14
-
15
- strategy:
16
- wallet: "${WALLET_ADDRESS}"
17
- slots: 2
18
- margin_pct: 15
19
- trading_risk: conservative
20
- enabled: true
21
-
22
- # ── SCANNERS ──
23
- scanners:
24
- - name: position_tracker
25
- type: position_tracker
26
- interval: 10s
27
-
28
- # ── ACTIONS ──
29
- actions:
30
- - name: position_tracker_action
31
- action_type: POSITION_TRACKER
32
- decision_mode: rule
33
- scanners: [position_tracker]
34
-
35
- exit:
36
- engine: dsl
37
- # interval_seconds — how often the price monitor runs
38
- interval_seconds: 30
39
- # order_type — execution method for DSL exit closes: MARKET (default) or FEE_OPTIMIZED_LIMIT
40
- order_type: FEE_OPTIMIZED_LIMIT
41
- # fee_optimized_limit_options — only used when order_type is FEE_OPTIMIZED_LIMIT
42
- fee_optimized_limit_options:
43
- ensure_execution_as_taker: true # fall back to market if maker doesn't fill
44
- execution_timeout_seconds: 15 # seconds to wait for maker fill (default 45)
45
- # dsl_preset — single exit profile (required for DslPlugin).
46
- dsl_preset:
47
- hard_timeout:
48
- enabled: true
49
- interval_in_minutes: 360
50
- weak_peak_cut:
51
- enabled: true
52
- interval_in_minutes: 120
53
- min_value: 5
54
- dead_weight_cut:
55
- enabled: true
56
- interval_in_minutes: 5
57
- phase1:
58
- enabled: true
59
- max_loss_pct: 4.0
60
- retrace_threshold: 7
61
- consecutive_breaches_required: 1
62
- phase2:
63
- enabled: true
64
- tiers:
65
- - { trigger_pct: 7, lock_hw_pct: 40 }
66
- - { trigger_pct: 12, lock_hw_pct: 55 }
67
- - { trigger_pct: 15, lock_hw_pct: 75 }
68
- - { trigger_pct: 20, lock_hw_pct: 85 }
@@ -1,51 +0,0 @@
1
- name: position-tracker
2
- version: 1.0.0
3
- description: >
4
- Onchain position tracker — monitors the strategy wallet on Hyperliquid
5
- for position lifecycle events (open, close, edit, flip) and wires them
6
- into the DSL exit engine for automated trailing stop-loss management.
7
-
8
- # ── STRATEGY ──
9
- # Minimal: only wallet address + optional fields (no slots/margin needed for watch-only)
10
- strategy:
11
- wallet: "${WALLET_ADDRESS}"
12
- enabled: true
13
-
14
- # ── SCANNERS ──
15
- scanners:
16
- - name: position_tracker
17
- type: position_tracker
18
- interval: 10s
19
-
20
- # ── ACTIONS ──
21
- actions:
22
- - name: position_tracker_action
23
- action_type: POSITION_TRACKER
24
- decision_mode: rule
25
- scanners: [position_tracker]
26
-
27
- # ── EXIT (DSL) ──
28
- exit:
29
- engine: dsl
30
- interval_seconds: 30
31
- order_type: FEE_OPTIMIZED_LIMIT
32
- fee_optimized_limit_options:
33
- ensure_execution_as_taker: true
34
- execution_timeout_seconds: 15
35
- dsl_preset:
36
- phase1:
37
- enabled: true
38
- max_loss_pct: 3.0
39
- retrace_threshold: 7
40
- consecutive_breaches_required: 3
41
- phase2:
42
- enabled: true
43
- tiers:
44
- - { trigger_pct: 7, lock_hw_pct: 40 }
45
- - { trigger_pct: 12, lock_hw_pct: 55 }
46
- - { trigger_pct: 15, lock_hw_pct: 75 }
47
- - { trigger_pct: 20, lock_hw_pct: 85 }
48
-
49
- # ── NOTIFICATIONS ──
50
- notifications:
51
- telegram_chat_id: "${TELEGRAM_CHAT_ID}"
@@ -1,240 +0,0 @@
1
- name: fox-minimal-loosened
2
- version: 1.0.0
3
- description: >
4
- FOX v1.6 — loosened configuration for functional evaluation.
5
- Scanner thresholds relaxed, LLM gauntlet simplified, and slots increased
6
- to maximize signal volume. NOT for live trading.
7
-
8
- notifications:
9
- telegram_chat_id: "${TELEGRAM_CHAT_ID}"
10
-
11
- strategy:
12
- wallet: "${FOX_WALLET}"
13
- slots: 3
14
- margin_pct: 10
15
- trading_risk: aggressive
16
- enabled: true
17
-
18
- scanners:
19
- # References in depends_on/actions use these scanner names, not the built-in types.
20
- # ── Primary signal: emerging movers (every 60s, faster for eval) ──
21
- - name: emerging_movers
22
- type: emerging_movers
23
- interval: 60s
24
- depends_on:
25
- - scanner: market_regime
26
- required: false
27
- max_age: 2h
28
- on_missing: degrade
29
- on_stale: degrade
30
- blocked_assets: []
31
- config:
32
- topN: 100
33
- minRankJump: 2
34
- minTopTradersGain: 0.02
35
- minScansBeforeSignals: 1
36
- historyLimit: 60
37
- immediateJumpThreshold: 5
38
- deepClimbRankThreshold: 40
39
- contribExplosionMultiplier: 1.5
40
- contribAccelThreshold: 0.001
41
- minVelocityForDeepClimber: 0.0001
42
- erraticReversalThreshold: 10
43
- climbStreakScans: 2
44
- rankClimbThreshold: 2
45
- firstJumpMinPrevRank: 15
46
- minLeverage: 2
47
- blacklist: []
48
-
49
- # ── Macro context: BTC+ETH regime classification (every 4h) ──
50
- - name: market_regime
51
- type: market_regime
52
- interval: 14400s
53
- config:
54
- btcWeight: 0.6
55
- ethWeight: 0.4
56
- emaFast: 9
57
- emaSlow: 21
58
- neutralThreshold: 0.3
59
-
60
- # ── SM conviction reversal detection (every 5 min) ──
61
- - name: sm_flip
62
- type: sm_flip
63
- interval: 300s
64
- config:
65
- minConviction: 4
66
-
67
- # ── Margin safety net (every 5 min) ──
68
- - name: watchdog
69
- type: liquidation_watchdog
70
- interval: 300s
71
- config:
72
- bufferWarningPct: 50
73
- bufferCriticalPct: 30
74
- liqDistanceWarningPct: 30
75
- roeDangerPct: -15
76
-
77
- # ── Infrastructure: prescreener for opportunity scanner (every 60s) ──
78
- - name: prescreener
79
- type: prescreener
80
- interval: 60s
81
- config:
82
- topN: 50
83
- minDayVolume: 200000
84
- minLeverage: 2
85
- minOpenInterest: 0
86
-
87
- # ── Secondary deep scan: 4-pillar opportunity scoring (every 10 min) ──
88
- - name: opportunity
89
- type: opportunity
90
- interval: 600s
91
- depends_on:
92
- - scanner: prescreener
93
- required: true
94
- max_age: 5m
95
- - scanner: market_regime
96
- required: false
97
- max_age: 4h
98
- on_missing: degrade
99
- on_stale: degrade
100
- config:
101
- minCompositeScore: 30
102
- maxCandidates: 30
103
- minDayVolume: 200000
104
-
105
- actions:
106
- # ── Entry: LLM relaxed filter on emerging mover signals ──
107
- - name: fox_entry
108
- action_type: OPEN_POSITION
109
- decision_mode: llm
110
- decision_model: ${DECISION_MODEL}
111
- scanners: [emerging_movers]
112
- min_confidence: 4
113
- params:
114
- order_type: FEE_OPTIMIZED_LIMIT
115
- fee_optimized_limit_options:
116
- ensure_execution_as_taker: true
117
- execution_timeout_seconds: 15
118
- context:
119
- - type: signal
120
- scanner: emerging_movers
121
- - type: context
122
- scanner: market_regime
123
- decision_prompt: |
124
- You are the FOX v1.6 entry filter in EVALUATION MODE. Evaluate emerging mover
125
- signals with relaxed thresholds to maximize signal throughput for functional testing.
126
-
127
- SIGNAL DATA:
128
- {{emerging_movers}}
129
-
130
- MARKET REGIME:
131
- {{regime}}
132
-
133
- ═══ LAYER 1: SIGNAL DETECTION (relaxed) ═══
134
- - Must have at least one of: FIRST_JUMP, IMMEDIATE_MOVER, DEEP_CLIMBER, CONTRIB_EXPLOSION
135
- - rankJumpThisScan ≥ 5 OR contribVelocity > 5
136
- - Asset at #1-5 for 3+ scans → SKIP (move is over)
137
-
138
- ═══ LAYER 2: SCORING (minimum 4 points) ═══
139
- FIRST_JUMP: +3
140
- IMMEDIATE_MOVER: +2
141
- contribVelocity > 5: +2
142
- CONTRIB_EXPLOSION: +2
143
- DEEP_CLIMBER: +1
144
- RANK_UP: +1
145
- CLIMBING: +1
146
- ACCEL: +1
147
- STREAK: +1
148
- BTC 1h bias aligned: +1
149
-
150
- Minimum requirements: score ≥ 4, reasons ≥ 2, contribVelocity > 2
151
-
152
- ═══ LAYER 3: VELOCITY & PRICE ACTION (relaxed) ═══
153
- - Negative velocity without any jump reason → SKIP
154
- - Any positive velocity is sufficient for all signal types
155
- - Erratic rank history → SKIP only if no strong reason (FIRST_JUMP/CONTRIB_EXPLOSION)
156
-
157
- ═══ LAYER 4: LEVERAGE & ASSET CHECKS (relaxed) ═══
158
- - Max leverage for asset must be ≥ 2x
159
- - XYZ equities: ignore trader count, use leverageType "ISOLATED" and dex "xyz"
160
- - ≥ 5 SM traders required (crypto only, waived for XYZ)
161
-
162
- ═══ LAYER 5: MARKET REGIME (relaxed) ═══
163
- - BEARISH: prefer SHORT, but LONG allowed if score ≥ 6
164
- - BULLISH: prefer LONG, but SHORT allowed if score ≥ 6
165
- - NEUTRAL or stale: both directions allowed
166
-
167
- ═══ ROTATION (slots full + new signal) ═══
168
- - Weakest position has negative ROE → CUT and ENTER new
169
- - Weakest has positive ROE or SM conviction 3+ → HOLD
170
- - Never rotate positions younger than 5 minutes
171
-
172
- ═══ ANTI-PATTERNS (hard blocks) ═══
173
- - Rank #1-5 for 3+ scans → move is over
174
- - Burned/blacklisted asset → SKIP
175
-
176
- Respond:
177
- {
178
- "execute": true/false,
179
- "actionType": "OPEN_POSITION",
180
- "confidence": 1-10,
181
- "reasoning": "one sentence",
182
- "payload": {
183
- "signals": [
184
- { "asset": "<ticker>", "direction": "LONG" or "SHORT", "reason": "one sentence", "rotate_out": "<asset_to_cut>", "leverage": "<optional number>", "margin": "<optional $ amount>" }
185
- ]
186
- }
187
- }
188
-
189
- # ── SM flip: immediate close on conviction reversal ──
190
- - name: sm_flip_close
191
- action_type: CLOSE_POSITION
192
- decision_mode: rule
193
- scanners: [sm_flip]
194
- min_confidence: 1
195
- params:
196
- order_type: FEE_OPTIMIZED_LIMIT
197
- fee_optimized_limit_options:
198
- ensure_execution_as_taker: true
199
- execution_timeout_seconds: 10
200
-
201
- # ── Watchdog: emergency close on margin danger ──
202
- - name: watchdog_close
203
- action_type: CLOSE_POSITION
204
- decision_mode: rule
205
- scanners: [watchdog]
206
- min_confidence: 1
207
- params:
208
- order_type: MARKET
209
-
210
- # ── DSL — trailing exit
211
- exit:
212
- engine: dsl
213
- interval_seconds: 30
214
- order_type: FEE_OPTIMIZED_LIMIT
215
- fee_optimized_limit_options:
216
- ensure_execution_as_taker: true
217
- execution_timeout_seconds: 15
218
- dsl_preset:
219
- hard_timeout:
220
- enabled: false
221
- interval_in_minutes: 360
222
- weak_peak_cut:
223
- enabled: false
224
- interval_in_minutes: 120
225
- min_value: 5
226
- dead_weight_cut:
227
- enabled: false
228
- interval_in_minutes: 60
229
- phase1:
230
- enabled: true
231
- max_loss_pct: 4.0
232
- retrace_threshold: 3.0
233
- consecutive_breaches_required: 1
234
- phase2:
235
- enabled: true
236
- tiers:
237
- - { trigger_pct: 7, lock_hw_pct: 40 }
238
- - { trigger_pct: 12, lock_hw_pct: 55 }
239
- - { trigger_pct: 15, lock_hw_pct: 75 }
240
- - { trigger_pct: 20, lock_hw_pct: 85 }