elephant-strategy
ELEPHANT v1.0 — Global-Macro Hedge Fund. Two macro books on two wallets, one producer, over the cross-asset macro complex — equity indices, precious metals, energy, FX (all on XYZ) plus BTC as the macro risk asset. The TREND book rides the medium-term multi-timeframe macro trend (both directions); the FADE book fades short-TF macro over-extensions back to regime (both directions, with a knife guard). The edge is GLOBAL MACRO — the cross-asset complex moves on regime, not crypto noise. NOT a copy-trader: each book scores its own universe and pushes signals; the runtime owns the LLM gate (pass-through), DSL exits, and all risk.guard_rails. ELEPHANT_LEG env selects the book.
What this skill does
# 🐘 ELEPHANT v1.0 — Global-Macro Hedge Fund Elephant trades the **cross-asset macro complex** — equity indices, precious metals, energy, FX (all on XYZ) plus **BTC** as the macro risk asset — which moves on macro regime, not crypto noise. **One producer script** (`elephant-producer.py`) serves both books; the `ELEPHANT_LEG` env var selects which book a given daemon is. It is **aware of the themes** (oil/Iran, the AI-equity bid, risk-on/off) and trades them **as macro**, not as momentum chases. | Book | Style | Wallet env | Runtime | Scanner | |---|---|---|---|---| | `trend` | Macro multi-TF trend, both directions | `ELEPHANT_TREND_WALLET` | `runtime-trend.yaml` | `elephant_trend_signals` | | `fade` | Macro mean-reversion, both directions | `ELEPHANT_FADE_WALLET` | `runtime-fade.yaml` | `elephant_fade_signals` | The two books are complementary: the trend book rides durable macro direction; the fade book catches macro over-extensions. On separate wallets, they never conflict — a name in a macro uptrend can still print a short-term overbought fade. ## The macro universe (both books) A **curated macro whitelist** (`config.allowedAssets`), intersected each tick with the live instrument board so unavailable names are skipped: - **Indices** (XYZ): SP500, XYZ100, JP225, KR200, NIFTY, IBOV - **Metals** (XYZ): GOLD, SILVER, PLATINUM, COPPER - **Energy** (XYZ): BRENTOIL, CL, NATGAS - **FX** (XYZ): EUR, JPY, GBP, DXY - **Crypto macro**: BTC This is the asset complex none of the other funds focus on — true global macro. XYZ trades 24/7 on Hyperliquid, so the macro book runs through weekends. ## TREND book — ride the macro trend (both directions) ### Scoring (raw integer; `minScore` 5) | Component | Pts | Source | |---|---|---| | 4h trend backbone | +3 (sets direction: BULLISH→LONG / BEARISH→SHORT) / **skip** NEUTRAL | 4h candles | | 1h confirmation | +2 (confirms) / −1 (opposes) | 1h candles | | 24h momentum | +2 (≥`momThresholdPct` 1.5%) / +1 (≥0) — sign matches direction | instrument ctx | | RSI room | +1 (not overbought for a long / not oversold for a short) | 1h RSI | A NEUTRAL 4h structure = no clean macro trend → the book waits. ## FADE book — fade macro over-extensions (both directions) ### Scoring (raw integer; `minScore` 4) Picks the more-extreme side (oversold → LONG, overbought → SHORT): | Component | Pts | |---|---| | RSI extreme | +3 (≤20 / ≥80) / +2 (≤25 / ≥75) / +1 (≤`rsiOversold` 30 / ≥`rsiOverbought` 70) | | Stretch from 20-bar 1h MA | +2 (≥2×`stretchThresholdPct` 1.0%) / +1 (≥1×) | | 4h regime knife guard | +1 (fading **with** a higher-TF mean-reversion bias) / −2 (against a strong macro trend) | The −2 knife guard keeps it from fading a strong macro trend (don't short a ripping oil breakout, don't long a collapsing index). ## Execution & exit - both books: slots **3**, **strict 5x** clamp (indices/metals/FX cap low at venue), tick **300s** - **TREND** `margin_pct` **18%** — DSL **wide let-it-run** (macro trends are slow + persistent): phase1 max_loss **18%**, **all time-cuts OFF**, `hard_timeout` **7d**; phase2 `12%→0 / 25%→45 / 45%→65 / 75%→80 / 120%→90` - **FADE** `margin_pct` **15%** — DSL **tight fast-capture** (a reversion resolves fast): phase1 max_loss **8%**, `weak_peak_cut` **ON** (4h @ 1.5), `dead_weight_cut` **ON** (8h), `hard_timeout` **2d**; phase2 `4%→35 / 8%→55 / 15%→70 / 28%→85` ## XYZ handling Most of the macro complex is XYZ — candle fetches route with `dex="xyz"` (the producer keys off the `xyz:` prefix). XYZ trades 24/7 (no market-hours gating). The `main`/`xyz` clearinghouse sections are two VIEWS of ONE cross-margined wallet, so `get_positions()` takes `accountValue` ONCE via `max()` — never sums. ## Risk gates (`risk.guard_rails`) | Gate | trend | fade | |---|---|---| | daily_loss_limit_pct | 12 | 10 | | max_entries_per_day | 4 | 12 | | max_consecutive_losses | 4 | 5 | | cooldown_minutes | 90 | 45 | | drawdown_halt_pct | 22 | 18 | | per_asset_cooldown_minutes | 360 | 120 | | data_retention_hours | 168 | 96 | | drawdown_reset_on_day_rollover | true | true | Entries and exits both use `FEE_OPTIMIZED_LIMIT` (`ensure_execution_as_taker` true). ## Files | File | Purpose | |---|---| | `runtime-trend.yaml` | Trend-book runtime spec (wide let-it-run DSL) | | `runtime-fade.yaml` | Fade-book runtime spec (tight fast-capture DSL) | | `scripts/elephant-producer.py` | Book-aware producer daemon (one script, both books) | | `scripts/elephant_config.py` | Leg resolution + SenpiClient wrapper + helpers | | `config/elephant-trend-config.json` | Trend-book tunables (macro whitelist, momentum) | | `config/elephant-fade-config.json` | Fade-book tunables (RSI/stretch thresholds) | ## Operator install See [README.md](README.md) — the two books are two daemons (`ELEPHANT_LEG=trend` and `ELEPHANT_LEG=fade`) on two wallets (default 60/40 trend/fade funding), each with its own runtime YAML. ## 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)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.