senpi-trading-runtime

senpi-trading-runtime is a skill for Claude Code, Codex from Senpi-ai/senpi-skills. It costs 157 tokens per session (1,789 once invoked), scanned A, original, MIT.

A technical guide to the Senpi runtime, the service that supervises trading-strategy code on Hyperliquid, a crypto trading platform. It explains how a Python scanner returns signals while the runtime handles scheduling, orders, sizing, risk checks, and exits.

In plain words
What is it for?
Use it when building or reviewing a Senpi strategy that runs from runtime.yaml and exports scan(inputs, ctx). It is also a reference for the skills that build, deploy, monitor, or recommend strategies.
Why use it?
It prevents strategy code from taking on runtime responsibilities or using the wrong interface. It also clarifies which parts the strategy controls and which parts the runtime controls.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it when building or reviewing a Senpi strategy that runs from runtime.yaml and exports scan(inputs, ctx). It is also a reference for the skills that build, deploy, monitor, or recommend strategies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/senpi-ai/senpi-skills/senpi-trading-runtime
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Senpi-ai/senpi-skills --skill senpi-trading-runtime
Clone the repo
git clone --depth 1 https://github.com/Senpi-ai/senpi-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for senpi-trading-runtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/senpi-ai/senpi-skills/senpi-trading-runtime/github.svg)](https://agentmods.dev/skills/senpi-ai/senpi-skills/senpi-trading-runtime)
Your own site
<a href="https://agentmods.dev/skills/senpi-ai/senpi-skills/senpi-trading-runtime"><img src="https://agentmods.dev/badge/skills/senpi-ai/senpi-skills/senpi-trading-runtime/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for senpi-trading-runtime

Your own site · 80×15
<a href="https://agentmods.dev/skills/senpi-ai/senpi-skills/senpi-trading-runtime"><img src="https://agentmods.dev/badge/skills/senpi-ai/senpi-skills/senpi-trading-runtime.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 157 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,789 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00157 $0.01789
Opus 5 $0.00078 $0.00894
Sonnet 5 $0.00031 $0.00358
Haiku 4.5 $0.00016 $0.00179

Measured yesterday against content hash 46dc3afd76ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

senpi-trading-runtime scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/gen_catalog.py, scripts/min_budget.py, tests/test_min_budget_golden.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

senpi-trading-runtime/SKILL.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Senpi Trading Runtime — the runtime contract

This skill is infrastructure: the canonical knowledge of how the Senpi runtime (@senpi-ai/runtime) behaves and how a strategy interacts with it. The lifecycle skills — author (build), ops (install/monitor), discover (recommend) — reference this one for the contract.

The runtime model

A strategy runs from a runtime.yaml that points at an in-repo Python module. The runtime spawns and supervises that module and calls a frozen scan(inputs, ctx) every interval_seconds. The division of labor is fixed:

  • Your code produces signals — nothing else. scan(inputs, ctx) reads market and account data and returns a list[dict] of candidate signals. It does not open, close, size, schedule, or execute anything.
  • The runtime owns everything downstream: scheduling (interval_seconds), spawning + supervising + restarting the scanner, validating (signal_data_schema) + de-duplicating the signals you return, sizing & order execution (FEE_OPTIMIZED_LIMIT), slot accounting, risk.guard_rails, the two-phase DSL trailing-stop exits, and crash-safe position reconcile on restart.

How your code talks to the runtime

The interaction surface is small and one-directional — you read, you return signals, the runtime acts.

  • runtime.yaml declares the scanner(s), the action gate, the exit engine, and the risk guard-rails, and passes author tunables down via inputs:. → references/runtime-yaml.md
  • scan(inputs, ctx) is the single entry point. inputs is the runtime's inputs: map; ctx gives you:
    • ctx.senpi_mcp.call_tool(name, args) — the Senpi MCP client, read-only (market, account, leaderboard, discovery, strategy_get*, …). It is the only way to fetch data.
    • ctx.state — transactional, runtime-persisted history (last() / append() / len) for dedup, rotation, and first-seen ledgers; advances only on a clean tick.
    • ctx.wallet — the strategy's wallet address.
    • references/scan-contract.md
  • The return value is a list[dict], one per candidate signal (asset, direction, marginPct, leverage, data{}). The runtime validates each data{} against the runtime.yaml's signal_data_schema, then sizes, executes, and manages exits.

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed 46dc3afd76ca
  2. 12d ago First seen · 114 lines · 157 tokens per session scan A a7308b6c8df2

Subscribe to this mod's changes

senpi-trading-runtime is a skill published in the GitHub repository Senpi-ai/senpi-skills (123 stars, last pushed today), licensed MIT. It adds 157 tokens to every session and 1,789 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.