Market Regime Oracle
Provides a strategy skill for the CoinMarketCap Agent Hub, enabling agents to fetch BTC market regime and risk posture via the MCP server.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
π Market Regime Oracle
A 5-signal β 5-state BTC market-regime classifier with posture mapping, backtested vs buy-and-hold.
Fuses momentum, sentiment, volatility, funding & flow into one explainable regime β and a documented risk posture per regime.
What It Does
Ask "What kind of BTC market is this, and how much risk should I take?"
The oracle answers with one of 5 regimes + a documented posture:
Regime | Target Exposure | Posture |
π’ | 100% | Uptrend β full exposure |
π‘ | 40% | Sideways β light exposure |
π΅ | 20% | Downtrend β defensive |
π΄ | 10% | Panic β max defensive |
π£ | 30% | Blow-off β take profit |
Built as an MCP Strategy Skill for the CoinMarketCap Agent Hub (BNB AI Trading β Track 2). Any MCP-compatible client (Claude Desktop, Cursor, CMC Agent Hub) calls get_market_regime to get a deterministic, no-look-ahead risk posture.
Related MCP server: PreReason-mcp
π Headline Result
In a down year for BTC (β37%), the regime strategy did β12.7% β halving drawdown (β24% vs β51%) and halving volatility (19% vs 43%), outperforming buy-and-hold by ~25 points while still going long in uptrends.
Metric | Regime Strategy | Buy & Hold |
Total return | β12.7% | β37.4% |
Max drawdown | β24.2% | β51.2% |
Annualized volatility | 19.3% | 43.1% |
Sharpe (rf 4%) | β0.82 | β0.97 |
Sortino | β1.01 | β1.32 |
Data: CoinGecko BTC daily (2025-06-19 β 2026-06-17, 364 days). Start $10,000. 10 bps/turnover cost.
πΌοΈ Visual Results
Equity Curve β Regime Strategy vs Buy & Hold
Drawdown β Strategy Stays Shallower
BTC Price with Regime Overlay
Regime Distribution & Target Exposure
ποΈ Architecture
CoinGecko (BTC OHLCV) alternative.me (Fear & Greed)
β β
ββββββββββββββββ¬ββββββββββββββββ
βΌ
βββββββββββββββββββββββ
β data/loader.py β aligned daily features
βββββββββββ¬ββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββ
β 5 independent signal modules β each β score in [-1, +1]
β momentum(0.30) fear_greed(0.25) β
β funding(0.15) flows(0.15) vol(0.15) β
ββββββββββββββββββββββββ¬ββββββββββββββββββββ
βΌ weighted fusion
composite score
βΌ priority rules
ββββββββββββββββββββββββββββββββββββββββββββ
β 5-state regime classifier β CAPITULATION > EUPHORIA >
β (deterministic, no look-ahead) β RISK_OFF > RISK_ON >
ββββββββββββββββββββββββ¬ββββββββββββββββββββ > RANGE_BOUND
βΌ
target exposure + action
βββββββββββββββββ΄ββββββββββββββββ
βΌ βΌ
vectorized backtest MCP tool: get_market_regime
(no look-ahead, w/ costs) (stdio, Agent Hub skill)π§© The 5 Signals
Signal | Source | Weight |
RSI / MACD momentum | CoinGecko price | 0.30 |
Fear & Greed Index | alternative.me | 0.25 |
Volatility regime | CoinGecko price | 0.15 |
Funding rate proxy | derived from price | 0.15 |
Exchange flow proxy | derived from volume | 0.15 |
Each signal outputs a normalized bullishness score in [-1, +1]. All 5 are independently unit-tested.
Transparency: Funding rate and exchange flows have no free public feed. We reconstruct them from price/volume data as clearly-labeled proxies. Drop in real feeds anytime β the fusion layer is signal-agnostic.
π Quick Start
git clone https://github.com/aggreyeric/bnb-market-regime-oracle.git
cd bnb-market-regime-oracle
pip install -r requirements.txt
# Run full pipeline: fetch β classify β backtest β charts
python main.py
# Run tests (offline, no network needed)
PYTHONPATH=src python -m pytest tests/
# Run as MCP server
PYTHONPATH=src python -m market_regime_oracle.mcp_server
# Live MCP demo (30 seconds)
./scripts/demo.shDocker
docker compose up --build run # full pipeline
docker compose up --build server # MCP serverπ Project Layout
market_regime_oracle/
βββ src/market_regime_oracle/
β βββ data/ # CoinGecko + alternative.me loaders
β βββ signals/ # 5 signal modules (unit-tested)
β βββ classifier/ # fusion β regime mapping
β βββ backtest/ # vectorized engine, no look-ahead
β βββ viz/ # equity/drawdown/regime charts
β βββ mcp_server.py # MCP stdio server
βββ tests/ # 24/24 passing
βββ results/ # CSVs, metrics.json, PNG charts
βββ scripts/demo.sh # live MCP round-trip
βββ Dockerfile
βββ docker-compose.yml
βββ README.mdπ Data Sources
CoinGecko v3 free API β BTC daily close + volume
alternative.me β Fear & Greed Index
Both public, both free. No API keys required.
π License
MIT Β© 2026
π€ AI Assistants
β See CLAUDE.md for AI coding assistant context.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Crypto regime classifier for trading agents. 100% bounded regime accuracy. 50 free calls/day.
Crypto market intelligence: regime detection, funding rates, liquidations, prices, signals.
Live BTC/ETH risk state: risk policy, market structure and trading playbooks. Keyless free tier.
Live macro data for AI agents: regime, conditions, liquidity, with input provenance. No signup.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAI-powered crypto signal intelligence for 20 assets (BTC, ETH, SOL, etc). 6 scoring dimensions: whale activity, technical analysis, derivatives flow, narrative strength, sentiment, market structure. Market regime detection (TRENDING/RANGING), portfolio optimization, and accuracy tracking. 9 read-only MCP tools. Free via MCP, $0.001 USDC via x402 on Base for REST API.3MIT
- AlicenseAqualityAmaintenancePreReason is a financial data MCP server and REST API for AI agents. Ask what a listed company reported, where Treasury yields stand or what the Federal Reserve decided, and one call returns a briefing reasoned in advance, across asset classes and regions, with every figure dated and every source named. Agents start at https://www.prereason.com/agents.md8220 npm8MIT
- AlicenseAqualityCmaintenanceDeterministic risk governance for crypto trading agents. 5-level policy engine with position sizing, leverage limits, and trade blocking. One tool: get_risk_policy. Supports BTC and ETH.472 npm1MIT
- AlicenseNot gradedqualityCmaintenanceDaily Bitcoin/crypto cycle scoring, on-chain indicators, strategy insights, on-demand backtests. Bearer + x402 pay-per-callMIT