Token导航 LogoToken导航TokenDH.com
待分类执行命令github未标认证来源可访问许可证需确认审计提醒

senpi-trading-runtimesenpi 交易运行时

Agent Skill

senpi-trading-runtime 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

776

周安装

33

GitHub Stars

75

下载量

272
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:senpi-trading-runtime(senpi 交易运行时)
来源仓库:https://github.com/senpi-ai/senpi-skills
仓库路径:skills/senpi-trading-runtime
安装命令:
npx skills add https://github.com/senpi-ai/senpi-skills --skill senpi-trading-runtime
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/senpi-ai/senpi-skills --skill senpi-trading-runtime

简介

senpi-trading-runtime 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在交易系统开发协作中使用。

  • 适用于需要跟踪功能迭代、分析性能问题或参与代码审查的场景。
  • 通过 npx skills add 命令安装,具体功能需参考原始实现。
  • 使用前应确认是否涉及金融数据处理及是否符合合规要求。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

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. It links to an existing strategy wallet address and does not create wallets.

Core Concepts

Flow: Position Tracker scanner → detects position changes → DSL exit engine manages trailing stops

  1. Position Tracker (position_tracker scanner) polls the wallet on-chain, detecting opens, closes, increases, decreases, and flips.
  2. DSL exit engine monitors tracked positions on a timer, computing trailing stop-loss floors across two phases.
  3. Strategy (in runtime) = link to an existing wallet address. The wallet address is the strategy identifier everywhere, but wallet creation happens via Senpi MCP (not the runtime).

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.

Wallet lifecycle (required order)

  1. Create strategy wallet address via Senpi MCP calls (or confirm it already exists).
  2. Put that wallet address into runtime YAML (strategies.<name>.wallet / ${WALLET_ADDRESS}).
  3. Install/create runtime. This links the runtime to the existing wallet for monitoring and exits.

Never treat openclaw senpi runtime create as wallet creation.

Strategy wallet validation (mandatory before runtime create/install)

Use this exact MCP-first guardrail to avoid using embedded wallets by mistake:

  1. Call strategy_list and collect strategies[].strategyWalletAddress.
  2. A runtime wallet is valid only if it appears in that list (case-insensitive match).
  3. If list is empty OR provided wallet is not in list: call strategy_create_custom_strategy to create a strategy wallet first.
  4. Use the newly created strategy wallet address directly as WALLET_ADDRESS in runtime YAML, then install runtime.

Hard rules:

  • Never use embedded wallet/injected wallet for runtime linking.
  • Never treat a wallet as a strategy wallet unless it exists in strategy_list.
  • Runtime install is blocked until strategy wallet validation passes.
  • Always confirm with the user before creating a new strategy wallet address, and explicitly confirm the budget (initialBudget) that will be used.

Example MCP flow (tool names from Senpi MCP):

strategy_list({})
if provided_wallet not in strategies[].strategyWalletAddress:
  # confirm with user first: create new strategy wallet + initialBudget
  strategy_create_custom_strategy({
    initialBudget: <budget_usdc>,
    positions: [],
    skillName: <strategy_or_runtime_name>,
    skillVersion: "1.0.0"
  })

Notes:

  • initialBudget is required when creating the strategy wallet.
  • Use positions: [] when you only need the strategy wallet created now and will trade later.

CLI Commands

All commands require the OpenClaw gateway running (openclaw gateway run).

Use openclaw senpi --cheatsheet to print the full plugin command cheatsheet to stdout.

Runtime management

Prerequisite: strategy wallet address already exists (created/fetched via Senpi MCP).

# Create a runtime from YAML file
openclaw senpi runtime create --path ./my-strategy.yaml
openclaw senpi runtime create -p ./my-strategy.yaml          # short form

# Create with inline YAML content
openclaw senpi runtime create --content "<yaml>"
openclaw senpi runtime create -c "<yaml>"                    # short form

# Create with custom ID
openclaw senpi runtime create --path ./my-strategy.yaml --runtime-id my-name

# List installed runtimes (id, wallet, source, status)
openclaw senpi runtime list

# Delete a runtime
openclaw senpi runtime delete <runtime_id>                   # positional id
openclaw senpi runtime delete --id <runtime_id>              # named flag

DSL position inspection

# All active DSL-tracked positions
openclaw senpi dsl positions
openclaw senpi dsl positions -r <id>                         # filter by runtime id
openclaw senpi dsl positions -a <addr>                       # filter by wallet address
openclaw senpi dsl positions --json

# Inspect one position (full DslState)
openclaw senpi dsl inspect <ASSET>
openclaw senpi dsl inspect SOL -r <id>
openclaw senpi dsl inspect SOL -a <addr>
openclaw senpi dsl inspect BTC --json

# Archived (closed) positions — reason, ROE, phase, tier
openclaw senpi dsl closes
openclaw senpi dsl closes -r <id>
openclaw senpi dsl closes -a <addr>
openclaw senpi dsl closes -l <n>
openclaw senpi dsl closes --json

Runtime diagnostics

openclaw senpi status                    # lightweight health summary (all runtimes)
openclaw senpi status -r <id>
openclaw senpi status --json

openclaw senpi state                     # full operational state (all runtimes)
openclaw senpi state -r <id>
openclaw senpi state --json

In-shell reference (senpi guide)

openclaw senpi guide                 # overview + quick command list
openclaw senpi guide scanners        # scanner types and config fields
openclaw senpi guide actions         # action types and decision modes
openclaw senpi guide dsl             # DSL exit engine: phases, tiers, time cuts
openclaw senpi guide examples        # print minimal strategy YAML to stdout
openclaw senpi guide schema          # full YAML schema field reference
openclaw senpi guide version         # plugin version and changelog URL

CLI preferences (senpi config)

Persists to ~/.openclaw/senpi-cli.json. Restart gateway to apply.

openclaw senpi config set-chat-id <chatId>
openclaw senpi config set-senpi-jwt-token <token>
openclaw senpi config set-state-dir <dir>
openclaw senpi config get <key>      # telegram-chat-id | senpi-jwt-token | state-dir
openclaw senpi config list           # secrets masked
openclaw senpi config unset <key>
openclaw senpi config reset

Gateway RPC (advanced)

Common calls:

openclaw gateway call senpi.installRuntime --params '{"runtimeYamlContent":"..."}'
openclaw gateway call senpi.listRuntimes --json --params '{}'
openclaw gateway call senpi.deleteRuntime --params '{"id":"my-runtime"}'
openclaw gateway call senpi.listDslPositions --json --params '{}'
openclaw gateway call senpi.getDslPositionState --json --params '{"asset":"SOL"}'
openclaw gateway call senpi.listDslArchives --json --params '{"limit":20}'
openclaw gateway call senpi.getHealthStatus --json --params '{}'
openclaw gateway call senpi.getSystemState --json --params '{}'

Methods summary

MethodParamsSuccess response
senpi.installRuntimeruntimeYamlContent or runtimeYamlPathRuntime installed
senpi.listRuntimesList of runtimes
senpi.deleteRuntimeid or addressDeleted
senpi.listDslPositionsruntimeId?Active positions
senpi.getDslPositionStateasset, runtimeId?Single position state
senpi.listDslArchivesruntimeId?, address?, limit?closes[] (asset, direction, entryPrice, lastPrice, currentROE, closeReason, closedAt, phase, …)
senpi.getHealthStatusruntimeId? (string)status or statuses[] (health, components.scanners, components.dsl)
senpi.getSystemStateruntimeId? (string)state or states[] (health, stateDir, scanner/DSL components)

Close reasons for listDslArchives: dsl_breach, hard_timeout, weak_peak_cut, dead_weight_cut, exchange_sl_hit, manual.

Runtime YAML

The runtime YAML drives all behavior. Top-level keys: name, strategies, scanners, actions, exit, notifications.

name: my-tracker
version: 1.0.0
description: >
  On-chain position tracker with DSL trailing stop-loss.

strategies:
  main:
    wallet: "${WALLET_ADDRESS}"
    budget: 500
    slots: 2
    margin_per_slot: 200
    trading_risk: conservative    # conservative | moderate | aggressive
    enabled: true

scanners:
  - name: position_tracker
    type: position_tracker
    interval: 10s

actions:
  - name: position_tracker_action
    action_type: POSITION_TRACKER
    decision_mode: rule
    scanners: [position_tracker]

exit:
  engine: dsl
  interval_seconds: 30            # how often the price monitor runs (5-3600)
  dsl_preset:                     # single preset (no named map needed)
    hard_timeout:
      enabled: true
      interval_in_minutes: 360
    weak_peak_cut:
      enabled: true
      interval_in_minutes: 120
      min_value: 5
    dead_weight_cut:
      enabled: true
      interval_in_minutes: 60
    phase1:
      enabled: true
      max_loss_pct: 4.0
      retrace_threshold: 7
      consecutive_breaches_required: 1
    phase2:
      enabled: true
      tiers:
        - { trigger_pct: 7,  lock_hw_pct: 40 }
        - { trigger_pct: 12, lock_hw_pct: 55 }
        - { trigger_pct: 15, lock_hw_pct: 75 }
        - { trigger_pct: 20, lock_hw_pct: 85 }

notifications:
  telegram_chat_id: "${TELEGRAM_CHAT_ID}"

Environment variable substitution: ${VAR} and ${VAR:-default} resolved at load time.

For full field details: YAML Schema Reference

DSL Exit Engine — Key Concepts

Two-phase trailing stop-loss protecting open positions:

Phase 1 (from entry until the first tier is reached):

  • Absolute floor from max_loss_pct (cap on loss from entry, scaled by leverage)
  • Trailing floor from retrace_threshold (ROE % pullback from high-water mark)
  • Effective floor = stricter of both (LONG: higher price; SHORT: lower)
  • Optional time-based cuts at preset level: hard_timeout, weak_peak_cut, dead_weight_cut
  • Exchange SL stays at the absolute floor only; tighter exits enforced by runtime

Phase 2 (after the first tier is reached — Phase 2 always starts at tier 0):

  • Tier floor = lock_hw_pct % of current high-water ROE (trails as HW advances, never loosens)
  • Exchange SL tracks the full effective floor and updates as it moves

Tiers are profit milestones (by ROE % from entry). Each tier has two fields: trigger_pct (ROE % that activates it) and lock_hw_pct (% of high-water ROE to lock as floor). Tiers must have strictly increasing trigger_pct.

Consecutive breaches are tick-based (not time-based). Each monitor tick (every interval_seconds), if price violates the floor, the breach counter increments. Recovery resets it.

Retrace convention: retrace_threshold is ROE %. Engine converts to price: retrace_ROE% / 100 / leverage. At 10x leverage, 7% ROE retrace = 0.7% price below high-water.

For full DSL configuration with all fields, time-based cuts, close reasons, and events: DSL Configuration Reference

Environment Variables

VariableRequiredPurpose
WALLET_ADDRESSYesExisting strategy wallet address from Senpi MCP (used in YAML via ${WALLET_ADDRESS}).
SENPI_API_KEYFor live MCPSenpi MCP authentication.
TELEGRAM_CHAT_IDNoTelegram chat ID for notifications.
DSL_STATE_DIRNoOverride DSL state file directory.

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.76%
按下载量换算100

Claude

28.74%
按下载量换算78

Cursor

20.7%
按下载量换算56

Gemini CLI

10.81%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/senpi-ai/senpi-skills --skill senpi-trading-runtime 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills