Regime Strategy Skill CMC
Nikoble1926/cmc-regime-skill
Classificação de regime cripto com estratégia verificável e backtest provável
Ver no GitHubMCP server que classifica o regime de mercado cripto em tempo real (TREND_UP/TREND_DOWN/CHOP/RISK_OFF) e gera estratégias determinísticas e backtestáveis. Mantém um registro público verificável em hash chain SHA256 de todas as chamadas ao vivo, garantindo transparência auditável.
Instalação
npx convez-ai Nikoble1926/cmc-regime-skill1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Análise de regime de mercado cripto em tempo real
- Geração de sinais de trading determinísticos e backtestáveis
- Auditoria de desempenho de estratégia via hash chain público
- Integração com agentes CMC para decisões de portfolio
Veredito

Ferramenta financeira robusta com rigor científico raro: backtests auditáveis (60/40 IS/OOS) em 4+ anos de dados, redução de drawdown vs buy-and-hold em todos os símbolos testados. Implementação transparente com live endpoint e hash chain verificável — diferencial sólido para traders e construtores de agentes quantitativos.
README
A tradução para o português deste README ainda está na fila.
Provable Regime Strategy Skill — BNB Hack Track 2
A CoinMarketCap Skill that classifies the live crypto regime (TREND_UP / TREND_DOWN / CHOP / RISK_OFF) and emits a deterministic, backtestable strategy spec — and is the only Track-2 submission with a tamper-evident live track record. Every live call is appended to a public sha256 hash chain anyone can verify with one stdlib script.
Demo video (40s): https://youtu.be/Rv2QU8T4Ipg
Live endpoint: https://regime.nsgoods.org · Skill manifest: skill/SKILL.md · Submission write-up: SUBMISSION.md
Results
| Symbol | Strategy IS | Strategy OOS | Buy & Hold (full) | B&H (OOS) |
|---|---|---|---|---|
| BTCUSDT | +50.5% Sharpe 0.77 MDD −19% | +7.2% MDD −21% | +31.1% MDD −67% | +1.9% MDD −51% |
| ETHUSDT | −4.7% MDD −38% | −13.7% MDD −39% | −57.8% MDD −74% | −36.8% MDD −68% |
| BNBUSDT | +5.2% MDD −24% | −2.7% MDD −7% | −11.0% MDD −56% | −36.6% MDD −40% |
4.4 yr daily 2022-01-01 → 2026-06-06 (BNB: 1 yr — CoinGecko free-tier cap), balanced profile, 0.1% fee per side, no leverage. IS/OOS 60/40 split; F&G threshold tuned ONCE on IS, frozen for OOS.
Strategy halves max drawdown vs buy-and-hold on every symbol. BTC additionally beats B&H on absolute return AND OOS. ETH/BNB were in a bear regime over the window — strategy preserves 30–45 pp more of capital.
Equity curves (strategy IS / strategy OOS / buy-and-hold)

Architecture
+----------------------------+
| CMC MCP @ mcp.coinmarketcap.com/mcp
| (12 tools, dual-auth: API key or x402 USDC)
+-------------+--------------+
| 5 tool calls
v
+-----------------------------------------+
| engine/live.py |
| parse_cmc_number() (strings -> floats)|
| regime_from_cmc(coin_id) |
| -> RegimeInputs |
+-----------+----------------+-------------+
| |
v v
+---------------------+ +-------------------------+
| engine/regime.py | | engine/rules.py |
| classify() with | | generate_spec() |
| RegimeConfig (gates) | per-regime templates |
+----------+----------+ +--------+----------------+
| |
+-----------+-----------+
v
+----------------------------+
| strategy spec (spec_version 1.0)
+-------------+--------------+
|
+-----------------+-----------------+
v v
+-------------------+ +-------------------+
| x402_endpoint/ | | provable/ |
| app.py @ :4022 | | logger.py hourly |
| /regime $0.01 | | -> chain.jsonl |
| /provable/head | | -> git commit |
| /health free | | -> git push |
+---------+---------+ +---------+---------+
| |
v v
https://regime.nsgoods.org verify.py (pure stdlib)
(nginx -> 127.0.0.1:4022) CHAIN OK (N entries) head=…
Verify it yourself in 60 seconds
git clone https://github.com/Nikoble1926/cmc-regime-skill
cd cmc-regime-skill
python3 -m venv venv && . venv/bin/activate
pip install -r requirements.txt
# 1. Engine + parser invariants (50 tests)
pytest -q
# 2. Public hash chain — pure stdlib, no project imports
python3 provable/verify.py
# -> CHAIN OK (N entries) head=...
# 3. Reproduce the backtest from scratch
python -m backtest.harness BTCUSDT ETHUSDT BNBUSDT
ls backtest/results/ # *.json + *.png
# 4. Run the live engine yourself (needs a free CMC Pro key in .env)
echo "CMC_API_KEY=<your-cmc-pro-key>" > .env
python -m engine.live 1 # BTC
Repository layout
| Path | Purpose |
|---|---|
skill/SKILL.md | The Track-2 deliverable. Single self-contained skill manifest + workflow + threshold tables + spec templates. |
engine/ | Deterministic regime classifier, rule generator, spec schema (regime.py, rules.py, spec_schema.py), live CMC adapter (live.py). |
backtest/ | Multi-source OHLCV loader (Coinbase + Kraken + CoinGecko), indicators.py, F&G history, bar-by-bar harness.py. |
backtest/results/ | Per-symbol JSON (metrics + tuned config + trade log) and equity-curve PNGs. |
provable/ | Hash-chain logger + stdlib verifier. log/chain.jsonl is the public ledger. |
x402_endpoint/ | Standalone Flask app on 127.0.0.1:4022 (paywalled /regime, free /health and /provable/head). Directory is x402_endpoint/ not x402/ so it doesn't shadow the pip x402 library at import time. |
tests/ | 50 pytest cases covering regime branches, boundaries, rules, schema, and the CMC string parser. |
DATA_AUDIT.md | What the CMC Basic tier returns; the source-routing matrix (Coinbase / CoinGecko / Kraken / alternative.me). |
MCP_PROBE.md | Exact MCP tool output shapes with verbatim BTC samples. |
SKILL_FORMAT.md | Reverse-engineered CMC Skill submission format. |
BACKTEST_NOTES.md | Honest live↔backtest divergences — what's different and why. |
SUBMISSION.md | DoraHacks BUIDL description. |
The differentiator: a public, tamper-evident track record
Every hourly call appends {seq, ts_utc, coin, regime, spec_stance, fear_greed, funding_rate, inputs_digest, full_payload, prev} to provable/log/chain.jsonl with h = sha256(canonical_json(entry)). The previous head is folded in via prev, so any retroactive edit breaks every downstream hash. Each entry is then git-committed; each logger run pushes to GitHub, so every push becomes a third-party timestamp anchor (GitHub commit time + repo-level signing).
A judge can verify the full chain with no project dependencies:
$ python3 provable/verify.py
CHAIN OK (160+ entries) head=… # logged hourly since 2026-06-06, CI-verified on every push, growing through judging
Honest limitations
- Funding-rate and OI gates are LIVE-only. No free historical series → backtest disables them. The live skill is therefore strictly safer than the backtest measures (extra RISK_OFF gates fire only live). Full disclosure: BACKTEST_NOTES.md.
- CMC EMAs are 7/30/200 while engine slots are 20/50/200 — 1–2 bars of timing skew vs the backtest, never a different strategy.
- BNB has 365 days of free history; BTC/ETH have 4.4 yr.
- No execution. This is a strategy spec per Track-2 brief; nothing trades live.
Disclaimer
Educational signals from a deterministic multi-input regime classifier. Not financial advice. Markets can move against any regime call; use independent risk management.