@senpi/runtime 3.0.3-dev.runtime-phase-2.20260625210428 → 3.0.4-dev.runtime-phase-2.20260626011132
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.
- package/dist/actions/decision-engine.js +1 -1
- package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
- package/dist/actions/open-position/open-position.action.js +21 -12
- package/dist/actions/open-position/open-position.action.js.map +1 -1
- package/dist/actions/open-position/resolve-margin.d.ts +18 -3
- package/dist/actions/open-position/resolve-margin.d.ts.map +1 -1
- package/dist/actions/open-position/resolve-margin.js +22 -9
- package/dist/actions/open-position/resolve-margin.js.map +1 -1
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +21 -3
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-mount.js +10 -1
- package/dist/runtime-api/intake/intake-mount.js.map +1 -1
- package/dist/runtime-api/intake/types.d.ts +5 -6
- package/dist/runtime-api/intake/types.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.js +3 -2
- package/dist/runtime-api/routes/signals.js.map +1 -1
- package/dist/runtime-api/routes/signals.schema.d.ts +1 -2
- package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.schema.js +5 -3
- package/dist/runtime-api/routes/signals.schema.js.map +1 -1
- package/dist/scanners/external/scaffold/delivery.py +19 -0
- package/dist/scanners/external/scaffold/signal_envelope.py +57 -19
- package/dist/scanners/external-scanner-receiver.d.ts +9 -3
- package/dist/scanners/external-scanner-receiver.d.ts.map +1 -1
- package/dist/scanners/external-scanner-receiver.js +13 -5
- package/dist/scanners/external-scanner-receiver.js.map +1 -1
- package/dist/scanners/providers/factory.js +7 -2
- package/dist/scanners/providers/factory.js.map +1 -1
- package/dist/strategy/strategy-state.js +5 -0
- package/dist/strategy/strategy-state.js.map +1 -1
- package/dist/types/scanner.d.ts +12 -3
- package/dist/types/scanner.d.ts.map +1 -1
- package/examples/strategies/iguana/README.md +4 -4
- package/examples/strategies/iguana/recipe.yaml +1 -1
- package/examples/strategies/iguana/scanners/scan.py +4 -5
- package/examples/strategies/raptor/README.md +2 -2
- package/examples/strategies/raptor/recipe.yaml +1 -1
- package/examples/strategies/raptor/scanners/scan.py +5 -6
- package/examples/strategies/spider/README.md +3 -3
- package/examples/strategies/spider/scalp/recipe.yaml +1 -1
- package/examples/strategies/spider/scalp/scanners/scan.py +1 -1
- package/examples/strategies/spider/swing/recipe.yaml +1 -1
- package/examples/strategies/spider/swing/scanners/scan.py +3 -3
- package/examples/strategies/turbine/README.md +12 -9
- package/examples/strategies/turbine/recipe-runners.yaml +2 -2
- package/examples/strategies/turbine/recipe-volume.yaml +2 -2
- package/examples/strategies/turbine/scanners/scan.py +10 -6
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ ONE scanner, TWO recipes. Turbine's two legs (volume + runners) ran the IDENTICA
|
|
|
7
7
|
rotation alpha on the source; only the DSL exit preset and the per-slot sizing differed, and
|
|
8
8
|
those live entirely in the recipe YAMLs. So both recipe-volume.yaml and recipe-runners.yaml
|
|
9
9
|
point `path: ./scanners` + `entrypoint: scan.py` at THIS one module. The `inputs` block carries
|
|
10
|
-
the per-leg sizing (
|
|
10
|
+
the per-leg sizing (marginPct, leverage, slots) so the same code emits correctly-sized signals
|
|
11
11
|
for whichever leg supervises it.
|
|
12
12
|
|
|
13
13
|
What stayed faithful to the source (see scoring.py — ported verbatim):
|
|
@@ -39,9 +39,10 @@ FLAGS — behaviors that changed under the v2 contract (do NOT read as silent dr
|
|
|
39
39
|
computed effective_slots = min(maxSlots, account_value / margin_per_slot) and emitted at
|
|
40
40
|
most that many signals per tick. In v2 the runtime owns slot count (strategy.slots) and
|
|
41
41
|
affordability (risk gates), so scan() emits ALL candidates clearing the gates (held +
|
|
42
|
-
cooldown + spread), carrying
|
|
43
|
-
at most `maxSlots` candidates per tick (the rotation only advances
|
|
44
|
-
scanner doesn't flood the queue, but the runtime makes the final
|
|
42
|
+
cooldown + spread), carrying marginPct (percent of withdrawable) + leverage at each signal's
|
|
43
|
+
TOP LEVEL. We still emit at most `maxSlots` candidates per tick (the rotation only advances
|
|
44
|
+
that many times) so the scanner doesn't flood the queue, but the runtime makes the final
|
|
45
|
+
open/skip decision.
|
|
45
46
|
|
|
46
47
|
3. random pool/direction picks are non-deterministic — kept verbatim (this is the source's
|
|
47
48
|
design: rotation desync + neutral-regime coin flip). Tests assert STRUCTURE (valid gated
|
|
@@ -186,7 +187,10 @@ def scan(inputs, ctx):
|
|
|
186
187
|
spread_main_bps = float(inputs.get("spreadMainBps", 3))
|
|
187
188
|
spread_xyz_bps = float(inputs.get("spreadXyzBps", 10))
|
|
188
189
|
leg_leverage = float(inputs.get("leverage", 5))
|
|
189
|
-
|
|
190
|
+
# marginPct: percent of withdrawable to size each slot (0–100). Default 20 is
|
|
191
|
+
# an example; the old fixed-USD intent can't be preserved as a percent without
|
|
192
|
+
# knowing account size. Set this in the recipe inputs: block.
|
|
193
|
+
margin_pct = float(inputs.get("marginPct", 20))
|
|
190
194
|
max_slots = int(inputs.get("maxSlots", 7))
|
|
191
195
|
|
|
192
196
|
held_set, _account_value = _get_held(ctx)
|
|
@@ -246,7 +250,7 @@ def scan(inputs, ctx):
|
|
|
246
250
|
out.append({
|
|
247
251
|
"asset": asset,
|
|
248
252
|
"direction": direction,
|
|
249
|
-
"
|
|
253
|
+
"marginPct": float(margin_pct),
|
|
250
254
|
"leverage": float(leverage),
|
|
251
255
|
"data": {
|
|
252
256
|
"thesis": thesis,
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "runtime",
|
|
3
3
|
"name": "Senpi Runtime",
|
|
4
4
|
"description": "Senpi runtime plugin for OpenClaw. Orchestrates scanners, LLM-based trade decisions, and a DSL trailing stop-loss exit engine.",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.4",
|
|
6
6
|
"commandAliases": [{ "name": "senpi" }],
|
|
7
7
|
"activation": {
|
|
8
8
|
"onStartup": true,
|
package/package.json
CHANGED