Install
$ agentstack add skill-senpi-ai-senpi-skills-octopus ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
🐙 OCTOPUS v1.0 — Market-Neutral Hedge Fund
Octopus runs two concurrent strategy wallets whose net market exposure is ~zero. One producer script (octopus-producer.py) serves both; the OCTOPUS_LEG env var selects which book a given daemon is. Each book binds to its own wallet, runtime YAML, DSL, and risk envelope.
> The edge is dispersion, not direction. Octopus longs the relative > leaders and shorts the relative laggards of the same liquid crypto > cross-section. Long-book gains + short-book gains capture the spread > between strong and weak names while the long and short notionals offset > market beta. In a HYPE-dominates / alts-crushed regime the long book > gravitates to the leaders and the short book to the carnage — market-neutrally.
| Book | Style | Wallet env | Runtime | Scanner | |---|---|---|---|---| | long | Cross-sectional relative-strength LONG | OCTOPUS_LONG_WALLET | runtime-long.yaml | octopus_long_signals | | short | Cross-sectional relative-weakness SHORT | OCTOPUS_SHORT_WALLET | runtime-short.yaml | octopus_short_signals |
How market-neutral is achieved
Octopus does not emit atomic pairs. Neutrality emerges at the fund level: two equally-funded single-direction books. The long book holds a basket of leaders; the short book holds a basket of laggards. With balanced funding (50/50) and balanced sizing (both margin_pct 20, slots 4), the long and short notionals roughly offset, so the portfolio's net beta ≈ 0 and its return is driven by the dispersion between the two baskets. Each book has its own wallet + DSL, so a position exiting on one side does not force the other — the books re-balance continuously as leadership rotates.
The relative-strength rank (shared by both books)
Each tick the producer pulls the live instrument board once and computes, for every liquid main-DEX perp (top-universeMaxNames by 24h volume, then a relative-to-market floor: dayNtlVlm ≥ volFloorPctOfMedian × the cohort median — no hardcoded $ floor), its 24h return from markPx vs prevDayPx. The universe mean of those returns is "the market." Each asset's excess = own 24h − universe mean is its cross-sectional relative strength. This rank costs zero candle fetches. Only the top (long) / bottom (short) rankPoolSize names by excess (default 12) then get 1h+4h candles pulled for absolute-trend confirmation — bounding per-tick fetches.
LONG book — long the leaders (trend-confirmed)
Scoring (raw integer; minScore 5)
| Component | Pts | Source | |---|---|---| | Relative strength (excess) | +3 (≥2×rsThresholdPct) / +2 (≥1×) / +1 (≥0) / disqualify ( rsiOverbought 80) | 1h RSI |
Disqualifies any name that is a relative underperformer or in a 4h downtrend — it never longs a "least-bad" laggard in a crash.
SHORT book — short the laggards (trend-confirmed)
Scoring (raw integer; minScore 5)
| Component | Pts | Source | |---|---|---| | Relative weakness (excess) | +3 (≤−2×rsThresholdPct) / +2 (≤−1×) / +1 (≤0) / disqualify (>0) | 24h excess vs cross-section | | 4h trend structure | +2 BEARISH / disqualify BULLISH | 4h candles | | 1h trend confirmation | +1 BEARISH / −1 BULLISH | 1h candles | | Own absolute momentum | +1 (24h ≤ 0) / −1 (> 0) | instrument ctx | | RSI capitulation guard | −2 (RSI .json` (per-book). The producer skips any coin seen within 180s before scoring — covering the gap between a push returning OK and the position appearing in the next-tick clearinghouse pull. On-chain held-asset filtering is the safety floor.
Risk gates (risk.guard_rails)
| Gate | long | short | |---|---|---| | dailylosslimitpct | 12 | 12 | | maxentriesperday | 6 | 6 | | maxconsecutivelosses | 4 | 4 | | cooldownminutes | 60 | 60 | | drawdownhaltpct | 20 | 20 | | perassetcooldownminutes | 180 | 180 | | dataretentionhours | 120 | 120 | | drawdownresetondayrollover | true | true |
Entries and exits both use FEE_OPTIMIZED_LIMIT (ensure_execution_as_taker true; 45s maker-first window).
Files
| File | Purpose | |---|---| | runtime-long.yaml | Long-book runtime spec (wallet, DSL, risk, LLM gate) | | runtime-short.yaml | Short-book runtime spec | | scripts/octopus-producer.py | Book-aware producer daemon (one script, both books) | | scripts/octopus_config.py | Leg resolution + SenpiClient wrapper + helpers | | config/octopus-long-config.json | Long-book tunables (universe floor, RS threshold) | | config/octopus-short-config.json | Short-book tunables |
Operator install
See [README.md](README.md) — the two books are two daemons (OCTOPUS_LEG=long and OCTOPUS_LEG=short) on two equally-funded wallets, each with its own runtime YAML. Equal funding is what keeps the fund neutral.
Hard rule for user-conversation Claude sessions
User-conversation Claude sessions MUST NOT call any of: create_position, close_position, edit_position, ratchet_stop_add, ratchet_stop_edit, ratchet_stop_delete, cancel_order, strategy_close, strategy_close_positions.
These tools are reserved for the producer daemon (entry path) and the DSL ratchet engine (exit path). User-conversation sessions are read-only. Each producer daemon handles real signals on its next tick.
License
Apache-2.0 — Copyright 2026 Senpi (https://senpi.ai)
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Senpi-ai
- Source: Senpi-ai/senpi-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.