slimquant
Fetches closed daily OHLCV bars from Binance public data for crypto spot and spot-reference perpetual proxy analysis, filtering unclosed intraday bars.
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.
slimquant
Deterministic quantitative risk gate, purged walk-forward backtester, Brier calibration ledger, TradingView Pine Script v6 exporter, and native Model Context Protocol (stdio) server in a single Node.js >= 22.13.0 package.
Non-advisory quantitative research & risk-gate software.
slimquantnever connects to broker execution APIs or places live orders.
slimquant runs offline with deterministic market & risk checks by default (provider: "offline"), audits arbitrary trade proposals from external AI agents (audit_proposal / slimquant audit), or pairs a compact BM25-indexed VerifiedFactPack with a single opt-in LLM pass (SLIMQUANT_ALLOW_ONLINE_LLM=1 + gemini, openai, or anthropic) behind 20 fail-closed risk laws.
Requirements
Node.js
>= 22.13.0(uses built-innode:sqliteand unproxiednode:httpsrequests; zero Python or C++ native addons required).Note for MCP
stdioclients on Node 22:node:sqlitemay print anExperimentalWarningonstderr; Node 24+ runs without warnings, or setNODE_NO_WARNINGS=1in MCP client env on Node 22.Optional LLM API key (
GEMINI_API_KEY,OPENAI_API_KEY, orANTHROPIC_API_KEY) andSLIMQUANT_ALLOW_ONLINE_LLM=1only when explicitly enabling an online provider.
Related MCP server: MCP TradingView Server
Install & Quick Start (npm / npx)
Run directly via npx or install globally (zero API keys required, offline-safe by default):
npx -y slimquant --version
npx -y slimquant doctor
npx -y slimquant benchmark --json
# Or install globally:
npm install -g slimquant
slimquant doctorRun offline with the bundled sample OHLCV fixtures (examples/sample-bars.json array or examples/watchlist-bars.json symbol map; CLI defaults to read-only unless --persist is passed):
# If running from source (or use `slimquant` when installed globally):
node dist/src/cli.js analyze AAPL --bars-file ./examples/sample-bars.json --json
node dist/src/cli.js scan AAPL,MSFT --bars-file ./examples/watchlist-bars.json --json
node dist/src/cli.js score --resolve --bars-file ./examples/watchlist-bars.json --json
node dist/src/cli.js pine AAPL --bars-file ./examples/sample-bars.json --out aapl_audit.pineAudit an external agent's trade proposal against offline --bars-file (or live) market checks and all 20 deterministic laws:
node dist/src/cli.js audit AAPL --bars-file ./examples/sample-bars.json --decision long --entry 240 --stop 230 --target 260 --pwin 0.56 --thesis "Institutional accumulation above rising 50-day mean." --edge "Vol-adjusted breakout after compression." --other-side "Profit taking from prior quarter range sellers." --invalidation "Daily close below 230."Build & Run From Source
git clone https://github.com/apexhive-hq/slimquant.git
cd slimquant
pnpm install --ignore-scripts
pnpm run build:prod
node dist/src/cli.js doctor
node dist/src/cli.js --helpLive Market & Opt-In LLM Examples (Requires Outbound DNS/HTTPS)
# Live daily bars from Yahoo Finance / Binance public APIs:
node dist/src/cli.js analyze AAPL --capital 100000
node dist/src/cli.js analyze MES --capital 100000 --pine
node dist/src/cli.js scan AAPL,MSFT,BTCUSDT,MES
# Opt-in single-pass online LLM synthesis (requires explicit SLIMQUANT_ALLOW_ONLINE_LLM=1):
export SLIMQUANT_ALLOW_ONLINE_LLM=1
export GEMINI_API_KEY="..."
node dist/src/cli.js analyze AAPL --provider gemini --bars-file ./examples/sample-bars.jsonInspect ledger hash-chain integrity and Brier calibration (live or --bars-file):
node dist/src/cli.js score --resolve --bars-file ./examples/watchlist-bars.jsonArchitecture
Market Ingestion & SSRF Guard (
market-data.ts,ssrf.ts) Fetches closed daily OHLCV bars from Binance public data (CRYPTO_SPOTand spot-referenceCRYPTO_PERPproxy viabinance-vision-spot-ref, filtering unclosed intraday UTC bars viacloseTime <= now) or Yahoo Finance (EQUITY,FUTURES,FX_METAL, applying split/dividendadjcloseadjustment and excluding active intraday bars viacurrentTradingPeriod) behind DNS-verified IP-pinned HTTPS validation and bounded stream reads.Purged & Embargoed Walk-Forward Backtester (
walkforward.ts) Evaluatestrend_sma_20_50,breakout_donchian_20, andmean_reversion_rsi14strictly observing bari - 1close before entering at bariopen, simulating ATR stops, 2.0R profit targets, fees, and slippage across a continuous out-of-sample segment separated from in-sample selection byembargoBars >= max(50, lookbackBars, holdBars). Ranks baseline strategies strictly by in-sample performance (zero OOS selection bias) and annualizes Sharpe using observed OOS trading frequency.Macro Calendar (
macro.ts) Tracks 2026–2027 Federal Reserve FOMC (14:00 ET), BLS CPI (08:30 ET), and BLS NFP (08:30 ET) windows with US/EU DST mismatch detection, CME futures maintenance flags, and post-2027 schedule expiry notice.Compact FactPack & BM25 Retrieval (
evidence.ts,redactor.ts) Indexes regime snapshots, OOS metrics, macro notices, and research notes in pure TypeScript BM25 with regex secret redaction, assembling a SHA-256-fingerprintedVerifiedFactPack.Single-Pass Proposer & External Audit (
adversarial.ts,engine.ts) Supports deterministic offline proposals, single-passzod-validated external LLM synthesis, or direct external trade proposal injection viaauditProposal.20 Deterministic Risk Laws (
laws.ts) Recomputes entry/stop/targets (target1primary,target23R reference), contractpointValuemultipliers, whole-contract rounding for futures, Quarter-Kelly sizing, Brier shrinkage, liquidity limits (note: micro futuresMES/MNQ/MGC/MCLscale upstream parent-contractfeedPointValueADV, which acts as a coarse reference ceiling above small/mid account leverage caps), gap-tail survival, and hard vetoes before emittingGO,GO SMALLER, orNO-GO.SQLite & Hash-Chained Audit Ledger (
ledger.ts) Commits verdicts atomically inside cross-process locked SQLite transactions alongside an append-only SHA-256 hash-chainedverdicts_ledger.jsonl, requiring limit entry touch before resolvingtarget1/stop collisions conservatively as losses (-1R), modeling conditional limit orders gapping past stop before fill as invalidated (EXPIRED: setup_invalidated_before_fill), expiring unfilled setups after 30 days on fresh feeds, and path-containing MCP storage (SLIMQUANT_DATA_DIR/~/.slimquant).
20 Deterministic Risk Laws
# | Law | Effect |
1 | Emergency Kill Switch ( | Hard veto ( |
2 | Non-Advisory Compliance Firewall (across thesis, edge, counterparty, invalidation, risks) | Hard veto ( |
3 | Data Freshness Ceiling ( | Hard veto on stale or incomplete OHLCV feeds |
4 | Embargo Integrity ( | Hard veto if anti-leakage gap violated |
5 | Out-of-Sample Trade Sample Floor ( | Halves size ( |
6 | OOS Profit Factor, Sharpe & Decay Guard | Hard veto ( |
7 | Rolling 24h UTC Loss Circuit Breaker ( | Hard veto ( |
8 | Directional Proposal Check ( | Hard veto on flat / missing direction |
9 | Thesis & Explicit Invalidation Level | Hard veto if thesis or invalidation missing |
10 | Concise Edge Explanation ( | Hard veto if missing or verbose |
11 | Adverse Selection Counterparty Check | Hard veto if missing or asymmetric |
12 | Baseline Deterministic Signal Alignment | Hard veto in autonomous mode when opposing active baseline signal; |
13 | Max Entry Distance From Close ( | Hard veto if entry gaps beyond threshold |
14 | Anti-Chase Proximity ( | Hard veto if chasing beyond 1 ATR |
15 | Minimum Volatility Stop Floor ( | Hard veto if stop sits inside market noise |
16 | Minimum Reward-to-Risk Gate ( | Hard veto below minimum R:R threshold |
17 | Calibrated Positive Expected Value After Humility Margin | Hard veto if calibrated EV |
18 | Macro Event Horizon ( | Halves size ( |
19 | Quarter-Kelly + Contract | Caps size ( |
20 | 2-ATR Overnight Gap-Tail Survival + Whole-Contract Rounding (Futures) | Reduces size ( |
MCP Server Integration
Start over stdio (CLI and MCP share one default ledger under SLIMQUANT_DATA_DIR or ~/.slimquant; paid LLM providers are disabled by default — set SLIMQUANT_ALLOW_ONLINE_LLM=1 explicitly to enable online LLMs):
node dist/src/cli.js serveExample MCP client configuration:
{
"mcpServers": {
"slimquant": {
"command": "node",
"args": ["/path/to/slimquant/dist/src/cli.js", "serve"]
}
}
}Exposed MCP tools:
analyze_asset(supports optionalbarsarray)audit_proposal(supports optionalbarsarray)scan_watchlist(supports optionalbarssymbol map{ "SYM": [bars] })export_pine(supports optionalbarsarray)ledger_score(supports optionalbarssymbol map onresolveOpen: true, returnsfetchErrorsandok)
Non-advisory quantitative research software. Outputs are analytical diagnostics, not personalized financial advice.
Security & Contact:
apexhive.hq@proton.me· SeeSECURITY.md&CHANGELOG.mdLicense: MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
> TradingMCP puts a market analyst inside your AI assistant. Paste one URL into Claude, ChatGPT, Cursor, VS Code or any MCP client and ask in plain language: screen for breakouts, run a multi-timeframe analysis, backtest a strategy with walk-forward validation, scan for smart-money and volume signals, or get a one-prompt morning market brief. In clients that support MCP Apps, price charts and the Markets panel are drawn right in the chat. > 40+ tools covering crypto (real-time), stocks, ETFs, FX, futures and commodities across major global exchanges. > Hosted, nothing to install: Pro $9/month (2,500 tool calls) or Pro+ $29/month (10,000). Paid upfront with a 14-day money-back guarantee; your API key arrives right after checkout. > Built on the open-source tradingview-mcp core (MIT, ~5k GitHub stars): self-host it free, or use the hosted version with zero ops. > For research and education, not financial advice. Not affiliated with TradingView
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Create and manage trading strategies, bots, webhooks and signals from any MCP client.
JW3.ai remote MCP server for market reads and confirm-gated trading execution.
Related MCP Servers
- AlicenseBqualityCmaintenanceA local-first MCP server providing market data, deterministic technical analysis, chart rendering, and optional TradingView Supercharts browser workflows via stdio and a loopback REST API.383MIT
- AlicenseAqualityDmaintenanceEnables MCP clients to retrieve TradingView market data, including historical OHLCV candles, quotes, technical indicators, and screener results over stdio or SSE.4MIT
- AlicenseCqualityCmaintenanceEnables an MCP client to drive a local Chrome, Chromium, or Edge browser session to read and modify TradingView charts — saved layouts, alerts, Pine scripts, Strategy Tester reports, OHLCV and quote data, watchlists, drawings, replay, plus local research and paper-trading simulation — through 185 tools with a read-only mode and configurable mutation controls. Changes are gated on exact browser targets and layout IDs, and the server runs as a dependency-free local stdio or authenticated loopback HTTP process.18086MIT
- AlicenseNot gradedqualityCmaintenanceExposes market data, public strategies, backtesting, subscriptions, and AI generation capabilities as MCP tools that AI clients such as Claude Desktop, Cursor, and Cline can call. It runs locally over stdio or remotely over Streamable HTTP, with anonymous, API-key, or OAuth access.Apache 2.0