senpi-trading-runtime

Installation
SKILL.md

Senpi Trading Runtime — OpenClaw Plugin

On-chain position tracker with automated DSL (Dynamic Stop-Loss) exit engine. Monitors a wallet's positions on Hyperliquid for lifecycle events (open, close, edit, flip) and applies two-phase trailing stop-loss protection to all positions.

Core Concepts

Python Producer SDK ships with this skill at senpi_runtime_helpers/. When wiring up an external_scanner (a Python producer that pushes signals into this runtime), build it on this SDK — it wraps the /signals endpoint, the SignalItem schema, the per-tick lock, and the long-running daemon scheduler in one stdlib-only Python package. Recipes and rules: see Python Producer SDK below.

SignalItem shape (per runtime-api/routes/signals.schema.ts): top-level address, scanner, asset, direction, score (0..1), signal_type. The per-scanner data block is validated against the config.fields declared on the external_scanner. Keep asset and direction out of data — they're top-level routing fields. Putting them in data makes the runtime store two copies (signal.asset vs signal.meta.asset) and downstream consumers read inconsistently; the runtime rejects this with INVALID_REQUEST.

Flow:

  • Self-tracking (no external scanner): position_tracker scanner detects on-chain position changes → DSL exit engine manages trailing stops. Protects positions opened manually or by any tool on Hyperliquid.
  • Signal-driven (with external_scanner): external producer pushes signals via POST /signals → action decides (rule-based or LLM-gated) → opens position → position_tracker picks it up → DSL manages exits.

In both flows, strategy = wallet address. The wallet address is the strategy identifier everywhere.

Key insight: The position tracker enables DSL protection for ALL positions of a strategy address — including those opened manually on the exchange or by other tools.

Related skills
Installs
65
GitHub Stars
75
First Seen
Apr 1, 2026