@senpi-ai/runtime 1.0.96 → 1.0.98
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 +113 -2
- package/dist/actions/action-runtime-module.d.ts +55 -0
- package/dist/actions/action-runtime-module.d.ts.map +1 -0
- package/dist/actions/action-runtime-module.js +491 -0
- package/dist/actions/action-runtime-module.js.map +1 -0
- package/dist/actions/close-position/close-position.action.d.ts +1 -0
- package/dist/actions/close-position/close-position.action.d.ts.map +1 -1
- package/dist/actions/close-position/close-position.action.js +93 -25
- 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 +5 -0
- package/dist/actions/decision-engine.js.map +1 -1
- package/dist/actions/decision-meta.d.ts +9 -0
- package/dist/actions/decision-meta.d.ts.map +1 -0
- package/dist/actions/decision-meta.js +18 -0
- package/dist/actions/decision-meta.js.map +1 -0
- package/dist/actions/llm-decision/openclaw-llm-decision.d.ts.map +1 -1
- package/dist/actions/llm-decision/openclaw-llm-decision.js +6 -0
- package/dist/actions/llm-decision/openclaw-llm-decision.js.map +1 -1
- package/dist/actions/llm-decision/shared.d.ts +1 -1
- package/dist/actions/llm-decision/shared.d.ts.map +1 -1
- package/dist/actions/llm-decision/shared.js +1 -1
- package/dist/actions/llm-decision/shared.js.map +1 -1
- package/dist/actions/notifications/formatter.d.ts +39 -0
- package/dist/actions/notifications/formatter.d.ts.map +1 -0
- package/dist/actions/notifications/formatter.js +68 -0
- package/dist/actions/notifications/formatter.js.map +1 -0
- package/dist/actions/notifications/index.d.ts +37 -0
- package/dist/actions/notifications/index.d.ts.map +1 -0
- package/dist/actions/notifications/index.js +89 -0
- package/dist/actions/notifications/index.js.map +1 -0
- package/dist/actions/open-position/open-position.action.d.ts +1 -0
- package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
- package/dist/actions/open-position/open-position.action.js +197 -34
- package/dist/actions/open-position/open-position.action.js.map +1 -1
- package/dist/actions/open-position/resolve-margin.d.ts +30 -0
- package/dist/actions/open-position/resolve-margin.d.ts.map +1 -0
- package/dist/actions/open-position/resolve-margin.js +41 -0
- package/dist/actions/open-position/resolve-margin.js.map +1 -0
- package/dist/actions/position-tracker/position-tracker.action.d.ts.map +1 -1
- package/dist/actions/position-tracker/position-tracker.action.js +4 -1
- package/dist/actions/position-tracker/position-tracker.action.js.map +1 -1
- package/dist/actions/store/action-store.d.ts +45 -0
- package/dist/actions/store/action-store.d.ts.map +1 -0
- package/dist/actions/store/action-store.js +127 -0
- package/dist/actions/store/action-store.js.map +1 -0
- package/dist/actions/store/index.d.ts +11 -0
- package/dist/actions/store/index.d.ts.map +1 -0
- package/dist/actions/store/index.js +9 -0
- package/dist/actions/store/index.js.map +1 -0
- package/dist/actions/store/paths.d.ts +15 -0
- package/dist/actions/store/paths.d.ts.map +1 -0
- package/dist/actions/store/paths.js +29 -0
- package/dist/actions/store/paths.js.map +1 -0
- package/dist/actions/store/types.d.ts +126 -0
- package/dist/actions/store/types.d.ts.map +1 -0
- package/dist/actions/store/types.js +48 -0
- package/dist/actions/store/types.js.map +1 -0
- package/dist/actions/tracking-helpers.d.ts +13 -0
- package/dist/actions/tracking-helpers.d.ts.map +1 -0
- package/dist/actions/tracking-helpers.js +47 -0
- package/dist/actions/tracking-helpers.js.map +1 -0
- package/dist/actions/types.d.ts +8 -0
- package/dist/actions/types.d.ts.map +1 -1
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +106 -4
- 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 +447 -1
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/constants/dsl/index.d.ts +12 -0
- package/dist/constants/dsl/index.d.ts.map +1 -1
- package/dist/constants/dsl/index.js +12 -0
- package/dist/constants/dsl/index.js.map +1 -1
- package/dist/constants/order-types.d.ts +7 -0
- package/dist/constants/order-types.d.ts.map +1 -0
- package/dist/constants/order-types.js +6 -0
- package/dist/constants/order-types.js.map +1 -0
- package/dist/context/interpolate.d.ts +6 -2
- package/dist/context/interpolate.d.ts.map +1 -1
- package/dist/context/interpolate.js +6 -2
- package/dist/context/interpolate.js.map +1 -1
- package/dist/context/types.d.ts +8 -1
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/types.js +8 -1
- package/dist/context/types.js.map +1 -1
- package/dist/dsl/config/exit-block.d.ts +7 -0
- package/dist/dsl/config/exit-block.d.ts.map +1 -1
- package/dist/dsl/config/parse-plugin-config.d.ts.map +1 -1
- package/dist/dsl/config/parse-plugin-config.js +27 -1
- package/dist/dsl/config/parse-plugin-config.js.map +1 -1
- package/dist/dsl/config/unknown-keys.d.ts.map +1 -1
- package/dist/dsl/config/unknown-keys.js +3 -1
- package/dist/dsl/config/unknown-keys.js.map +1 -1
- package/dist/dsl/engine-client/event-mapping.d.ts +21 -1
- package/dist/dsl/engine-client/event-mapping.d.ts.map +1 -1
- package/dist/dsl/engine-client/event-mapping.js +10 -0
- package/dist/dsl/engine-client/event-mapping.js.map +1 -1
- package/dist/dsl/engine-client/index.d.ts +1 -1
- package/dist/dsl/engine-client/index.d.ts.map +1 -1
- package/dist/dsl/events/build-closed-event.d.ts +15 -0
- package/dist/dsl/events/build-closed-event.d.ts.map +1 -0
- package/dist/dsl/events/build-closed-event.js +31 -0
- package/dist/dsl/events/build-closed-event.js.map +1 -0
- package/dist/dsl/events/handlers.d.ts +2 -1
- package/dist/dsl/events/handlers.d.ts.map +1 -1
- package/dist/dsl/events/handlers.js +15 -10
- package/dist/dsl/events/handlers.js.map +1 -1
- package/dist/dsl/events/initial-state.d.ts +2 -2
- package/dist/dsl/events/initial-state.d.ts.map +1 -1
- package/dist/dsl/events/initial-state.js +4 -1
- package/dist/dsl/events/initial-state.js.map +1 -1
- package/dist/dsl/index.js +1 -1
- package/dist/dsl/index.js.map +1 -1
- package/dist/dsl/monitor/create-monitor.d.ts +4 -0
- package/dist/dsl/monitor/create-monitor.d.ts.map +1 -1
- package/dist/dsl/monitor/create-monitor.js +8 -5
- package/dist/dsl/monitor/create-monitor.js.map +1 -1
- package/dist/dsl/monitor/process-one-position.d.ts +4 -0
- package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
- package/dist/dsl/monitor/process-one-position.js +129 -40
- package/dist/dsl/monitor/process-one-position.js.map +1 -1
- package/dist/dsl/notifications/close-resolver.d.ts +92 -0
- package/dist/dsl/notifications/close-resolver.d.ts.map +1 -0
- package/dist/dsl/notifications/close-resolver.js +309 -0
- package/dist/dsl/notifications/close-resolver.js.map +1 -0
- package/dist/dsl/notifications/format-utils.d.ts +24 -0
- package/dist/dsl/notifications/format-utils.d.ts.map +1 -0
- package/dist/dsl/notifications/format-utils.js +102 -0
- package/dist/dsl/notifications/format-utils.js.map +1 -0
- package/dist/dsl/notifications/formatter.d.ts +23 -4
- package/dist/dsl/notifications/formatter.d.ts.map +1 -1
- package/dist/dsl/notifications/formatter.js +109 -34
- package/dist/dsl/notifications/formatter.js.map +1 -1
- package/dist/dsl/notifications/index.d.ts +7 -0
- package/dist/dsl/notifications/index.d.ts.map +1 -1
- package/dist/dsl/notifications/index.js +22 -10
- package/dist/dsl/notifications/index.js.map +1 -1
- package/dist/dsl/notifications/types.d.ts +27 -0
- package/dist/dsl/notifications/types.d.ts.map +1 -0
- package/dist/dsl/notifications/types.js +5 -0
- package/dist/dsl/notifications/types.js.map +1 -0
- package/dist/dsl/plugin/index.d.ts +1 -1
- package/dist/dsl/plugin/index.d.ts.map +1 -1
- package/dist/dsl/plugin/index.js +29 -1
- package/dist/dsl/plugin/index.js.map +1 -1
- package/dist/health/index.d.ts +5 -2
- package/dist/health/index.d.ts.map +1 -1
- package/dist/health/index.js +106 -6
- package/dist/health/index.js.map +1 -1
- package/dist/health/types.d.ts +102 -0
- package/dist/health/types.d.ts.map +1 -1
- package/dist/health/types.js +7 -1
- package/dist/health/types.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +459 -8
- package/dist/index.js.map +1 -1
- package/dist/risk/guardrail.types.d.ts +58 -0
- package/dist/risk/guardrail.types.d.ts.map +1 -0
- package/dist/risk/guardrail.types.js +5 -0
- package/dist/risk/guardrail.types.js.map +1 -0
- package/dist/risk/index.d.ts +2 -4
- package/dist/risk/index.d.ts.map +1 -1
- package/dist/risk/index.js +2 -6
- package/dist/risk/index.js.map +1 -1
- package/dist/risk/risk-audit-log.d.ts +25 -0
- package/dist/risk/risk-audit-log.d.ts.map +1 -0
- package/dist/risk/risk-audit-log.js +30 -0
- package/dist/risk/risk-audit-log.js.map +1 -0
- package/dist/runtime/__tests__/helpers/runtime-gateway-harness.d.ts +162 -0
- package/dist/runtime/__tests__/helpers/runtime-gateway-harness.d.ts.map +1 -0
- package/dist/runtime/__tests__/helpers/runtime-gateway-harness.js +285 -0
- package/dist/runtime/__tests__/helpers/runtime-gateway-harness.js.map +1 -0
- package/dist/runtime/audit-query.types.d.ts +113 -0
- package/dist/runtime/audit-query.types.d.ts.map +1 -0
- package/dist/runtime/audit-query.types.js +35 -0
- package/dist/runtime/audit-query.types.js.map +1 -0
- package/dist/runtime/auto-update/coordinator.d.ts +12 -8
- package/dist/runtime/auto-update/coordinator.d.ts.map +1 -1
- package/dist/runtime/auto-update/coordinator.js +18 -17
- package/dist/runtime/auto-update/coordinator.js.map +1 -1
- package/dist/runtime/auto-update/gateway-restart.d.ts +9 -2
- package/dist/runtime/auto-update/gateway-restart.d.ts.map +1 -1
- package/dist/runtime/auto-update/gateway-restart.js +23 -13
- package/dist/runtime/auto-update/gateway-restart.js.map +1 -1
- package/dist/runtime/create-actions.d.ts +6 -2
- package/dist/runtime/create-actions.d.ts.map +1 -1
- package/dist/runtime/create-actions.js +30 -8
- package/dist/runtime/create-actions.js.map +1 -1
- package/dist/runtime/create-scanner-module.d.ts +5 -0
- package/dist/runtime/create-scanner-module.d.ts.map +1 -1
- package/dist/runtime/create-scanner-module.js +12 -1
- package/dist/runtime/create-scanner-module.js.map +1 -1
- package/dist/runtime/load-runtime-config.d.ts +1 -1
- package/dist/runtime/load-runtime-config.d.ts.map +1 -1
- package/dist/runtime/load-runtime-config.js +37 -1
- package/dist/runtime/load-runtime-config.js.map +1 -1
- package/dist/runtime/map-exit-config.d.ts +2 -1
- package/dist/runtime/map-exit-config.d.ts.map +1 -1
- package/dist/runtime/map-exit-config.js +11 -1
- package/dist/runtime/map-exit-config.js.map +1 -1
- package/dist/runtime/map-strategies.d.ts +1 -1
- package/dist/runtime/map-strategies.d.ts.map +1 -1
- package/dist/runtime/map-strategies.js +38 -1
- package/dist/runtime/map-strategies.js.map +1 -1
- package/dist/runtime/notifications.d.ts.map +1 -1
- package/dist/runtime/notifications.js +53 -7
- package/dist/runtime/notifications.js.map +1 -1
- package/dist/runtime/risk-guard.d.ts +26 -2
- package/dist/runtime/risk-guard.d.ts.map +1 -1
- package/dist/runtime/risk-guard.js +539 -5
- package/dist/runtime/risk-guard.js.map +1 -1
- package/dist/runtime/run.d.ts +96 -2
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +21 -0
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/runtime-schema.d.ts +1169 -24
- package/dist/runtime/runtime-schema.d.ts.map +1 -1
- package/dist/runtime/runtime-schema.js +105 -2
- package/dist/runtime/runtime-schema.js.map +1 -1
- package/dist/runtime/runtime.d.ts +85 -2
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +374 -10
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/scanner-composition.d.ts +10 -0
- package/dist/runtime/scanner-composition.d.ts.map +1 -1
- package/dist/runtime/scanner-composition.js +10 -0
- package/dist/runtime/scanner-composition.js.map +1 -1
- package/dist/runtime/scanner-registry.d.ts +39 -1
- package/dist/runtime/scanner-registry.d.ts.map +1 -1
- package/dist/runtime/scanner-registry.js +105 -2
- package/dist/runtime/scanner-registry.js.map +1 -1
- package/dist/runtime/state-layout.d.ts +2 -0
- package/dist/runtime/state-layout.d.ts.map +1 -1
- package/dist/runtime/state-layout.js +1 -0
- package/dist/runtime/state-layout.js.map +1 -1
- package/dist/runtime/validate-action-prompts.d.ts +30 -0
- package/dist/runtime/validate-action-prompts.d.ts.map +1 -0
- package/dist/runtime/validate-action-prompts.js +110 -0
- package/dist/runtime/validate-action-prompts.js.map +1 -0
- package/dist/runtime-api/config.d.ts +47 -0
- package/dist/runtime-api/config.d.ts.map +1 -0
- package/dist/runtime-api/config.js +74 -0
- package/dist/runtime-api/config.js.map +1 -0
- package/dist/runtime-api/handlers/audit.d.ts +78 -0
- package/dist/runtime-api/handlers/audit.d.ts.map +1 -0
- package/dist/runtime-api/handlers/audit.js +65 -0
- package/dist/runtime-api/handlers/audit.js.map +1 -0
- package/dist/runtime-api/handlers/group-by-scanner.d.ts +43 -0
- package/dist/runtime-api/handlers/group-by-scanner.d.ts.map +1 -0
- package/dist/runtime-api/handlers/group-by-scanner.js +43 -0
- package/dist/runtime-api/handlers/group-by-scanner.js.map +1 -0
- package/dist/runtime-api/handlers/ingest-signals.d.ts +54 -0
- package/dist/runtime-api/handlers/ingest-signals.d.ts.map +1 -0
- package/dist/runtime-api/handlers/ingest-signals.js +124 -0
- package/dist/runtime-api/handlers/ingest-signals.js.map +1 -0
- package/dist/runtime-api/handlers/runtime-lookup.d.ts +36 -0
- package/dist/runtime-api/handlers/runtime-lookup.d.ts.map +1 -0
- package/dist/runtime-api/handlers/runtime-lookup.js +31 -0
- package/dist/runtime-api/handlers/runtime-lookup.js.map +1 -0
- package/dist/runtime-api/handlers/types.d.ts +85 -0
- package/dist/runtime-api/handlers/types.d.ts.map +1 -0
- package/dist/runtime-api/handlers/types.js +8 -0
- package/dist/runtime-api/handlers/types.js.map +1 -0
- package/dist/runtime-api/lifecycle.d.ts +98 -0
- package/dist/runtime-api/lifecycle.d.ts.map +1 -0
- package/dist/runtime-api/lifecycle.js +137 -0
- package/dist/runtime-api/lifecycle.js.map +1 -0
- package/dist/runtime-api/readiness.d.ts +37 -0
- package/dist/runtime-api/readiness.d.ts.map +1 -0
- package/dist/runtime-api/readiness.js +35 -0
- package/dist/runtime-api/readiness.js.map +1 -0
- package/dist/runtime-api/routes/audit.d.ts +40 -0
- package/dist/runtime-api/routes/audit.d.ts.map +1 -0
- package/dist/runtime-api/routes/audit.js +90 -0
- package/dist/runtime-api/routes/audit.js.map +1 -0
- package/dist/runtime-api/routes/audit.schema.d.ts +75 -0
- package/dist/runtime-api/routes/audit.schema.d.ts.map +1 -0
- package/dist/runtime-api/routes/audit.schema.js +78 -0
- package/dist/runtime-api/routes/audit.schema.js.map +1 -0
- package/dist/runtime-api/routes/health.d.ts +53 -0
- package/dist/runtime-api/routes/health.d.ts.map +1 -0
- package/dist/runtime-api/routes/health.js +48 -0
- package/dist/runtime-api/routes/health.js.map +1 -0
- package/dist/runtime-api/routes/signals.d.ts +50 -0
- package/dist/runtime-api/routes/signals.d.ts.map +1 -0
- package/dist/runtime-api/routes/signals.js +90 -0
- package/dist/runtime-api/routes/signals.js.map +1 -0
- package/dist/runtime-api/routes/signals.schema.d.ts +94 -0
- package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -0
- package/dist/runtime-api/routes/signals.schema.js +58 -0
- package/dist/runtime-api/routes/signals.schema.js.map +1 -0
- package/dist/runtime-api/routes/state.d.ts +51 -0
- package/dist/runtime-api/routes/state.d.ts.map +1 -0
- package/dist/runtime-api/routes/state.js +94 -0
- package/dist/runtime-api/routes/state.js.map +1 -0
- package/dist/runtime-api/server.d.ts +79 -0
- package/dist/runtime-api/server.d.ts.map +1 -0
- package/dist/runtime-api/server.js +114 -0
- package/dist/runtime-api/server.js.map +1 -0
- package/dist/scanners/__tests__/test-helpers.d.ts +10 -0
- package/dist/scanners/__tests__/test-helpers.d.ts.map +1 -1
- package/dist/scanners/__tests__/test-helpers.js +52 -0
- package/dist/scanners/__tests__/test-helpers.js.map +1 -1
- package/dist/scanners/engine/engine.d.ts +37 -0
- package/dist/scanners/engine/engine.d.ts.map +1 -1
- package/dist/scanners/engine/engine.js +132 -14
- package/dist/scanners/engine/engine.js.map +1 -1
- package/dist/scanners/engine/result-builder.d.ts +16 -0
- package/dist/scanners/engine/result-builder.d.ts.map +1 -1
- package/dist/scanners/engine/result-builder.js +22 -0
- package/dist/scanners/engine/result-builder.js.map +1 -1
- package/dist/scanners/engine/strategy-registry.d.ts +2 -0
- package/dist/scanners/engine/strategy-registry.d.ts.map +1 -1
- package/dist/scanners/engine/strategy-registry.js +5 -1
- package/dist/scanners/engine/strategy-registry.js.map +1 -1
- package/dist/scanners/external/liquidation-watchdog/README.md +107 -0
- package/dist/scanners/external/liquidation-watchdog/liquidation-watchdog.yaml +48 -0
- package/dist/scanners/external/liquidation-watchdog/producer.mjs +336 -0
- package/dist/scanners/external/momentum/README.md +148 -0
- package/dist/scanners/external/momentum/momentum.yaml +116 -0
- package/dist/scanners/external/momentum/producer.mjs +251 -0
- package/dist/scanners/external/shared/ingest.mjs +112 -0
- package/dist/scanners/external-scanner-receiver.d.ts +118 -0
- package/dist/scanners/external-scanner-receiver.d.ts.map +1 -0
- package/dist/scanners/external-scanner-receiver.js +266 -0
- package/dist/scanners/external-scanner-receiver.js.map +1 -0
- package/dist/scanners/implementations/external-scanner.d.ts +17 -0
- package/dist/scanners/implementations/external-scanner.d.ts.map +1 -0
- package/dist/scanners/implementations/external-scanner.js +51 -0
- package/dist/scanners/implementations/external-scanner.js.map +1 -0
- package/dist/scanners/implementations/index.d.ts +1 -0
- package/dist/scanners/implementations/index.d.ts.map +1 -1
- package/dist/scanners/implementations/index.js +1 -0
- package/dist/scanners/implementations/index.js.map +1 -1
- package/dist/scanners/implementations/position-tracker.d.ts.map +1 -1
- package/dist/scanners/implementations/position-tracker.js +3 -1
- package/dist/scanners/implementations/position-tracker.js.map +1 -1
- package/dist/scanners/index.d.ts +4 -1
- package/dist/scanners/index.d.ts.map +1 -1
- package/dist/scanners/index.js +2 -0
- package/dist/scanners/index.js.map +1 -1
- package/dist/scanners/protocol/scanner.d.ts +3 -1
- package/dist/scanners/protocol/scanner.d.ts.map +1 -1
- package/dist/scanners/providers/client.d.ts.map +1 -1
- package/dist/scanners/providers/client.js +0 -8
- package/dist/scanners/providers/client.js.map +1 -1
- package/dist/scanners/runtime-module.d.ts +10 -0
- package/dist/scanners/runtime-module.d.ts.map +1 -1
- package/dist/scanners/runtime-module.js +19 -3
- package/dist/scanners/runtime-module.js.map +1 -1
- package/dist/scanners/scanner-definition.d.ts +12 -1
- package/dist/scanners/scanner-definition.d.ts.map +1 -1
- package/dist/scanners/schema-utils.d.ts +22 -2
- package/dist/scanners/schema-utils.d.ts.map +1 -1
- package/dist/scanners/schema-utils.js +14 -2
- package/dist/scanners/schema-utils.js.map +1 -1
- package/dist/scanners/types.d.ts +3 -0
- package/dist/scanners/types.d.ts.map +1 -1
- package/dist/scanners/types.js.map +1 -1
- package/dist/scripts/run-dsl-standalone-live.js +2 -2
- package/dist/scripts/run-dsl-standalone-live.js.map +1 -1
- package/dist/scripts/run-dsl-standalone-mock.js +2 -2
- package/dist/scripts/run-dsl-standalone-mock.js.map +1 -1
- package/dist/senpi/client.d.ts +123 -4
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +304 -15
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/index.d.ts +1 -1
- package/dist/senpi/index.d.ts.map +1 -1
- package/dist/senpi/types.d.ts +70 -0
- package/dist/senpi/types.d.ts.map +1 -1
- package/dist/state/state-manager.d.ts +3 -0
- package/dist/state/state-manager.d.ts.map +1 -1
- package/dist/state/state-manager.js +9 -0
- package/dist/state/state-manager.js.map +1 -1
- package/dist/strategy/strategy-state.d.ts +4 -1
- package/dist/strategy/strategy-state.d.ts.map +1 -1
- package/dist/strategy/strategy-state.js +7 -2
- package/dist/strategy/strategy-state.js.map +1 -1
- package/dist/tracking/constants.d.ts +24 -0
- package/dist/tracking/constants.d.ts.map +1 -0
- package/dist/tracking/constants.js +50 -0
- package/dist/tracking/constants.js.map +1 -0
- package/dist/tracking/index.d.ts +13 -0
- package/dist/tracking/index.d.ts.map +1 -0
- package/dist/tracking/index.js +9 -0
- package/dist/tracking/index.js.map +1 -0
- package/dist/tracking/plugin-event-tracker.d.ts +13 -0
- package/dist/tracking/plugin-event-tracker.d.ts.map +1 -0
- package/dist/tracking/plugin-event-tracker.js +27 -0
- package/dist/tracking/plugin-event-tracker.js.map +1 -0
- package/dist/tracking/tracker.d.ts +30 -0
- package/dist/tracking/tracker.d.ts.map +1 -0
- package/dist/tracking/tracker.js +66 -0
- package/dist/tracking/tracker.js.map +1 -0
- package/dist/tracking/tracking-handler.d.ts +12 -0
- package/dist/tracking/tracking-handler.d.ts.map +1 -0
- package/dist/tracking/tracking-handler.js +148 -0
- package/dist/tracking/tracking-handler.js.map +1 -0
- package/dist/tracking/transport.d.ts +35 -0
- package/dist/tracking/transport.d.ts.map +1 -0
- package/dist/tracking/transport.js +133 -0
- package/dist/tracking/transport.js.map +1 -0
- package/dist/tracking/types.d.ts +21 -0
- package/dist/tracking/types.d.ts.map +1 -0
- package/dist/tracking/types.js +6 -0
- package/dist/tracking/types.js.map +1 -0
- package/dist/types/action.d.ts +13 -2
- package/dist/types/action.d.ts.map +1 -1
- package/dist/types/dsl/index.d.ts +72 -3
- package/dist/types/dsl/index.d.ts.map +1 -1
- package/dist/types/strategy.d.ts +11 -3
- package/dist/types/strategy.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +6 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +35 -2
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/resolve-order-type.d.ts +5 -0
- package/dist/utils/resolve-order-type.d.ts.map +1 -0
- package/dist/utils/resolve-order-type.js +29 -0
- package/dist/utils/resolve-order-type.js.map +1 -0
- package/examples/strategies/dsl-showcase.yaml +7 -2
- package/examples/strategies/dsl.yaml +5 -1
- package/examples/strategies/fox-minimal-loosened.yaml +18 -3
- package/examples/strategies/fox-minimal.yaml +25 -3
- package/examples/strategies/minimal.yaml +4 -2
- package/examples/strategies/momentum/how-it-works.md +48 -0
- package/examples/strategies/momentum/momentum-guarded.yaml +161 -0
- package/examples/strategies/risk-showcase.yaml +93 -0
- package/examples/strategies/viper.yaml +11 -3
- package/examples/strategies/wolf.yaml +11 -3
- package/examples/yamls/sample-with-dsl-and-emerging-movers.yaml +12 -4
- package/openclaw.plugin.json +35 -1
- package/package.json +12 -7
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
name: momentum-guarded
|
|
2
|
+
version: 1.0.0
|
|
3
|
+
description: >
|
|
4
|
+
Risk-managed external momentum strategy. An out-of-process producer
|
|
5
|
+
(src/scanners/external/momentum/producer.mjs) pushes MOMENTUM_BREAKOUT
|
|
6
|
+
signals into the runtime; an LLM gauntlet decides which breakouts deserve
|
|
7
|
+
capital; the risk component gates every entry against daily loss, drawdown,
|
|
8
|
+
per-day entry count, consecutive-loss cooldown, and per-asset cooldown;
|
|
9
|
+
the DSL exit engine manages trailing exits on accepted fills.
|
|
10
|
+
|
|
11
|
+
notifications:
|
|
12
|
+
telegram_chat_id: "${TELEGRAM_CHAT_ID}"
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
wallet: "${WALLET_ADDRESS}"
|
|
16
|
+
slots: 3
|
|
17
|
+
margin_per_slot: 300
|
|
18
|
+
trading_risk: moderate
|
|
19
|
+
enabled: true
|
|
20
|
+
|
|
21
|
+
# ── RISK ──
|
|
22
|
+
# Real-time gates enforced on every OPEN_POSITION attempt. Any non-OPEN gate
|
|
23
|
+
# short-circuits and skips the entry. See docs/risk-component.md.
|
|
24
|
+
risk:
|
|
25
|
+
data_retention_hours: 72
|
|
26
|
+
|
|
27
|
+
guard_rails:
|
|
28
|
+
# Daily loss halt — stop trading if daily PnL drops > 4% of day-open account value.
|
|
29
|
+
daily_loss_limit_pct: 4
|
|
30
|
+
|
|
31
|
+
# Cap entries per UTC day so a noisy producer day can't churn the wallet.
|
|
32
|
+
max_entries_per_day: 6
|
|
33
|
+
# At cap: if true, gate stays OPEN when today_snapshot.pnl.delta_since_open > 0 (see docs/risk-component.md).
|
|
34
|
+
bypass_max_entries_per_day_on_profit: false
|
|
35
|
+
|
|
36
|
+
# Consecutive-loss cooldown — three losers in a row pauses entries for 90 min.
|
|
37
|
+
max_consecutive_losses: 3
|
|
38
|
+
cooldown_minutes: 90
|
|
39
|
+
|
|
40
|
+
# Drawdown halt — 20% PnL drawdown from peak halts entries; peak carries ~24h.
|
|
41
|
+
drawdown_halt_pct: 20
|
|
42
|
+
drawdown_reset_on_day_rollover: false
|
|
43
|
+
|
|
44
|
+
# Per-asset cooldown — no re-entry on the same asset for 45 min after a close.
|
|
45
|
+
per_asset_cooldown_minutes: 45
|
|
46
|
+
|
|
47
|
+
# ── SCANNERS ──
|
|
48
|
+
scanners:
|
|
49
|
+
# Onchain position tracker — emits position lifecycle events into the DSL exit engine.
|
|
50
|
+
- name: position_tracker
|
|
51
|
+
type: position_tracker
|
|
52
|
+
interval: 10s
|
|
53
|
+
|
|
54
|
+
# External producer feed — schema for inbound MOMENTUM_BREAKOUT signals
|
|
55
|
+
# delivered via senpi.ingestExternalScannerData.
|
|
56
|
+
- name: external_momentum
|
|
57
|
+
type: external_scanner
|
|
58
|
+
outputs:
|
|
59
|
+
signals: true
|
|
60
|
+
context: false
|
|
61
|
+
config:
|
|
62
|
+
fields:
|
|
63
|
+
sourceScannerId: { type: string, required: true }
|
|
64
|
+
sourceSignalType: { type: string, required: true }
|
|
65
|
+
sourceTimestamp: { type: number, required: true }
|
|
66
|
+
sourceFactors: { type: object, required: true }
|
|
67
|
+
sourceMeta: { type: object, required: true }
|
|
68
|
+
|
|
69
|
+
# ── ACTIONS ──
|
|
70
|
+
actions:
|
|
71
|
+
# Position lifecycle tracking — feeds the DSL exit engine.
|
|
72
|
+
- name: position_tracker_action
|
|
73
|
+
action_type: POSITION_TRACKER
|
|
74
|
+
decision_mode: rule
|
|
75
|
+
scanners: [position_tracker]
|
|
76
|
+
|
|
77
|
+
# Entry: LLM gauntlet on momentum breakout signals.
|
|
78
|
+
- name: momentum_entry
|
|
79
|
+
action_type: OPEN_POSITION
|
|
80
|
+
decision_mode: llm
|
|
81
|
+
decision_model: claude-sonnet-4-20250514
|
|
82
|
+
scanners: [external_momentum]
|
|
83
|
+
min_confidence: 7
|
|
84
|
+
params:
|
|
85
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
86
|
+
fee_optimized_limit_options:
|
|
87
|
+
ensure_execution_as_taker: true
|
|
88
|
+
execution_timeout_seconds: 15
|
|
89
|
+
context:
|
|
90
|
+
- type: signal
|
|
91
|
+
scanner: external_momentum
|
|
92
|
+
decision_prompt: |
|
|
93
|
+
You are a trade-decisioning evaluator. Given a MOMENTUM_BREAKOUT
|
|
94
|
+
signal pushed by the external momentum producer, decide whether to
|
|
95
|
+
open a position on it or skip.
|
|
96
|
+
|
|
97
|
+
A MOMENTUM_BREAKOUT fires when an asset's latest closed candle moves
|
|
98
|
+
by at least the producer's threshold vs. the previous close on the
|
|
99
|
+
signal's timeframe — i.e. a short-term directional breakout in price.
|
|
100
|
+
`meta.movePct` carries the signed % change (positive = LONG bias,
|
|
101
|
+
negative = SHORT bias); `score` (0..1) scales with the move's
|
|
102
|
+
magnitude; `meta.dayNtlVlm` and `meta.maxLeverage` describe the
|
|
103
|
+
instrument's liquidity and leverage headroom.
|
|
104
|
+
|
|
105
|
+
SIGNAL DATA:
|
|
106
|
+
{{signal_external_momentum}}
|
|
107
|
+
|
|
108
|
+
═══ GAUNTLET ═══
|
|
109
|
+
1. movePct magnitude — require |movePct| >= 1.5; reject sub-threshold noise.
|
|
110
|
+
2. Direction sanity — LONG only if movePct > 0, SHORT only if movePct < 0.
|
|
111
|
+
3. Liquidity — meta.dayNtlVlm must be >= 1_000_000.
|
|
112
|
+
4. Leverage — meta.maxLeverage must be >= 5; skip otherwise.
|
|
113
|
+
5. Score — use the producer score (0..1) as a proxy for strength; require >= 0.4.
|
|
114
|
+
6. One signal at a time — pick the highest-score eligible signal; skip the rest.
|
|
115
|
+
|
|
116
|
+
Respond with a single JSON object:
|
|
117
|
+
{
|
|
118
|
+
"execute": true|false,
|
|
119
|
+
"actionType": "OPEN_POSITION",
|
|
120
|
+
"confidence": 1-10,
|
|
121
|
+
"reasoning": "one sentence",
|
|
122
|
+
"payload": {
|
|
123
|
+
"signals": [
|
|
124
|
+
{ "asset": "<ticker>", "direction": "LONG"|"SHORT", "reason": "one sentence" }
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
# ── EXIT (DSL) ──
|
|
130
|
+
# Trailing stop-loss tuned for short-horizon momentum entries.
|
|
131
|
+
# Time-based cuts catch stalled trades that never deliver follow-through.
|
|
132
|
+
exit:
|
|
133
|
+
engine: dsl
|
|
134
|
+
interval_seconds: 30
|
|
135
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
136
|
+
fee_optimized_limit_options:
|
|
137
|
+
ensure_execution_as_taker: true
|
|
138
|
+
execution_timeout_seconds: 15
|
|
139
|
+
dsl_preset:
|
|
140
|
+
hard_timeout:
|
|
141
|
+
enabled: true
|
|
142
|
+
interval_in_minutes: 120
|
|
143
|
+
weak_peak_cut:
|
|
144
|
+
enabled: true
|
|
145
|
+
interval_in_minutes: 45
|
|
146
|
+
min_value: 2
|
|
147
|
+
dead_weight_cut:
|
|
148
|
+
enabled: true
|
|
149
|
+
interval_in_minutes: 30
|
|
150
|
+
phase1:
|
|
151
|
+
enabled: true
|
|
152
|
+
max_loss_pct: 2.5
|
|
153
|
+
retrace_threshold: 7
|
|
154
|
+
consecutive_breaches_required: 3
|
|
155
|
+
phase2:
|
|
156
|
+
enabled: true
|
|
157
|
+
tiers:
|
|
158
|
+
- { trigger_pct: 6, lock_hw_pct: 35 }
|
|
159
|
+
- { trigger_pct: 10, lock_hw_pct: 55 }
|
|
160
|
+
- { trigger_pct: 15, lock_hw_pct: 70 }
|
|
161
|
+
- { trigger_pct: 20, lock_hw_pct: 85 }
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Risk showcase — every risk guardrail field annotated for reference.
|
|
2
|
+
# Use as a copy-paste reference when configuring risk management.
|
|
3
|
+
name: risk-showcase
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: >
|
|
6
|
+
Annotated risk guardrails config reference.
|
|
7
|
+
Uses position_tracker scanner with DSL exit engine.
|
|
8
|
+
Lists explicit example values for each field (not implicit runtime defaults).
|
|
9
|
+
|
|
10
|
+
notifications:
|
|
11
|
+
telegram_chat_id: "${TELEGRAM_CHAT_ID}"
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
wallet: "${WALLET_ADDRESS}"
|
|
15
|
+
budget: 10000
|
|
16
|
+
slots: 3
|
|
17
|
+
margin_per_slot: 250
|
|
18
|
+
trading_risk: moderate
|
|
19
|
+
enabled: true
|
|
20
|
+
|
|
21
|
+
# ── RISK ──
|
|
22
|
+
# Optional. Without this block, all gates are OPEN (no risk management).
|
|
23
|
+
risk:
|
|
24
|
+
# How long to keep audit log files (JSONL + daily snapshots), in hours.
|
|
25
|
+
# Range: 1–168 (1 hour to 7 days). Default: 48.
|
|
26
|
+
data_retention_hours: 48
|
|
27
|
+
|
|
28
|
+
guard_rails:
|
|
29
|
+
# ── Daily Loss Halt ──
|
|
30
|
+
# Gate CLOSED when daily trading PnL drop exceeds this % of account value at day open.
|
|
31
|
+
# Uses Hyperliquid portfolio PnL (realized + unrealized + funding, excludes deposits/withdrawals).
|
|
32
|
+
# Resets at UTC midnight.
|
|
33
|
+
daily_loss_limit_pct: 5 # 5% of account value at day open
|
|
34
|
+
|
|
35
|
+
# ── Max Entries Per Day ──
|
|
36
|
+
# Gate CLOSED when position entries today >= max_entries_per_day.
|
|
37
|
+
# Counts open positions opened today (startTime) + closed trades opened today (openTime).
|
|
38
|
+
# Resets at UTC midnight.
|
|
39
|
+
max_entries_per_day: 8
|
|
40
|
+
# When true, at the entry cap gate 5 stays OPEN if today_snapshot.pnl.delta_since_open > 0
|
|
41
|
+
# (intraday PnL delta vs UTC day open; same MCP snapshot as daily loss when gates 1–2 run).
|
|
42
|
+
# Default: false.
|
|
43
|
+
bypass_max_entries_per_day_on_profit: false
|
|
44
|
+
|
|
45
|
+
# ── Consecutive Loss Cooldown ──
|
|
46
|
+
# Gate COOLDOWN when the last N closed trades all have negative realizedPnl.
|
|
47
|
+
# Stateless: derived from trade history API on every tick, no persisted streak.
|
|
48
|
+
# Streak carries across days. Cooldown window starts from the most recent
|
|
49
|
+
# loss's close time and expires cooldown_minutes later.
|
|
50
|
+
max_consecutive_losses: 3
|
|
51
|
+
cooldown_minutes: 60
|
|
52
|
+
|
|
53
|
+
# ── Drawdown Halt ──
|
|
54
|
+
# Gate CLOSED when PnL drawdown from peak >= drawdown_halt_pct %.
|
|
55
|
+
# PnL-based: immune to deposits and withdrawals.
|
|
56
|
+
# Drawdown = (peak_pnl - current_pnl) / account_value_at_day_open * 100.
|
|
57
|
+
drawdown_halt_pct: 30 # 30% PnL drawdown from peak triggers halt
|
|
58
|
+
# When true, PnL peak resets at UTC midnight (intraday drawdown only).
|
|
59
|
+
# When false (default), PnL peak carries from prior ~24h (perpDay window).
|
|
60
|
+
drawdown_reset_on_day_rollover: false
|
|
61
|
+
|
|
62
|
+
# ── Per-Asset Cooldown ──
|
|
63
|
+
# Gate COOLDOWN for a specific asset when it was closed within the last N minutes.
|
|
64
|
+
# Checked on each entry attempt. Only evaluated when all other gates are OPEN.
|
|
65
|
+
# Minimum: 5 minutes (backend latency floor).
|
|
66
|
+
per_asset_cooldown_minutes: 30 # 30 min cooldown after closing any asset
|
|
67
|
+
|
|
68
|
+
# ── SCANNERS ──
|
|
69
|
+
scanners:
|
|
70
|
+
- name: position_tracker
|
|
71
|
+
type: position_tracker
|
|
72
|
+
interval: 10s
|
|
73
|
+
|
|
74
|
+
# ── ACTIONS ──
|
|
75
|
+
actions:
|
|
76
|
+
- name: position_tracker_action
|
|
77
|
+
action_type: POSITION_TRACKER
|
|
78
|
+
decision_mode: rule
|
|
79
|
+
scanners: [position_tracker]
|
|
80
|
+
|
|
81
|
+
# ── EXIT ──
|
|
82
|
+
exit:
|
|
83
|
+
engine: dsl
|
|
84
|
+
interval_seconds: 30
|
|
85
|
+
dsl_preset:
|
|
86
|
+
phase1:
|
|
87
|
+
max_loss_pct: 5.0
|
|
88
|
+
retrace_threshold: 10
|
|
89
|
+
consecutive_breaches_required: 2
|
|
90
|
+
phase2:
|
|
91
|
+
tiers:
|
|
92
|
+
- { trigger_pct: 10, lock_hw_pct: 50 }
|
|
93
|
+
- { trigger_pct: 20, lock_hw_pct: 70 }
|
|
@@ -4,9 +4,8 @@ description: Moderate — candle-based breakouts via prescreener + momentum.
|
|
|
4
4
|
|
|
5
5
|
strategy:
|
|
6
6
|
wallet: "${WALLET_ADDRESS}"
|
|
7
|
-
budget: 2000
|
|
8
7
|
slots: 4
|
|
9
|
-
|
|
8
|
+
margin_pct: 10
|
|
10
9
|
trading_risk: moderate
|
|
11
10
|
enabled: true
|
|
12
11
|
|
|
@@ -37,13 +36,22 @@ actions:
|
|
|
37
36
|
decision_model: claude-sonnet-4-20250514
|
|
38
37
|
scanners: [momentum]
|
|
39
38
|
min_confidence: 6
|
|
39
|
+
params:
|
|
40
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
41
|
+
fee_optimized_limit_options:
|
|
42
|
+
ensure_execution_as_taker: true
|
|
43
|
+
execution_timeout_seconds: 15
|
|
40
44
|
context: [signal]
|
|
41
45
|
decision_prompt: |
|
|
42
|
-
Evaluate the momentum breakout signal. Reply with JSON: {"execute": true|false, "actionType": "OPEN_POSITION", "confidence": 1-10, "reasoning": "...", "payload": {"signals": [{"asset": "SYMBOL", "direction": "LONG"|"SHORT", "reason": "..."}]}}.
|
|
46
|
+
Evaluate the momentum breakout signal. Reply with JSON: {"execute": true|false, "actionType": "OPEN_POSITION", "confidence": 1-10, "reasoning": "...", "payload": {"signals": [{"asset": "SYMBOL", "direction": "LONG"|"SHORT", "reason": "...", "leverage": <optional number>, "margin": <optional $ amount>}]}}.
|
|
43
47
|
|
|
44
48
|
exit:
|
|
45
49
|
engine: dsl
|
|
46
50
|
interval_seconds: 30
|
|
51
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
52
|
+
fee_optimized_limit_options:
|
|
53
|
+
ensure_execution_as_taker: true
|
|
54
|
+
execution_timeout_seconds: 15
|
|
47
55
|
dsl_preset:
|
|
48
56
|
phase1:
|
|
49
57
|
enabled: true
|
|
@@ -4,9 +4,8 @@ description: Aggressive — early entry on FIRST_JUMP from emerging_movers.
|
|
|
4
4
|
|
|
5
5
|
strategy:
|
|
6
6
|
wallet: "${WALLET_ADDRESS}"
|
|
7
|
-
budget: 1000
|
|
8
7
|
slots: 3
|
|
9
|
-
|
|
8
|
+
margin_pct: 15
|
|
10
9
|
trading_risk: aggressive
|
|
11
10
|
enabled: true
|
|
12
11
|
|
|
@@ -32,13 +31,22 @@ actions:
|
|
|
32
31
|
decision_model: claude-sonnet-4-20250514
|
|
33
32
|
scanners: [emerging_movers]
|
|
34
33
|
min_confidence: 6
|
|
34
|
+
params:
|
|
35
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
36
|
+
fee_optimized_limit_options:
|
|
37
|
+
ensure_execution_as_taker: true
|
|
38
|
+
execution_timeout_seconds: 10
|
|
35
39
|
context: [signal]
|
|
36
40
|
decision_prompt: |
|
|
37
|
-
Evaluate the signal. Reply with JSON: {"execute": true|false, "actionType": "OPEN_POSITION", "confidence": 1-10, "reasoning": "...", "payload": {"signals": [{"asset": "SYMBOL", "direction": "LONG"|"SHORT", "reason": "..."}]}}.
|
|
41
|
+
Evaluate the signal. Reply with JSON: {"execute": true|false, "actionType": "OPEN_POSITION", "confidence": 1-10, "reasoning": "...", "payload": {"signals": [{"asset": "SYMBOL", "direction": "LONG"|"SHORT", "reason": "...", "leverage": <optional number>, "margin": <optional $ amount>}]}}.
|
|
38
42
|
|
|
39
43
|
exit:
|
|
40
44
|
engine: dsl
|
|
41
45
|
interval_seconds: 30
|
|
46
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
47
|
+
fee_optimized_limit_options:
|
|
48
|
+
ensure_execution_as_taker: true
|
|
49
|
+
execution_timeout_seconds: 10
|
|
42
50
|
dsl_preset:
|
|
43
51
|
hard_timeout:
|
|
44
52
|
enabled: true
|
|
@@ -11,9 +11,8 @@ description: > #required
|
|
|
11
11
|
# ── STRATEGY ──
|
|
12
12
|
strategy: #required
|
|
13
13
|
wallet: "0x71ce3f0e27c178cbdcf01c4d068278034df75fbc"
|
|
14
|
-
budget: "100"
|
|
15
14
|
slots: 3
|
|
16
|
-
|
|
15
|
+
margin_pct: 10
|
|
17
16
|
trading_risk: aggressive
|
|
18
17
|
enabled: true
|
|
19
18
|
|
|
@@ -36,7 +35,12 @@ actions: #required
|
|
|
36
35
|
decision_mode: llm #required
|
|
37
36
|
decision_model: claude-sonnet-4-6 #required
|
|
38
37
|
scanners: [emerging_movers] #required
|
|
39
|
-
min_confidence: 2 #required
|
|
38
|
+
min_confidence: 2 #required
|
|
39
|
+
params:
|
|
40
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
41
|
+
fee_optimized_limit_options:
|
|
42
|
+
ensure_execution_as_taker: true
|
|
43
|
+
execution_timeout_seconds: 15
|
|
40
44
|
context: #optional
|
|
41
45
|
- type: signal
|
|
42
46
|
value: emerging_movers
|
|
@@ -84,7 +88,7 @@ actions: #required
|
|
|
84
88
|
"reasoning": "one sentence",
|
|
85
89
|
"payload": {
|
|
86
90
|
"signals": [
|
|
87
|
-
{ "asset": "<coin_ticker>", "direction": "LONG" or "SHORT", "reason": "one sentence", "rotate_out": "<asset_to_cut>" }
|
|
91
|
+
{ "asset": "<coin_ticker>", "direction": "LONG" or "SHORT", "reason": "one sentence", "rotate_out": "<asset_to_cut>", "leverage": "<optional number>", "margin": "<optional $ amount>" }
|
|
88
92
|
]
|
|
89
93
|
}
|
|
90
94
|
}
|
|
@@ -94,6 +98,10 @@ actions: #required
|
|
|
94
98
|
exit: #required
|
|
95
99
|
engine: dsl
|
|
96
100
|
interval_seconds: 30
|
|
101
|
+
order_type: FEE_OPTIMIZED_LIMIT
|
|
102
|
+
fee_optimized_limit_options:
|
|
103
|
+
ensure_execution_as_taker: true
|
|
104
|
+
execution_timeout_seconds: 15
|
|
97
105
|
dsl_preset:
|
|
98
106
|
phase1:
|
|
99
107
|
enabled: true
|
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": "1.0.
|
|
5
|
+
"version": "1.0.98",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
|
@@ -15,6 +15,16 @@
|
|
|
15
15
|
"type": "string",
|
|
16
16
|
"description": "API key when mcpTransport is not provided by the gateway"
|
|
17
17
|
},
|
|
18
|
+
"logLevel": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": [
|
|
21
|
+
"debug",
|
|
22
|
+
"info",
|
|
23
|
+
"warn",
|
|
24
|
+
"error"
|
|
25
|
+
],
|
|
26
|
+
"description": "Minimum log level (default: info). Overrides the SENPI_LOG_LEVEL env var when set."
|
|
27
|
+
},
|
|
18
28
|
"autoUpdate": {
|
|
19
29
|
"type": "object",
|
|
20
30
|
"description": "Auto-update configuration. Enabled with auto-apply by default (opt-out). Omit this block entirely to use defaults.",
|
|
@@ -60,6 +70,30 @@
|
|
|
60
70
|
"description": "Internal: timestamp written by the auto-updater to trigger gateway restart via config reload. Do not set manually."
|
|
61
71
|
}
|
|
62
72
|
}
|
|
73
|
+
},
|
|
74
|
+
"api": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"host": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"default": "127.0.0.1",
|
|
81
|
+
"description": "Bind interface inside the openclaw container. Default 127.0.0.1 (container loopback only). Set to 0.0.0.0 to enable Docker port mapping for Postman testing — see runtime-api.md."
|
|
82
|
+
},
|
|
83
|
+
"port": {
|
|
84
|
+
"type": "integer",
|
|
85
|
+
"minimum": 1,
|
|
86
|
+
"maximum": 65535,
|
|
87
|
+
"default": 8787
|
|
88
|
+
},
|
|
89
|
+
"maxItemsPerSignalsRequest": {
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"minimum": 1,
|
|
92
|
+
"maximum": 1000,
|
|
93
|
+
"default": 10,
|
|
94
|
+
"description": "Maximum number of items in a single POST /signals body. Conservative default — operators raise it consciously when broadcasting to many wallets at once."
|
|
95
|
+
}
|
|
96
|
+
}
|
|
63
97
|
}
|
|
64
98
|
}
|
|
65
99
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@senpi-ai/runtime",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.98",
|
|
4
4
|
"description": "Senpi runtime plugin for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"setup:hooks": "sh -c 'git rev-parse --git-dir >/dev/null 2>&1 && git config core.hooksPath .githooks || true'",
|
|
15
15
|
"prepare": "npm run setup:hooks",
|
|
16
|
-
"build": "npm i && tsc",
|
|
16
|
+
"build": "npm i && tsc && npm run copy:external-scanners",
|
|
17
|
+
"copy:external-scanners": "node -e \"require('fs').rmSync('dist/scanners/external', { recursive: true, force: true }); require('fs').cpSync('src/scanners/external', 'dist/scanners/external', { recursive: true })\"",
|
|
17
18
|
"typecheck:tests": "tsc -p tsconfig.tests.json --noEmit",
|
|
18
19
|
"start": "node dist/index.js",
|
|
19
20
|
"debug": "npm run build && node dist/debug.js",
|
|
@@ -23,25 +24,29 @@
|
|
|
23
24
|
"run:dsl:mock": "node dist/scripts/run-dsl-standalone-mock.js",
|
|
24
25
|
"run:dsl:live": "node dist/scripts/run-dsl-standalone-live.js",
|
|
25
26
|
"test:coverage": "vitest run --coverage",
|
|
26
|
-
"prepublishOnly": "npm run build && npm run typecheck:tests && npm test"
|
|
27
|
+
"prepublishOnly": "npm run build && npm run typecheck:tests && npm test",
|
|
28
|
+
"bench": "tsx benchmarks/ingest-latency.ts"
|
|
27
29
|
},
|
|
28
30
|
"engines": {
|
|
29
31
|
"node": ">=22"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
34
|
"@anthropic-ai/sdk": "^0.39.0",
|
|
33
|
-
"dotenv": "^16.4.5",
|
|
34
35
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
35
|
-
"
|
|
36
|
+
"@sinclair/typebox": "^0.34.0",
|
|
37
|
+
"dd-trace": "^5.99.1",
|
|
38
|
+
"dotenv": "^16.4.5",
|
|
39
|
+
"fastify": "^5.8.5",
|
|
36
40
|
"mcporter": "^0.7.3",
|
|
37
|
-
"yaml": "^2.8.0"
|
|
41
|
+
"yaml": "^2.8.0",
|
|
42
|
+
"zod": "^3.23.0"
|
|
38
43
|
},
|
|
39
44
|
"peerDependencies": {
|
|
40
45
|
"openclaw": ">=2026.2.0"
|
|
41
46
|
},
|
|
42
47
|
"devDependencies": {
|
|
43
|
-
"@sinclair/typebox": "^0.34.0",
|
|
44
48
|
"@types/node": "^22.0.0",
|
|
49
|
+
"tsx": "^4.21.0",
|
|
45
50
|
"typescript": "^5.7.0",
|
|
46
51
|
"vitest": "^3.0.0"
|
|
47
52
|
},
|