@senpi-ai/runtime 1.1.3 → 3.0.3
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/README.md +10 -9
- package/dist/actions/action-runtime-module.d.ts.map +1 -1
- package/dist/actions/action-runtime-module.js +1 -1
- package/dist/actions/action-runtime-module.js.map +1 -1
- package/dist/actions/close-position/close-position.action.d.ts.map +1 -1
- package/dist/actions/close-position/close-position.action.js +61 -14
- package/dist/actions/close-position/close-position.action.js.map +1 -1
- package/dist/actions/decision-engine.d.ts.map +1 -1
- package/dist/actions/decision-engine.js +3 -0
- package/dist/actions/decision-engine.js.map +1 -1
- package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
- package/dist/actions/open-position/open-position.action.js +140 -29
- package/dist/actions/open-position/open-position.action.js.map +1 -1
- package/dist/actions/position-tracker/position-tracker.action.d.ts +6 -0
- package/dist/actions/position-tracker/position-tracker.action.d.ts.map +1 -1
- package/dist/actions/position-tracker/position-tracker.action.js +48 -0
- package/dist/actions/position-tracker/position-tracker.action.js.map +1 -1
- package/dist/actions/tracking-helpers.d.ts +16 -1
- package/dist/actions/tracking-helpers.d.ts.map +1 -1
- package/dist/actions/tracking-helpers.js +55 -9
- package/dist/actions/tracking-helpers.js.map +1 -1
- package/dist/actions/types.d.ts +10 -2
- package/dist/actions/types.d.ts.map +1 -1
- package/dist/actions/types.js +8 -0
- package/dist/actions/types.js.map +1 -1
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +84 -82
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +16 -110
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/constants/dsl/index.d.ts +2 -0
- package/dist/constants/dsl/index.d.ts.map +1 -1
- package/dist/constants/dsl/index.js +2 -0
- package/dist/constants/dsl/index.js.map +1 -1
- package/dist/dsl/config/parse-tiers.d.ts.map +1 -1
- package/dist/dsl/config/parse-tiers.js +6 -2
- package/dist/dsl/config/parse-tiers.js.map +1 -1
- package/dist/dsl/engine-client/config-mapping.d.ts +3 -1
- package/dist/dsl/engine-client/config-mapping.d.ts.map +1 -1
- package/dist/dsl/engine-client/config-mapping.js +3 -1
- package/dist/dsl/engine-client/config-mapping.js.map +1 -1
- package/dist/dsl/engine-client/event-mapping.d.ts +2 -0
- package/dist/dsl/engine-client/event-mapping.d.ts.map +1 -1
- package/dist/dsl/engine-client/event-mapping.js +3 -0
- package/dist/dsl/engine-client/event-mapping.js.map +1 -1
- package/dist/dsl/events/build-closed-event.d.ts.map +1 -1
- package/dist/dsl/events/build-closed-event.js +1 -0
- package/dist/dsl/events/build-closed-event.js.map +1 -1
- package/dist/dsl/events/guards.d.ts.map +1 -1
- package/dist/dsl/events/guards.js +10 -0
- package/dist/dsl/events/guards.js.map +1 -1
- package/dist/dsl/events/handlers.d.ts +18 -2
- package/dist/dsl/events/handlers.d.ts.map +1 -1
- package/dist/dsl/events/handlers.js +304 -208
- package/dist/dsl/events/handlers.js.map +1 -1
- package/dist/dsl/events/initial-state.d.ts.map +1 -1
- package/dist/dsl/events/initial-state.js +3 -1
- package/dist/dsl/events/initial-state.js.map +1 -1
- package/dist/dsl/monitor/create-monitor.d.ts +15 -0
- package/dist/dsl/monitor/create-monitor.d.ts.map +1 -1
- package/dist/dsl/monitor/create-monitor.js +76 -9
- package/dist/dsl/monitor/create-monitor.js.map +1 -1
- package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
- package/dist/dsl/monitor/process-one-position.js +268 -82
- package/dist/dsl/monitor/process-one-position.js.map +1 -1
- package/dist/dsl/plugin/index.d.ts +16 -1
- package/dist/dsl/plugin/index.d.ts.map +1 -1
- package/dist/dsl/plugin/index.js +35 -4
- package/dist/dsl/plugin/index.js.map +1 -1
- package/dist/dsl/plugin/options.d.ts +18 -0
- package/dist/dsl/plugin/options.d.ts.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +272 -32
- package/dist/index.js.map +1 -1
- package/dist/recording/emitter.d.ts +27 -0
- package/dist/recording/emitter.d.ts.map +1 -0
- package/dist/recording/emitter.js +2 -0
- package/dist/recording/emitter.js.map +1 -0
- package/dist/recording/identity.d.ts +34 -0
- package/dist/recording/identity.d.ts.map +1 -0
- package/dist/recording/identity.js +2 -0
- package/dist/recording/identity.js.map +1 -0
- package/dist/recording/index.d.ts +11 -0
- package/dist/recording/index.d.ts.map +1 -0
- package/dist/recording/index.js +2 -0
- package/dist/recording/index.js.map +1 -0
- package/dist/recording/noop-emitter.d.ts +23 -0
- package/dist/recording/noop-emitter.d.ts.map +1 -0
- package/dist/recording/noop-emitter.js +22 -0
- package/dist/recording/noop-emitter.js.map +1 -0
- package/dist/recording/otel/attributes.d.ts +35 -0
- package/dist/recording/otel/attributes.d.ts.map +1 -0
- package/dist/recording/otel/attributes.js +131 -0
- package/dist/recording/otel/attributes.js.map +1 -0
- package/dist/recording/otel/constants.d.ts +123 -0
- package/dist/recording/otel/constants.d.ts.map +1 -0
- package/dist/recording/otel/constants.js +172 -0
- package/dist/recording/otel/constants.js.map +1 -0
- package/dist/recording/otel/ids.d.ts +25 -0
- package/dist/recording/otel/ids.d.ts.map +1 -0
- package/dist/recording/otel/ids.js +37 -0
- package/dist/recording/otel/ids.js.map +1 -0
- package/dist/recording/otel/index.d.ts +13 -0
- package/dist/recording/otel/index.d.ts.map +1 -0
- package/dist/recording/otel/index.js +9 -0
- package/dist/recording/otel/index.js.map +1 -0
- package/dist/recording/otel/mappers.d.ts +100 -0
- package/dist/recording/otel/mappers.d.ts.map +1 -0
- package/dist/recording/otel/mappers.js +683 -0
- package/dist/recording/otel/mappers.js.map +1 -0
- package/dist/recording/otel/otel-emitter.d.ts +43 -0
- package/dist/recording/otel/otel-emitter.d.ts.map +1 -0
- package/dist/recording/otel/otel-emitter.js +99 -0
- package/dist/recording/otel/otel-emitter.js.map +1 -0
- package/dist/recording/otel/redaction.d.ts +47 -0
- package/dist/recording/otel/redaction.d.ts.map +1 -0
- package/dist/recording/otel/redaction.js +88 -0
- package/dist/recording/otel/redaction.js.map +1 -0
- package/dist/recording/records.d.ts +565 -0
- package/dist/recording/records.d.ts.map +1 -0
- package/dist/recording/records.js +14 -0
- package/dist/recording/records.js.map +1 -0
- package/dist/recording/transport/batcher.d.ts +59 -0
- package/dist/recording/transport/batcher.d.ts.map +1 -0
- package/dist/recording/transport/batcher.js +234 -0
- package/dist/recording/transport/batcher.js.map +1 -0
- package/dist/recording/transport/client.d.ts +41 -0
- package/dist/recording/transport/client.d.ts.map +1 -0
- package/dist/recording/transport/client.js +69 -0
- package/dist/recording/transport/client.js.map +1 -0
- package/dist/recording/transport/config.d.ts +53 -0
- package/dist/recording/transport/config.d.ts.map +1 -0
- package/dist/recording/transport/config.js +41 -0
- package/dist/recording/transport/config.js.map +1 -0
- package/dist/recording/transport/index.d.ts +16 -0
- package/dist/recording/transport/index.d.ts.map +1 -0
- package/dist/recording/transport/index.js +12 -0
- package/dist/recording/transport/index.js.map +1 -0
- package/dist/recording/transport/rows.d.ts +88 -0
- package/dist/recording/transport/rows.d.ts.map +1 -0
- package/dist/recording/transport/rows.js +15 -0
- package/dist/recording/transport/rows.js.map +1 -0
- package/dist/recording/wiring/emitter-factory.d.ts +39 -0
- package/dist/recording/wiring/emitter-factory.d.ts.map +1 -0
- package/dist/recording/wiring/emitter-factory.js +62 -0
- package/dist/recording/wiring/emitter-factory.js.map +1 -0
- package/dist/recording/wiring/identity.d.ts +27 -0
- package/dist/recording/wiring/identity.d.ts.map +1 -0
- package/dist/recording/wiring/identity.js +51 -0
- package/dist/recording/wiring/identity.js.map +1 -0
- package/dist/recording/wiring/index.d.ts +12 -0
- package/dist/recording/wiring/index.d.ts.map +1 -0
- package/dist/recording/wiring/index.js +9 -0
- package/dist/recording/wiring/index.js.map +1 -0
- package/dist/recording/wiring/record-builders.d.ts +107 -0
- package/dist/recording/wiring/record-builders.d.ts.map +1 -0
- package/dist/recording/wiring/record-builders.js +706 -0
- package/dist/recording/wiring/record-builders.js.map +1 -0
- package/dist/recording/wiring/subscriber.d.ts +28 -0
- package/dist/recording/wiring/subscriber.d.ts.map +1 -0
- package/dist/recording/wiring/subscriber.js +173 -0
- package/dist/recording/wiring/subscriber.js.map +1 -0
- package/dist/recording/wiring/values.d.ts +19 -0
- package/dist/recording/wiring/values.d.ts.map +1 -0
- package/dist/recording/wiring/values.js +49 -0
- package/dist/recording/wiring/values.js.map +1 -0
- package/dist/runtime/auto-update/command-runner.d.ts.map +1 -1
- package/dist/runtime/auto-update/command-runner.js +5 -1
- package/dist/runtime/auto-update/command-runner.js.map +1 -1
- package/dist/runtime/auto-update/resolve-package-name.d.ts +10 -0
- package/dist/runtime/auto-update/resolve-package-name.d.ts.map +1 -0
- package/dist/runtime/auto-update/resolve-package-name.js +35 -0
- package/dist/runtime/auto-update/resolve-package-name.js.map +1 -0
- package/dist/runtime/auto-update/run-update-command.d.ts +2 -0
- package/dist/runtime/auto-update/run-update-command.d.ts.map +1 -0
- package/dist/runtime/auto-update/run-update-command.js +37 -0
- package/dist/runtime/auto-update/run-update-command.js.map +1 -0
- package/dist/runtime/create-runtime-context.d.ts +2 -0
- package/dist/runtime/create-runtime-context.d.ts.map +1 -1
- package/dist/runtime/create-runtime-context.js +1 -0
- package/dist/runtime/create-runtime-context.js.map +1 -1
- package/dist/runtime/create-scanner-module.d.ts +4 -3
- package/dist/runtime/create-scanner-module.d.ts.map +1 -1
- package/dist/runtime/create-scanner-module.js +14 -5
- package/dist/runtime/create-scanner-module.js.map +1 -1
- package/dist/runtime/create-scanner-providers-for-run.d.ts.map +1 -1
- package/dist/runtime/create-scanner-providers-for-run.js +12 -1
- package/dist/runtime/create-scanner-providers-for-run.js.map +1 -1
- package/dist/runtime/load-runtime-config.d.ts +9 -0
- package/dist/runtime/load-runtime-config.d.ts.map +1 -1
- package/dist/runtime/load-runtime-config.js +41 -8
- package/dist/runtime/load-runtime-config.js.map +1 -1
- package/dist/runtime/map-strategies-registration.js +7 -8
- package/dist/runtime/map-strategies-registration.js.map +1 -1
- package/dist/runtime/map-strategies.d.ts.map +1 -1
- package/dist/runtime/map-strategies.js +12 -3
- package/dist/runtime/map-strategies.js.map +1 -1
- package/dist/runtime/recipe-version.d.ts +1 -1
- package/dist/runtime/recipe-version.d.ts.map +1 -1
- package/dist/runtime/recipe-version.js +1 -1
- package/dist/runtime/recipe-version.js.map +1 -1
- package/dist/runtime/reconcile-decide.d.ts +73 -0
- package/dist/runtime/reconcile-decide.d.ts.map +1 -0
- package/dist/runtime/reconcile-decide.js +186 -0
- package/dist/runtime/reconcile-decide.js.map +1 -0
- package/dist/runtime/reconcile-run.d.ts +62 -0
- package/dist/runtime/reconcile-run.d.ts.map +1 -0
- package/dist/runtime/reconcile-run.js +173 -0
- package/dist/runtime/reconcile-run.js.map +1 -0
- package/dist/runtime/reconcile-state.d.ts +44 -0
- package/dist/runtime/reconcile-state.d.ts.map +1 -1
- package/dist/runtime/reconcile-state.js +80 -44
- package/dist/runtime/reconcile-state.js.map +1 -1
- package/dist/runtime/risk-guard.d.ts.map +1 -1
- package/dist/runtime/risk-guard.js +17 -12
- package/dist/runtime/risk-guard.js.map +1 -1
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +3 -2
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/runtime-schema.d.ts +4056 -793
- package/dist/runtime/runtime-schema.d.ts.map +1 -1
- package/dist/runtime/runtime-schema.js +183 -46
- package/dist/runtime/runtime-schema.js.map +1 -1
- package/dist/runtime/runtime-version.d.ts +3 -6
- package/dist/runtime/runtime-version.d.ts.map +1 -1
- package/dist/runtime/runtime-version.js +3 -6
- package/dist/runtime/runtime-version.js.map +1 -1
- package/dist/runtime/runtime.d.ts +47 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +516 -146
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/scanner-registry.d.ts +1 -1
- package/dist/runtime/scanner-registry.d.ts.map +1 -1
- package/dist/runtime/scanner-registry.js +3 -12
- package/dist/runtime/scanner-registry.js.map +1 -1
- package/dist/runtime/strategy-registry.d.ts +6 -0
- package/dist/runtime/strategy-registry.d.ts.map +1 -1
- package/dist/runtime/strategy-registry.js +1 -0
- package/dist/runtime/strategy-registry.js.map +1 -1
- package/dist/runtime/supervisor/long-running-supervisor.d.ts +222 -0
- package/dist/runtime/supervisor/long-running-supervisor.d.ts.map +1 -0
- package/dist/runtime/supervisor/long-running-supervisor.js +625 -0
- package/dist/runtime/supervisor/long-running-supervisor.js.map +1 -0
- package/dist/runtime/supervisor/orphan-sweep.d.ts +36 -0
- package/dist/runtime/supervisor/orphan-sweep.d.ts.map +1 -0
- package/dist/runtime/supervisor/orphan-sweep.js +255 -0
- package/dist/runtime/supervisor/orphan-sweep.js.map +1 -0
- package/dist/runtime/supervisor/supervisor-utils.d.ts +37 -0
- package/dist/runtime/supervisor/supervisor-utils.d.ts.map +1 -0
- package/dist/runtime/supervisor/supervisor-utils.js +175 -0
- package/dist/runtime/supervisor/supervisor-utils.js.map +1 -0
- package/dist/runtime-api/handlers/ingest-signals.d.ts +3 -3
- package/dist/runtime-api/handlers/ingest-signals.js +3 -3
- package/dist/runtime-api/intake/acceptance-record.d.ts +103 -0
- package/dist/runtime-api/intake/acceptance-record.d.ts.map +1 -0
- package/dist/runtime-api/intake/acceptance-record.js +192 -0
- package/dist/runtime-api/intake/acceptance-record.js.map +1 -0
- package/dist/runtime-api/intake/intake-context.d.ts +31 -0
- package/dist/runtime-api/intake/intake-context.d.ts.map +1 -0
- package/dist/runtime-api/intake/intake-context.js +21 -0
- package/dist/runtime-api/intake/intake-context.js.map +1 -0
- package/dist/runtime-api/intake/intake-mount.d.ts +118 -0
- package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -0
- package/dist/runtime-api/intake/intake-mount.js +193 -0
- package/dist/runtime-api/intake/intake-mount.js.map +1 -0
- package/dist/runtime-api/intake/liveness-store.d.ts +32 -0
- package/dist/runtime-api/intake/liveness-store.d.ts.map +1 -0
- package/dist/runtime-api/intake/liveness-store.js +31 -0
- package/dist/runtime-api/intake/liveness-store.js.map +1 -0
- package/dist/runtime-api/intake/process-error-post.d.ts +15 -0
- package/dist/runtime-api/intake/process-error-post.d.ts.map +1 -0
- package/dist/runtime-api/intake/process-error-post.js +19 -0
- package/dist/runtime-api/intake/process-error-post.js.map +1 -0
- package/dist/runtime-api/intake/process-signal-post.d.ts +73 -0
- package/dist/runtime-api/intake/process-signal-post.d.ts.map +1 -0
- package/dist/runtime-api/intake/process-signal-post.js +188 -0
- package/dist/runtime-api/intake/process-signal-post.js.map +1 -0
- package/dist/runtime-api/intake/scanner-launcher.d.ts +133 -0
- package/dist/runtime-api/intake/scanner-launcher.d.ts.map +1 -0
- package/dist/runtime-api/intake/scanner-launcher.js +204 -0
- package/dist/runtime-api/intake/scanner-launcher.js.map +1 -0
- package/dist/runtime-api/intake/scanner-registry.d.ts +36 -0
- package/dist/runtime-api/intake/scanner-registry.d.ts.map +1 -0
- package/dist/runtime-api/intake/scanner-registry.js +29 -0
- package/dist/runtime-api/intake/scanner-registry.js.map +1 -0
- package/dist/runtime-api/intake/types.d.ts +61 -0
- package/dist/runtime-api/intake/types.d.ts.map +1 -0
- package/dist/runtime-api/intake/types.js +8 -0
- package/dist/runtime-api/intake/types.js.map +1 -0
- package/dist/runtime-api/routes/signals.d.ts +20 -40
- package/dist/runtime-api/routes/signals.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.js +119 -75
- package/dist/runtime-api/routes/signals.js.map +1 -1
- package/dist/runtime-api/routes/signals.schema.d.ts +24 -86
- package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.schema.js +35 -50
- package/dist/runtime-api/routes/signals.schema.js.map +1 -1
- package/dist/runtime-api/server.d.ts +15 -6
- package/dist/runtime-api/server.d.ts.map +1 -1
- package/dist/runtime-api/server.js +12 -12
- package/dist/runtime-api/server.js.map +1 -1
- package/dist/scanners/events.d.ts +6 -0
- package/dist/scanners/events.d.ts.map +1 -1
- package/dist/scanners/events.js.map +1 -1
- package/dist/scanners/external/scaffold/__init__.py +16 -0
- package/dist/scanners/external/scaffold/__main__.py +155 -0
- package/dist/scanners/external/scaffold/ctx.py +78 -0
- package/dist/scanners/external/scaffold/delivery.py +263 -0
- package/dist/scanners/external/scaffold/entrypoint_loader.py +151 -0
- package/dist/scanners/external/scaffold/http_post.py +70 -0
- package/dist/scanners/external/scaffold/journal.py +247 -0
- package/dist/scanners/external/scaffold/loop_primitives.py +65 -0
- package/dist/scanners/external/scaffold/requirements.txt +11 -0
- package/dist/scanners/external/scaffold/scaffold.py +361 -0
- package/dist/scanners/external/scaffold/scaffold_state.py +114 -0
- package/dist/scanners/external/scaffold/senpi_mcp.py +250 -0
- package/dist/scanners/external/scaffold/signal_envelope.py +220 -0
- package/dist/scanners/external/scaffold/state_manager.py +175 -0
- package/dist/scanners/external-scanner-receiver.d.ts +17 -1
- package/dist/scanners/external-scanner-receiver.d.ts.map +1 -1
- package/dist/scanners/external-scanner-receiver.js +16 -3
- package/dist/scanners/external-scanner-receiver.js.map +1 -1
- package/dist/scanners/implementations/external-scanner.d.ts.map +1 -1
- package/dist/scanners/implementations/external-scanner.js +7 -1
- package/dist/scanners/implementations/external-scanner.js.map +1 -1
- package/dist/scanners/implementations/momentum.d.ts.map +1 -1
- package/dist/scanners/implementations/momentum.js +16 -0
- package/dist/scanners/implementations/momentum.js.map +1 -1
- package/dist/scanners/runtime-module.d.ts.map +1 -1
- package/dist/scanners/runtime-module.js +9 -1
- package/dist/scanners/runtime-module.js.map +1 -1
- package/dist/scripts/run-dsl-standalone-live.d.ts +1 -1
- package/dist/scripts/run-dsl-standalone-live.js +5 -3
- package/dist/scripts/run-dsl-standalone-live.js.map +1 -1
- package/dist/senpi/client.d.ts +56 -4
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +123 -24
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/index.d.ts +2 -1
- package/dist/senpi/index.d.ts.map +1 -1
- package/dist/senpi/index.js +1 -1
- package/dist/senpi/index.js.map +1 -1
- package/dist/senpi/types.d.ts +1 -2
- package/dist/senpi/types.d.ts.map +1 -1
- package/dist/state/state-manager.d.ts +17 -0
- package/dist/state/state-manager.d.ts.map +1 -1
- package/dist/state/state-manager.js +55 -4
- package/dist/state/state-manager.js.map +1 -1
- package/dist/strategy/strategy-state.d.ts +9 -1
- package/dist/strategy/strategy-state.d.ts.map +1 -1
- package/dist/strategy/strategy-state.js +62 -9
- package/dist/strategy/strategy-state.js.map +1 -1
- package/dist/tracking/build-rehydrate-items.d.ts +15 -0
- package/dist/tracking/build-rehydrate-items.d.ts.map +1 -0
- package/dist/tracking/build-rehydrate-items.js +19 -0
- package/dist/tracking/build-rehydrate-items.js.map +1 -0
- package/dist/tracking/constants.d.ts.map +1 -1
- package/dist/tracking/constants.js +2 -0
- package/dist/tracking/constants.js.map +1 -1
- package/dist/tracking/index.d.ts +3 -0
- package/dist/tracking/index.d.ts.map +1 -1
- package/dist/tracking/index.js +2 -0
- package/dist/tracking/index.js.map +1 -1
- package/dist/tracking/position-id-registry.d.ts +69 -0
- package/dist/tracking/position-id-registry.d.ts.map +1 -0
- package/dist/tracking/position-id-registry.js +139 -0
- package/dist/tracking/position-id-registry.js.map +1 -0
- package/dist/tracking/spans/fan-out-span-transport.d.ts +22 -0
- package/dist/tracking/spans/fan-out-span-transport.d.ts.map +1 -0
- package/dist/tracking/spans/fan-out-span-transport.js +49 -0
- package/dist/tracking/spans/fan-out-span-transport.js.map +1 -0
- package/dist/tracking/spans/otel/fit-row-budget.d.ts +22 -0
- package/dist/tracking/spans/otel/fit-row-budget.d.ts.map +1 -0
- package/dist/tracking/spans/otel/fit-row-budget.js +91 -0
- package/dist/tracking/spans/otel/fit-row-budget.js.map +1 -0
- package/dist/tracking/spans/otel/map-span-to-trace-row.d.ts +16 -0
- package/dist/tracking/spans/otel/map-span-to-trace-row.d.ts.map +1 -0
- package/dist/tracking/spans/otel/map-span-to-trace-row.js +227 -0
- package/dist/tracking/spans/otel/map-span-to-trace-row.js.map +1 -0
- package/dist/tracking/spans/otel/recording-span-transport.d.ts +43 -0
- package/dist/tracking/spans/otel/recording-span-transport.d.ts.map +1 -0
- package/dist/tracking/spans/otel/recording-span-transport.js +67 -0
- package/dist/tracking/spans/otel/recording-span-transport.js.map +1 -0
- package/dist/tracking/spans/otel/span-ids.d.ts +22 -0
- package/dist/tracking/spans/otel/span-ids.d.ts.map +1 -0
- package/dist/tracking/spans/otel/span-ids.js +32 -0
- package/dist/tracking/spans/otel/span-ids.js.map +1 -0
- package/dist/tracking/spans/plugin-span-tracker.d.ts +6 -0
- package/dist/tracking/spans/plugin-span-tracker.d.ts.map +1 -1
- package/dist/tracking/spans/plugin-span-tracker.js +82 -9
- package/dist/tracking/spans/plugin-span-tracker.js.map +1 -1
- package/dist/tracking/spans/redact-pii.d.ts +3 -1
- package/dist/tracking/spans/redact-pii.d.ts.map +1 -1
- package/dist/tracking/spans/redact-pii.js +5 -1
- package/dist/tracking/spans/redact-pii.js.map +1 -1
- package/dist/tracking/spans/span-transport.d.ts +6 -0
- package/dist/tracking/spans/span-transport.d.ts.map +1 -1
- package/dist/tracking/spans/span-transport.js +1 -1
- package/dist/tracking/spans/span-transport.js.map +1 -1
- package/dist/types/dsl/index.d.ts +24 -1
- package/dist/types/dsl/index.d.ts.map +1 -1
- package/dist/types/runtime.d.ts +6 -0
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/types/scanner.d.ts +7 -0
- package/dist/types/scanner.d.ts.map +1 -1
- package/dist/types/strategy.d.ts +3 -1
- package/dist/types/strategy.d.ts.map +1 -1
- package/dist/utils/keyed-mutex.d.ts +37 -0
- package/dist/utils/keyed-mutex.d.ts.map +1 -0
- package/dist/utils/keyed-mutex.js +77 -0
- package/dist/utils/keyed-mutex.js.map +1 -0
- package/dist/utils/safe-spawn.d.ts +6 -0
- package/dist/utils/safe-spawn.d.ts.map +1 -0
- package/dist/utils/safe-spawn.js +62 -0
- package/dist/utils/safe-spawn.js.map +1 -0
- package/examples/strategies/README.md +17 -12
- package/examples/strategies/iguana/README.md +135 -0
- package/examples/strategies/iguana/recipe.yaml +137 -0
- package/examples/strategies/iguana/scanners/scan.py +243 -0
- package/examples/strategies/iguana/scanners/scoring.py +152 -0
- package/examples/strategies/raptor/README.md +156 -0
- package/examples/strategies/raptor/recipe.yaml +154 -0
- package/examples/strategies/raptor/scanners/scan.py +349 -0
- package/examples/strategies/raptor/scanners/scoring.py +452 -0
- package/examples/strategies/spider/README.md +89 -0
- package/examples/strategies/spider/scalp/recipe.yaml +129 -0
- package/examples/strategies/spider/scalp/scanners/scan.py +219 -0
- package/examples/strategies/spider/scalp/scanners/scoring.py +179 -0
- package/examples/strategies/spider/swing/recipe.yaml +137 -0
- package/examples/strategies/spider/swing/scanners/scan.py +334 -0
- package/examples/strategies/spider/swing/scanners/scoring.py +184 -0
- package/examples/strategies/turbine/README.md +166 -0
- package/examples/strategies/turbine/recipe-runners.yaml +123 -0
- package/examples/strategies/turbine/recipe-volume.yaml +129 -0
- package/examples/strategies/turbine/scanners/scan.py +283 -0
- package/examples/strategies/turbine/scanners/scoring.py +190 -0
- package/openclaw.plugin.json +12 -1
- package/package.json +3 -3
- package/dist/runtime-api/handlers/group-by-scanner.d.ts +0 -43
- package/dist/runtime-api/handlers/group-by-scanner.d.ts.map +0 -1
- package/dist/runtime-api/handlers/group-by-scanner.js +0 -43
- package/dist/runtime-api/handlers/group-by-scanner.js.map +0 -1
- package/dist/scanners/external/liquidation-watchdog/README.md +0 -107
- package/dist/scanners/external/liquidation-watchdog/liquidation-watchdog.yaml +0 -48
- package/dist/scanners/external/liquidation-watchdog/producer.mjs +0 -336
- package/dist/scanners/external/momentum/README.md +0 -148
- package/dist/scanners/external/momentum/momentum.yaml +0 -116
- package/dist/scanners/external/momentum/producer.mjs +0 -251
- package/dist/scanners/external/shared/ingest.mjs +0 -112
- package/examples/README.md +0 -89
- package/examples/scanners-consumer-quickstart.mjs +0 -134
- package/examples/scanners-emerging-movers-v4.mjs +0 -287
- package/examples/scanners-liquidation-watchdog.mjs +0 -341
- package/examples/scanners-live-mcp.mjs +0 -208
- package/examples/scanners-multi-strategy.mjs +0 -165
- package/examples/scanners-position-tracker-e2e.mjs +0 -225
- package/examples/scanners-scheduled-events.mjs +0 -96
- package/examples/scanners-senpi-provider-client.mjs +0 -182
- package/examples/scanners-single-strategy.mjs +0 -198
- package/examples/strategies/dsl-showcase.yaml +0 -68
- package/examples/strategies/dsl.yaml +0 -51
- package/examples/strategies/fox-minimal-loosened.yaml +0 -240
- package/examples/strategies/fox-minimal.yaml +0 -242
- package/examples/strategies/minimal.yaml +0 -46
- package/examples/strategies/momentum/how-it-works.md +0 -48
- package/examples/strategies/momentum/momentum-guarded.yaml +0 -161
- package/examples/strategies/risk-showcase.yaml +0 -93
- package/examples/strategies/viper.yaml +0 -67
- package/examples/strategies/wolf.yaml +0 -72
- package/examples/yamls/sample-with-dsl-and-emerging-movers.yaml +0 -123
|
@@ -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 }
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
name: fox-minimal
|
|
2
|
-
version: 1.0.0
|
|
3
|
-
description: >
|
|
4
|
-
FOX v1.6 — autonomous momentum trading via @senpi-ai/runtime.
|
|
5
|
-
Emerging movers detect first jumps, LLM entry filter applies the five-layer
|
|
6
|
-
gauntlet, DSL v5.3.1 manages trailing exits, watchdog guards margin health,
|
|
7
|
-
market-regime provides macro context, sm-flip detects conviction reversals.
|
|
8
|
-
|
|
9
|
-
strategy:
|
|
10
|
-
wallet: "${FOX_WALLET}"
|
|
11
|
-
slots: 1
|
|
12
|
-
margin_per_slot: 100
|
|
13
|
-
trading_risk: aggressive
|
|
14
|
-
enabled: true
|
|
15
|
-
|
|
16
|
-
scanners:
|
|
17
|
-
# References in depends_on/actions use these scanner names, not the built-in types.
|
|
18
|
-
# ── Primary signal: emerging movers (every 90s, matching Fox 3-min cron) ──
|
|
19
|
-
- name: emerging_movers
|
|
20
|
-
type: emerging_movers
|
|
21
|
-
interval: 90s
|
|
22
|
-
depends_on:
|
|
23
|
-
- scanner: market_regime
|
|
24
|
-
required: false
|
|
25
|
-
max_age: 2h
|
|
26
|
-
on_missing: degrade
|
|
27
|
-
on_stale: degrade
|
|
28
|
-
blocked_assets: []
|
|
29
|
-
config:
|
|
30
|
-
topN: 50
|
|
31
|
-
minRankJump: 5
|
|
32
|
-
minTopTradersGain: 0.1
|
|
33
|
-
minScansBeforeSignals: 2
|
|
34
|
-
historyLimit: 60
|
|
35
|
-
immediateJumpThreshold: 10
|
|
36
|
-
deepClimbRankThreshold: 25
|
|
37
|
-
contribExplosionMultiplier: 3
|
|
38
|
-
contribAccelThreshold: 0.003
|
|
39
|
-
minVelocityForDeepClimber: 0.0003
|
|
40
|
-
erraticReversalThreshold: 5
|
|
41
|
-
climbStreakScans: 3
|
|
42
|
-
rankClimbThreshold: 3
|
|
43
|
-
firstJumpMinPrevRank: 30
|
|
44
|
-
minLeverage: 7
|
|
45
|
-
blacklist: ["XPL", "kPEPE"]
|
|
46
|
-
|
|
47
|
-
# ── Macro context: BTC+ETH regime classification (every 4h) ──
|
|
48
|
-
- name: market_regime
|
|
49
|
-
type: market_regime
|
|
50
|
-
interval: 14400s
|
|
51
|
-
config:
|
|
52
|
-
btcWeight: 0.6
|
|
53
|
-
ethWeight: 0.4
|
|
54
|
-
emaFast: 9
|
|
55
|
-
emaSlow: 21
|
|
56
|
-
neutralThreshold: 0.3
|
|
57
|
-
|
|
58
|
-
# ── SM conviction reversal detection (every 5 min) ──
|
|
59
|
-
- name: sm_flip
|
|
60
|
-
type: sm_flip
|
|
61
|
-
interval: 300s
|
|
62
|
-
config:
|
|
63
|
-
minConviction: 4
|
|
64
|
-
|
|
65
|
-
# ── Margin safety net (every 5 min) ──
|
|
66
|
-
- name: watchdog
|
|
67
|
-
type: liquidation_watchdog
|
|
68
|
-
interval: 300s
|
|
69
|
-
config:
|
|
70
|
-
bufferWarningPct: 50
|
|
71
|
-
bufferCriticalPct: 30
|
|
72
|
-
liqDistanceWarningPct: 30
|
|
73
|
-
roeDangerPct: -15
|
|
74
|
-
|
|
75
|
-
# ── Infrastructure: prescreener for opportunity scanner (every 60s) ──
|
|
76
|
-
- name: prescreener
|
|
77
|
-
type: prescreener
|
|
78
|
-
interval: 60s
|
|
79
|
-
config:
|
|
80
|
-
topN: 30
|
|
81
|
-
minDayVolume: 500000
|
|
82
|
-
minLeverage: 2
|
|
83
|
-
minOpenInterest: 0
|
|
84
|
-
|
|
85
|
-
# ── Secondary deep scan: 4-pillar opportunity scoring (every 15 min) ──
|
|
86
|
-
- name: opportunity
|
|
87
|
-
type: opportunity
|
|
88
|
-
interval: 900s
|
|
89
|
-
depends_on:
|
|
90
|
-
- scanner: prescreener
|
|
91
|
-
required: true
|
|
92
|
-
max_age: 5m
|
|
93
|
-
- scanner: market_regime
|
|
94
|
-
required: false
|
|
95
|
-
max_age: 4h
|
|
96
|
-
on_missing: degrade
|
|
97
|
-
on_stale: degrade
|
|
98
|
-
config:
|
|
99
|
-
minCompositeScore: 60
|
|
100
|
-
maxCandidates: 15
|
|
101
|
-
minDayVolume: 500000
|
|
102
|
-
|
|
103
|
-
actions:
|
|
104
|
-
# ── Entry: LLM five-layer gauntlet on emerging mover signals ──
|
|
105
|
-
- name: fox_entry
|
|
106
|
-
action_type: OPEN_POSITION
|
|
107
|
-
decision_mode: llm
|
|
108
|
-
decision_model: claude-sonnet-4-6
|
|
109
|
-
scanners: [emerging_movers]
|
|
110
|
-
min_confidence: 7
|
|
111
|
-
params:
|
|
112
|
-
order_type: FEE_OPTIMIZED_LIMIT
|
|
113
|
-
fee_optimized_limit_options:
|
|
114
|
-
ensure_execution_as_taker: true
|
|
115
|
-
execution_timeout_seconds: 15
|
|
116
|
-
context:
|
|
117
|
-
- type: signal
|
|
118
|
-
scanner: emerging_movers
|
|
119
|
-
- type: context
|
|
120
|
-
scanner: market_regime
|
|
121
|
-
decision_prompt: |
|
|
122
|
-
You are the FOX v1.6 entry filter. Evaluate emerging mover signals through
|
|
123
|
-
a strict five-layer gauntlet. Speed is edge — enter on FIRST signal or skip.
|
|
124
|
-
|
|
125
|
-
SIGNAL DATA:
|
|
126
|
-
{{emerging_movers}}
|
|
127
|
-
|
|
128
|
-
MARKET REGIME:
|
|
129
|
-
{{regime}}
|
|
130
|
-
|
|
131
|
-
═══ LAYER 1: FIRST JUMP DETECTION (mandatory) ═══
|
|
132
|
-
- Must have FIRST_JUMP reason (jumped 10+ ranks from #25+ in one scan)
|
|
133
|
-
- Previous rank must be ≥ 20 (outside top 20)
|
|
134
|
-
- rankJumpThisScan ≥ 15 OR contribVelocity > 15 (small jumps eliminated)
|
|
135
|
-
- Asset already at #1-10 for 2+ scans → SKIP (move is over)
|
|
136
|
-
|
|
137
|
-
═══ LAYER 2: SCORING (minimum 7 points, 8 for NEUTRAL regime) ═══
|
|
138
|
-
FIRST_JUMP: +3 (mandatory)
|
|
139
|
-
IMMEDIATE_MOVER: +2
|
|
140
|
-
contribVelocity > 10: +2
|
|
141
|
-
CONTRIB_EXPLOSION: +2
|
|
142
|
-
DEEP_CLIMBER: +1
|
|
143
|
-
RANK_UP: +1
|
|
144
|
-
CLIMBING: +1
|
|
145
|
-
ACCEL: +1
|
|
146
|
-
STREAK: +1
|
|
147
|
-
BTC 1h bias aligned: +1
|
|
148
|
-
UTC 04:00-13:59: +1 (time-of-day bonus)
|
|
149
|
-
UTC 18:00-02:00: -2 (evening penalty — needs score 9+ effective)
|
|
150
|
-
|
|
151
|
-
Minimum requirements: score ≥ 7, reasons ≥ 3, contribVelocity > 7 (hard gate)
|
|
152
|
-
|
|
153
|
-
═══ LAYER 3: VELOCITY & PRICE ACTION ═══
|
|
154
|
-
- Negative velocity without big jump → SKIP
|
|
155
|
-
- IMMEDIATE_MOVER/FIRST_JUMP: vel > 0 sufficient
|
|
156
|
-
- DEEP_CLIMBER: vel ≥ 0.03% (0.0003 decimal)
|
|
157
|
-
- Erratic rank history (zigzag) → SKIP unless CONTRIB_EXPLOSION
|
|
158
|
-
|
|
159
|
-
═══ LAYER 4: LEVERAGE & ASSET CHECKS ═══
|
|
160
|
-
- Max leverage for asset must be ≥ 7x — skip if capped at 3-5x
|
|
161
|
-
- XYZ equities: ignore trader count, require score ≥ 10,
|
|
162
|
-
use leverageType "ISOLATED" and dex "xyz"
|
|
163
|
-
- ≥ 10 SM traders required (crypto only, waived for XYZ)
|
|
164
|
-
|
|
165
|
-
═══ LAYER 5: MARKET REGIME ═══
|
|
166
|
-
- BEARISH (bear ≥ 60, conf ≥ 50): SHORT only
|
|
167
|
-
- BULLISH (bull ≥ 60, conf ≥ 50): LONG only
|
|
168
|
-
- NEUTRAL or stale (> 1h): both directions if score ≥ 8
|
|
169
|
-
|
|
170
|
-
═══ ROTATION (slots full + explosive FIRST_JUMP) ═══
|
|
171
|
-
- Weakest position has negative ROE → CUT and ENTER new
|
|
172
|
-
- Weakest has positive ROE or SM conviction 3+ → HOLD
|
|
173
|
-
- Never rotate positions younger than 10 minutes
|
|
174
|
-
|
|
175
|
-
═══ ANTI-PATTERNS (hard blocks) ═══
|
|
176
|
-
- Rank #1-10 for 2+ scans → move is over
|
|
177
|
-
- 4+ reasons at rank #5 → already peaked
|
|
178
|
-
- Counter to BTC hourly trend → hard block
|
|
179
|
-
- Burned/blacklisted asset → SKIP
|
|
180
|
-
|
|
181
|
-
Respond:
|
|
182
|
-
{
|
|
183
|
-
"execute": true/false,
|
|
184
|
-
"actionType": "OPEN_POSITION",
|
|
185
|
-
"confidence": 1-10,
|
|
186
|
-
"reasoning": "one sentence",
|
|
187
|
-
"payload": {
|
|
188
|
-
"signals": [
|
|
189
|
-
{
|
|
190
|
-
"asset": "<ticker>",
|
|
191
|
-
"direction": "LONG" or "SHORT",
|
|
192
|
-
"reason": "one sentence",
|
|
193
|
-
"rotate_out": "<asset_to_cut>",
|
|
194
|
-
"leverage": <number, optional — your recommended leverage>,
|
|
195
|
-
"margin": <number, optional — $ margin amount>
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
# ── SM flip: immediate close on conviction reversal ──
|
|
202
|
-
- name: sm_flip_close
|
|
203
|
-
action_type: CLOSE_POSITION
|
|
204
|
-
decision_mode: rule
|
|
205
|
-
scanners: [sm_flip]
|
|
206
|
-
min_confidence: 1
|
|
207
|
-
params:
|
|
208
|
-
order_type: FEE_OPTIMIZED_LIMIT
|
|
209
|
-
fee_optimized_limit_options:
|
|
210
|
-
ensure_execution_as_taker: true
|
|
211
|
-
execution_timeout_seconds: 10
|
|
212
|
-
|
|
213
|
-
# ── Watchdog: emergency close on margin danger ──
|
|
214
|
-
- name: watchdog_close
|
|
215
|
-
action_type: CLOSE_POSITION
|
|
216
|
-
decision_mode: rule
|
|
217
|
-
scanners: [watchdog]
|
|
218
|
-
min_confidence: 1
|
|
219
|
-
params:
|
|
220
|
-
order_type: MARKET
|
|
221
|
-
|
|
222
|
-
# ── DSL — trailing exit
|
|
223
|
-
exit:
|
|
224
|
-
engine: dsl
|
|
225
|
-
interval_seconds: 30
|
|
226
|
-
order_type: FEE_OPTIMIZED_LIMIT
|
|
227
|
-
fee_optimized_limit_options:
|
|
228
|
-
ensure_execution_as_taker: true
|
|
229
|
-
execution_timeout_seconds: 15
|
|
230
|
-
dsl_preset:
|
|
231
|
-
phase1:
|
|
232
|
-
enabled: true
|
|
233
|
-
max_loss_pct: 2.0
|
|
234
|
-
retrace_threshold: 7
|
|
235
|
-
consecutive_breaches_required: 3
|
|
236
|
-
phase2:
|
|
237
|
-
enabled: true
|
|
238
|
-
tiers:
|
|
239
|
-
- { trigger_pct: 7, lock_hw_pct: 40 }
|
|
240
|
-
- { trigger_pct: 12, lock_hw_pct: 55 }
|
|
241
|
-
- { trigger_pct: 15, lock_hw_pct: 75 }
|
|
242
|
-
- { trigger_pct: 20, lock_hw_pct: 85 }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
name: minimal
|
|
2
|
-
version: 1.0.0
|
|
3
|
-
description: Watch-only strategy — logs signals, opens no positions.
|
|
4
|
-
|
|
5
|
-
strategy:
|
|
6
|
-
wallet: "${WALLET_ADDRESS}"
|
|
7
|
-
slots: 1
|
|
8
|
-
trading_risk: conservative
|
|
9
|
-
enabled: true
|
|
10
|
-
|
|
11
|
-
scanners:
|
|
12
|
-
- name: emerging_movers
|
|
13
|
-
type: emerging_movers
|
|
14
|
-
interval: 60s
|
|
15
|
-
config:
|
|
16
|
-
topN: 20
|
|
17
|
-
minRankJump: 5
|
|
18
|
-
minScansBeforeSignals: 2
|
|
19
|
-
|
|
20
|
-
actions:
|
|
21
|
-
- name: log_signals
|
|
22
|
-
action_type: OPEN_POSITION
|
|
23
|
-
decision_mode: no_decision
|
|
24
|
-
scanners: [emerging_movers]
|
|
25
|
-
min_confidence: 0
|
|
26
|
-
|
|
27
|
-
exit:
|
|
28
|
-
engine: dsl
|
|
29
|
-
interval_seconds: 60
|
|
30
|
-
order_type: FEE_OPTIMIZED_LIMIT
|
|
31
|
-
fee_optimized_limit_options:
|
|
32
|
-
ensure_execution_as_taker: true
|
|
33
|
-
execution_timeout_seconds: 30
|
|
34
|
-
dsl_preset:
|
|
35
|
-
phase1:
|
|
36
|
-
enabled: true
|
|
37
|
-
max_loss_pct: 5.0
|
|
38
|
-
retrace_threshold: 7
|
|
39
|
-
consecutive_breaches_required: 1
|
|
40
|
-
phase2:
|
|
41
|
-
enabled: true
|
|
42
|
-
tiers:
|
|
43
|
-
- { trigger_pct: 7, lock_hw_pct: 40 }
|
|
44
|
-
- { trigger_pct: 12, lock_hw_pct: 55 }
|
|
45
|
-
- { trigger_pct: 15, lock_hw_pct: 75 }
|
|
46
|
-
- { trigger_pct: 20, lock_hw_pct: 85 }
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# `momentum-guarded` — How it works
|
|
2
|
-
|
|
3
|
-
Companion notes for [`examples/strategies/momentum-guarded.yaml`](../momentum-guarded.yaml).
|
|
4
|
-
|
|
5
|
-
## The trading thesis
|
|
6
|
-
|
|
7
|
-
Catch **short-horizon directional breakouts** on liquid Hyperliquid perps the moment a 1h candle prints an outsized move vs. the prior close — but only when the move passes both an LLM sanity check and a real-time risk gauntlet, and only with a trailing-exit playbook strict enough to survive momentum reversals.
|
|
8
|
-
|
|
9
|
-
## Signal flow (entry side)
|
|
10
|
-
|
|
11
|
-
1. **External producer** ([`src/scanners/external/momentum/producer.mjs`](../../../src/scanners/external/momentum/producer.mjs)) runs out-of-process — pulls instruments + 1h candles from Senpi MCP, computes last-vs-prev close % move, and ingests `MOMENTUM_BREAKOUT` signals via `senpi.ingestExternalScannerData`. Re-run on a cron / `watch`.
|
|
12
|
-
2. The runtime's `external_momentum` scanner of type `external_scanner` accepts the push, validates the payload schema (`sourceMeta`, `sourceFactors`, …), and emits a `scanner:run:complete` event carrying the signals.
|
|
13
|
-
3. `momentum_entry` (an `OPEN_POSITION` action with `decision_mode: llm`) consumes the signals, runs each through a 6-step gauntlet (move magnitude ≥1.5%, direction matches sign, day notional ≥1M, max leverage ≥5, producer score ≥0.4, pick highest-score), and returns at most one trade. `min_confidence: 7` blocks lukewarm LLM verdicts.
|
|
14
|
-
4. **Risk gates** fire before the position opens. With `slots: 3` and `margin_per_slot: 300` (~$900 deployed of a $5k budget), the gauntlet of guardrails is:
|
|
15
|
-
- `daily_loss_limit_pct: 4` — closes the gate if today's PnL drops 4% of day-open account value.
|
|
16
|
-
- `drawdown_halt_pct: 20` — closes the gate at 20% PnL drawdown from peak (peak carries ~24h, not reset at midnight).
|
|
17
|
-
- `max_entries_per_day: 6` — caps churn on noisy breakout days.
|
|
18
|
-
- `bypass_max_entries_per_day_on_profit` (here `false`) — when `true`, at that daily cap the max-entries gate stays OPEN if intraday `today_snapshot.pnl.delta_since_open > 0` (reuses the same PnL snapshot as daily loss in this recipe).
|
|
19
|
-
- `max_consecutive_losses: 3` + `cooldown_minutes: 90` — three losers in a row pauses entries for 90 min so the strategy doesn't tilt.
|
|
20
|
-
- `per_asset_cooldown_minutes: 45` — no re-entry on the same ticker for 45 min after a close (avoids whipsaw fills).
|
|
21
|
-
|
|
22
|
-
Order matters: **CLOSED beats COOLDOWN beats OPEN**; the first non-OPEN gate short-circuits.
|
|
23
|
-
5. If everything passes, `FEE_OPTIMIZED_LIMIT` posts the order with a 15s execution timeout (taker fallback guaranteed).
|
|
24
|
-
|
|
25
|
-
## Position management (exit side)
|
|
26
|
-
|
|
27
|
-
Once filled, the **DSL exit engine** owns the position (`position_tracker` keeps it in sync even for manually-opened positions on the same wallet):
|
|
28
|
-
|
|
29
|
-
- **Phase 1** — fixed stop at `-2.5%` plus a `7%` retrace floor; needs `3` consecutive breaches before firing (debounce against single-tick spikes).
|
|
30
|
-
- **Phase 2** — once price advances, trailing floors lock in profit on a four-tier ladder:
|
|
31
|
-
- +6% → lock 35% of high-water
|
|
32
|
-
- +10% → lock 55%
|
|
33
|
-
- +15% → lock 70%
|
|
34
|
-
- +20% → lock 85%
|
|
35
|
-
- **Time-based cuts** — momentum that fails to develop is the silent killer:
|
|
36
|
-
- `dead_weight_cut` after 30 min flat → close.
|
|
37
|
-
- `weak_peak_cut` after 45 min if peak < +2% → close.
|
|
38
|
-
- `hard_timeout` at 2 hours → close regardless.
|
|
39
|
-
|
|
40
|
-
## What this looks like in practice
|
|
41
|
-
|
|
42
|
-
- A trader runs the producer every minute via cron.
|
|
43
|
-
- 90% of producer ticks emit zero signals; the runtime stays idle.
|
|
44
|
-
- When BTC prints a +2% 1h candle on healthy volume, the LLM accepts, the risk gauntlet checks daily PnL/drawdown/entries/cooldowns, and one slot fires a long.
|
|
45
|
-
- DSL trails the move. If BTC stalls, time-cuts close it within ~30–45 min instead of bleeding margin. If BTC runs to +12%, the +10% tier locks in 55% of the high-water, so a retrace to +5% still books profit.
|
|
46
|
-
- A bad day (3 stop-outs) trips the consecutive-loss cooldown — the runtime stops trying for 90 min and resumes fresh.
|
|
47
|
-
|
|
48
|
-
Net effect: **a small, slot-bounded, risk-gated breakout sniper** with strict trailing protection — appropriate for a $5k moderate-risk wallet that wants asymmetric upside without unsupervised drawdown.
|