{
  "markdown": "<p align=\"center\">\n  <h1 align=\"center\">QuantOracle</h1>\n  <p align=\"center\"><strong>The quantitative computation API for autonomous financial agents</strong></p>\n  <p align=\"center\">63 deterministic, citation-verified calculators + 10 composite workflows. 1,000 free calls/day. Pay-per-call on Base or Solana.</p>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/quantoracle-mcp\"><img src=\"https://img.shields.io/npm/v/quantoracle-mcp?label=npm&color=cb3837\" alt=\"npm\"></a>\n  <a href=\"https://smithery.ai/server/QuantOracle/quantoracle\"><img src=\"https://smithery.ai/badge/QuantOracle/quantoracle\" alt=\"Smithery\"></a>\n  <a href=\"https://clawhub.ai\"><img src=\"https://img.shields.io/badge/ClawHub-quantoracle-blueviolet\" alt=\"ClawHub\"></a>\n  <a href=\"https://glama.ai/mcp/servers/QuantOracledev/quantoracle\"><img src=\"https://img.shields.io/badge/Glama-A%20%7C%20A%20%7C%20B-brightgreen\" alt=\"Glama\"></a>\n  <a href=\"https://www.npmjs.com/package/quantoracle-cli\"><img src=\"https://img.shields.io/npm/v/quantoracle-cli?label=cli&color=green\" alt=\"CLI\"></a>\n  <a href=\"https://x402.org/ecosystem\"><img src=\"https://img.shields.io/badge/x402-USDC%20on%20Base%20%2B%20Solana-0052FF\" alt=\"x402\"></a>\n  <a href=\"https://opensource.org/licenses/MIT\"><img src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"MIT License\"></a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://quantoracle.dev\">Calculators</a> &nbsp;|&nbsp;\n  <a href=\"#cli\">CLI</a> &nbsp;|&nbsp;\n  <a href=\"#mcp-server\">MCP Server</a> &nbsp;|&nbsp;\n  <a href=\"#x402-payments\">x402 Payments</a> &nbsp;|&nbsp;\n  <a href=\"#free-tier\">Free Tier</a> &nbsp;|&nbsp;\n  <a href=\"#full-endpoint-reference\">All Endpoints</a> &nbsp;|&nbsp;\n  <a href=\"#integrations\">Integrations</a>\n</p>\n\n---\n\n## Try it without writing code\n\n**12 free interactive calculators** backed by the same API are live at **[quantoracle.dev](https://quantoracle.dev)** — no signup, no API key:\n\n- [Black-Scholes Option Pricing](https://quantoracle.dev/black-scholes-calculator) — call/put price + full Greeks\n- [American Option (Binomial Tree)](https://quantoracle.dev/american-option-calculator) — early exercise + dividends\n- [Options Profit Calculator](https://quantoracle.dev/options-profit-calculator) — multi-leg payoff diagrams\n- [Implied Volatility](https://quantoracle.dev/implied-volatility-calculator) — Newton-Raphson IV solver\n- [Monte Carlo Simulation](https://quantoracle.dev/monte-carlo-simulation-calculator) — portfolio + retirement scenarios\n- [Kelly Criterion](https://quantoracle.dev/kelly-criterion-calculator) — full / half / quarter-Kelly sizing\n- [Position Size](https://quantoracle.dev/position-size-calculator) — fixed-fractional risk\n- [Value at Risk (VaR)](https://quantoracle.dev/value-at-risk-calculator) — parametric VaR + CVaR\n- [Sharpe Ratio](https://quantoracle.dev/sharpe-ratio-calculator) — with 95% confidence interval\n- [CAGR](https://quantoracle.dev/cagr-calculator) — compound annual growth rate + projections\n- [Crypto Liquidation Price](https://quantoracle.dev/crypto-liquidation-calculator) — long/short, any leverage\n- [Impermanent Loss](https://quantoracle.dev/impermanent-loss-calculator) — Uniswap v2 + v3\n\n---\n\n## Why QuantOracle?\n\n**Every financial agent needs math. QuantOracle is that math.**\n\n- **63 pure calculators** across options, derivatives, risk, portfolio, statistics, crypto/DeFi, FX/macro, and TVM\n- **10 composite workflows** that bundle 5-15 calculator calls (backtest strategies, rebalance planning, options strategy selection, hedging recommendations, full risk analysis, pairs signals, and more)\n- **Zero dependencies** for the 73 calculators + composites -- no market data, accounts, or third-party APIs; send numbers in, get numbers out\n- **QuantOracle Live (new)** -- a separate paid tier that *brings* the data: fresh crypto volatility (`/v1/live/volatility`) and perp funding rates (`/v1/live/funding-rates`). We fetch the live market data and run the math, so your agent doesn't have to. 20 free calls/IP/day to evaluate, then pay-per-call via x402.\n- **QuantOracle Watch (new)** -- 24/7 position monitoring: register a crypto perp position once and get HMAC-signed webhooks on funding-adjusted liquidation distance, funding flips, and vol-regime changes — re-checked every 60 seconds. Free 48h trial; $5 per position per 30 days via x402.\n- **Deterministic** -- the calculators always produce the same outputs for the same inputs, so agents can cache, verify, and chain calls\n- **Citation-verified** -- every formula tested against published textbook values (Hull, Wilmott, Bailey & Lopez de Prado)\n- **120 accuracy benchmarks** passing with analytical solutions\n- **Fast** -- sub-millisecond to 70ms compute time per call\n- **Free tier** -- 1,000 calls/IP/day, no API key, no signup, zero friction\n\nQuantOracle is designed to be called repeatedly. An agent running a backtest might call 10+ endpoints per iteration. That's the model -- be the calculator agents reach for every time they need quant math.\n\n### Why not just let the LLM do the math?\n\n| | QuantOracle | LLM in-context math |\n|---|---|---|\n| **Accuracy** | Exact (analytical formulas) | 70-85% on complex math |\n| **Determinism** | Same input = same output, always | Different every run |\n| **Speed** | <1ms per calculation | 2-10s per generation |\n| **Cost** | $0.002-0.015 per call | $0.01-0.10 per generation |\n| **Auditability** | Cacheable, reproducible, testable | Non-reproducible |\n| **10-Greek BS pricing** | 1 API call, $0.005 | ~500 tokens, frequently wrong on gamma/vanna |\n\n---\n\n## 📓 LangChain cookbook\n\nBuild a 25-line LangChain agent that answers concrete quant questions — *\"I'm long $100k of NVDA at $185, how should I hedge?\"* — with deterministic, reproducible math:\n\n[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/QuantOracledev/quantoracle/blob/main/integrations/langchain/cookbook/quantoracle_risk_analyst.ipynb) [`integrations/langchain/cookbook/quantoracle_risk_analyst.ipynb`](./integrations/langchain/cookbook/quantoracle_risk_analyst.ipynb)\n\n![QuantOracle × LangChain hedging composite](./integrations/langchain/cookbook/notebook_screenshot.png)\n\nRuns in 30 seconds, ~$0.001 in OpenAI tokens, free for QuantOracle's individual calculators. The hedging-recommend composite shown above is $0.04 in USDC via x402.\n\n## Add QuantOracle to Your Agent\n\nDrop this into your agent's system prompt:\n\n```\nYou have access to QuantOracle -- 63 deterministic financial calculators + 10 composite workflows at https://api.quantoracle.dev.\nUse QuantOracle for ALL financial math instead of computing in-context. It is faster, cheaper, and exact.\nSend POST requests with JSON. No API key needed (1,000 free calls/day).\n\nKey endpoints:\n- /v1/options/price -- Black-Scholes + 10 Greeks\n- /v1/risk/portfolio -- 22 risk metrics from a returns series\n- /v1/risk/kelly -- Kelly Criterion position sizing\n- /v1/indicators/technical -- 13 indicators (RSI, MACD, Bollinger, etc.)\n- /v1/simulate/montecarlo -- Monte Carlo simulation (up to 5,000 paths)\n- /v1/stats/hurst-exponent -- Mean-reversion detection\n- /v1/fixed-income/bond -- Bond pricing + duration + convexity\n\nPaid-only composites (recommended for common agent workflows):\n- /v1/backtest/strategy -- Run SMA/RSI/momentum/Bollinger backtest (Sharpe, drawdown, trades)\n- /v1/portfolio/rebalance-plan -- Generate trades to hit target weights with cost estimate\n- /v1/options/strategy-optimizer -- Rank options strategies given outlook + vol view\n- /v1/hedging/recommend -- Cheapest effective hedge for a position\n- /v1/risk/full-analysis, /v1/trade/evaluate, /v1/portfolio/health, /v1/pairs/signal, /v1/options/spread-scan, /v1/indicators/regime-classify\n\nFull endpoint list: https://api.quantoracle.dev/tools\nOpenAPI spec: https://api.quantoracle.dev/openapi.json\nx402 discovery: https://api.quantoracle.dev/.well-known/x402 (advertises Base and Solana USDC)\n```\n\n### Discovery URLs (for agent frameworks and crawlers)\n\n| Format | URL |\n|--------|-----|\n| **OpenAPI spec** | `https://api.quantoracle.dev/openapi.json` |\n| **Tool listing** | `https://api.quantoracle.dev/tools` |\n| **MCP endpoint** | `npx quantoracle-mcp` |\n| **AI Plugin** | `https://api.quantoracle.dev/.well-known/ai-plugin.json` |\n| **Server card** | `https://mcp.quantoracle.dev/.well-known/mcp/server-card.json` |\n| **Swagger docs** | `https://api.quantoracle.dev/docs` |\n\n---\n\n## Quick Start\n\n```bash\n# Call any endpoint -- no setup required\ncurl -X POST https://api.quantoracle.dev/v1/options/price \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"S\": 100, \"K\": 105, \"T\": 0.5, \"r\": 0.05, \"sigma\": 0.2, \"type\": \"call\"}'\n```\n\n```json\n{\n  \"price\": 4.5817,\n  \"intrinsic\": 0,\n  \"time_value\": 4.5817,\n  \"breakeven\": 109.5817,\n  \"prob_itm\": 0.4056,\n  \"greeks\": {\n    \"delta\": 0.4612,\n    \"gamma\": 0.0281,\n    \"theta\": -0.0211,\n    \"vega\": 0.2808,\n    \"rho\": 0.2077,\n    \"vanna\": 0.0047,\n    \"charm\": -0.0006,\n    \"volga\": 0.0327,\n    \"speed\": -0.0001\n  },\n  \"d1\": -0.0975,\n  \"d2\": -0.2389,\n  \"ms\": 12.4\n}\n```\n\n### Python\n\n```python\nimport requests\n\n# Black-Scholes pricing\nr = requests.post(\"https://api.quantoracle.dev/v1/options/price\", json={\n    \"S\": 100, \"K\": 105, \"T\": 0.5, \"r\": 0.05, \"sigma\": 0.2, \"type\": \"call\"\n})\nprint(r.json()[\"price\"])  # 4.5817\n\n# Portfolio risk metrics (22 metrics from a returns series)\nr = requests.post(\"https://api.quantoracle.dev/v1/risk/portfolio\", json={\n    \"returns\": [0.01, -0.005, 0.008, -0.003, 0.012, -0.001, 0.006, -0.009, 0.004, 0.002]\n})\nprint(r.json()[\"risk\"][\"sharpe\"])  # Annualized Sharpe\n\n# Kelly Criterion\nr = requests.post(\"https://api.quantoracle.dev/v1/risk/kelly\", json={\n    \"mode\": \"discrete\", \"win_rate\": 0.55, \"avg_win\": 1.5, \"avg_loss\": 1.0\n})\nprint(r.json()[\"half_kelly\"])  # Recommended bet fraction\n\n# Monte Carlo simulation\nr = requests.post(\"https://api.quantoracle.dev/v1/simulate/montecarlo\", json={\n    \"initial_value\": 100000, \"annual_return\": 0.08, \"annual_vol\": 0.15, \"years\": 10, \"simulations\": 1000\n})\nprint(r.json()[\"terminal\"][\"median\"])  # Median portfolio value at year 10\n```\n\n### TypeScript\n\n```typescript\nconst res = await fetch(\"https://api.quantoracle.dev/v1/options/price\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n  body: JSON.stringify({ S: 100, K: 105, T: 0.5, r: 0.05, sigma: 0.2, type: \"call\" })\n});\nconst { price, greeks } = await res.json();\nconst { delta, gamma, vega } = greeks;\n```\n\n---\n\n## CLI\n\nAll 63 calculators + 10 composites in your terminal. Zero dependencies.\n\n```bash\nnpm install -g quantoracle-cli\n```\n\nOr run without installing:\n\n```bash\nnpx quantoracle-cli bs --spot 185 --strike 190 --expiry 0.25 --vol 0.25\n```\n\n```\n  QuantOracle · Black-Scholes (call)\n  ────────────────────────────────────\n  Price           $8.02\n  Intrinsic       $0.00\n  Time Value      $8.02\n  Breakeven      $198.02\n  Prob ITM        43.0%\n\n  Greeks\n  ────────────────────────────────────\n  Delta            0.4797\n  Gamma            0.0172\n  Theta           -0.0615/day\n  Vega             0.3685\n  ────────────────────────────────────\n  ⏱ 0.05ms · api.quantoracle.dev\n```\n\n```bash\n# Kelly criterion\nqo kelly --win-rate 0.55 --avg-win 120 --avg-loss 100\n\n# Monte Carlo\nqo mc --value 80000 --return 0.10 --vol 0.18 --years 2\n\n# JSON output for scripting\nqo bs --spot 185 --strike 190 --expiry 0.25 --vol 0.25 --json | jq '.greeks.delta'\n\n# Data from file\nqo risk portfolio --returns @returns.txt\n\n# All commands\nqo help\n```\n\n---\n\n## Free Tier\n\n**1,000 free calls per IP per day. No signup. No API key. Just call the API.**\n\n| | Free | Paid (x402) |\n|---|---|---|\n| **Calls** | 1,000/day | Unlimited |\n| **Auth** | None | x402 micropayment header |\n| **Calculators** | All 63 | All 63 |\n| **Composite workflows** | None (paid-only) | All 10 |\n| **Live data tier** | 20 calls/day | Pay-per-call |\n| **Watch monitoring** | Free 48h trial (1 per IP / 30d) | $5 per position / 30 days |\n| **Rate headers** | Yes | Yes |\n\nEvery response includes rate limit headers so agents can self-manage:\n```\nX-RateLimit-Limit: 1000\nX-RateLimit-Remaining: 847\nX-RateLimit-Reset: 2025-01-15T00:00:00Z\n```\n\nCheck usage anytime:\n```bash\ncurl https://api.quantoracle.dev/usage\n```\n\nAfter 1,000 calls, the API returns `402 Payment Required` with an x402 payment header. Any x402-compatible agent automatically pays and continues:\n\n```\nHTTP/1.1 402 Payment Required\nPAYMENT-REQUIRED: <base64-encoded payment instructions>\n```\n\n| Tier | Price | Endpoints |\n|------|-------|-----------|\n| **Simple** | $0.002 | Z-score, APY/APR, Fibonacci, Bollinger, ATR, Taylor rule, inflation, real yield, PV, FV, NPV, CAGR, normal distribution, Sharpe ratio, liquidation price, put-call parity |\n| **Medium** | $0.005 | Black-Scholes, implied vol, Kelly, position sizing, drawdown, regime, crossover, bond amortization, carry trade, IRP, PPP, funding rate, slippage, vesting, rebalance, IRR, realized vol, PSR, transaction cost |\n| **Complex** | $0.008 | Portfolio risk, binomial tree, barrier/Asian/lookback options, credit spread, VaR, stress test, regression, cointegration, Hurst, distribution fit, risk parity |\n| **Heavy** | $0.015 | Monte Carlo, GARCH, portfolio optimization, option chain analysis, vol surface, yield curve, correlation matrix |\n| **Composite** | $0.015-0.10 | Backtest strategy, spread scan, rebalance plan, options strategy optimizer, hedging recommend, full risk analysis, trade evaluate, portfolio health, pairs signal, regime classify *(paid-only, no free tier)* |\n\n### Batch Endpoint\n\nRun up to 100 computations in a single HTTP request. One round trip instead of 100.\n\n```bash\ncurl -X POST https://api.quantoracle.dev/v1/batch \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"requests\": [\n      {\"endpoint\": \"options/price\", \"params\": {\"S\": 100, \"K\": 105, \"T\": 0.25, \"r\": 0.05, \"sigma\": 0.2}},\n      {\"endpoint\": \"stats/zscore\", \"params\": {\"series\": [10, 12, 14, 11, 13, 15]}},\n      {\"endpoint\": \"tvm/cagr\", \"params\": {\"start_value\": 100, \"end_value\": 150, \"years\": 3}}\n    ]\n  }'\n```\n\nReturns all results in one response with the total price:\n\n```json\n{\n  \"batch_size\": 3,\n  \"total_price_usdc\": 0.009,\n  \"results\": [\n    {\"endpoint\": \"options/price\", \"status\": 200, \"data\": {\"price\": 2.4779, \"greeks\": {\"delta\": 0.377, \"...\"}}},\n    {\"endpoint\": \"stats/zscore\", \"status\": 200, \"data\": {\"mean\": 12.5, \"std_dev\": 1.87, \"...\"}},\n    {\"endpoint\": \"tvm/cagr\", \"status\": 200, \"data\": {\"cagr\": 0.1447, \"doubling_time_years\": 5.13, \"...\"}}\n  ],\n  \"ms\": 42.13\n}\n```\n\n| | Free | Paid |\n|---|---|---|\n| **Batch calls** | 1 trial (ever) | Unlimited |\n| **Max per batch** | 100 | 100 |\n| **Price** | Free | Sum of individual endpoint prices |\n\nBatch pricing is the sum of the individual endpoint prices — no markup. You pay for the computations, the speed is free.\n\n---\n\n## QuantOracle Live — fresh market data + compute\n\nEvery endpoint above is pure math on inputs **you** supply — the 73 calculators have zero data dependencies, which is what makes them deterministic and cacheable. **QuantOracle Live** is the one tier that *brings the data*: you pass a ticker, the API fetches fresh market data and runs the math, so your agent never has to source or maintain a data feed.\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/live/volatility` | Realized volatility (7d/30d/90d) + regime for a crypto asset, from fresh daily candles | $0.01 |\n| `POST /v1/live/funding-rates` | Current perpetual funding rate + annualized carry for a crypto asset | $0.005 |\n\n```bash\ncurl -X POST https://api.quantoracle.dev/v1/live/volatility \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"asset\":\"BTC\"}'\n\n# → {\"asset\":\"BTC\",\"spot\":61728.7,\"realized_vol_7d\":0.4534,\n#    \"realized_vol_30d\":0.3108,\"realized_vol_90d\":0.3157,\"regime\":\"NORMAL\",\n#    \"as_of_age_seconds\":0,\"stale\":false,\"source\":\"kraken\", ...}\n```\n\n**Pricing:** the Live tier is **paid from the first call** — it is *not* part of the 1,000/day calculator free tier (the value is the fresh data + pipeline, which you can't replicate with a local library). You get **20 free calls per IP per day** to evaluate, then it settles per-call via x402 (USDC on Base or Solana). You pay for freshness, not arithmetic.\n\nResults are cached server-side (volatility ~5 min, funding ~1 min); if an upstream feed is briefly unavailable, the API serves the last good value flagged `stale: true`, with `as_of_age_seconds` telling you how fresh the answer is.\n\n## QuantOracle Watch — 24/7 position monitoring\n\nMost monitoring agents rebuild the same loop: poll `crypto/liquidation-price` + `risk/var-parametric` on a timer, all day. **Watch replaces the loop** — register a crypto perp position once and an isolated watcher re-evaluates it every ~60 seconds: funding-adjusted liquidation distance (warn/critical bands with hysteresis), funding-rate sign flips, hourly vol-regime changes, and expiry warnings. Alerts fire as HMAC-signed webhooks (`X-QO-Signature`, key = your monitor token) *and* are recorded server-side, so the trial needs zero infrastructure — just poll.\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/watch/trial` | Free 48-hour monitor — one per IP per 30 days | Free |\n| `POST /v1/watch/position` | Register a position for 30 days of monitoring | $5.00 |\n| `POST /v1/watch/extend` | +30 days (also upgrades a trial; body: `{monitor_id, token}`) | $5.00 |\n| `PATCH /v1/watch/{id}` | Update position params after you add margin / resize / move it | Free |\n| `GET /v1/watch/{id}` | Live status + alert history (token auth) | Free |\n| `DELETE /v1/watch/{id}` | Cancel | Free |\n\n```bash\ncurl -X POST https://api.quantoracle.dev/v1/watch/trial \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"asset\":\"BTC\",\"direction\":\"long\",\"entry_price\":62000,\n       \"position_size\":5000,\"collateral\":1000}'\n\n# → {\"monitor_id\":\"w_...\",\"token\":\"...\",\"tier\":\"trial\",\"status\":\"active\",\n#    \"liquidation_price\":49910,\"distance_pct\":19.5,\n#    \"status_url\":\"https://api.quantoracle.dev/v1/watch/w_...\", ...}\n```\n\nNo exchange keys, no custody, no execution — Watch reads public market data and sends webhooks, so the worst failure mode is a missed alert (the watcher heartbeat is published in [/health](https://api.quantoracle.dev/health) as `watcher_heartbeat_age_s`). Webhook targets are SSRF-guarded and deliveries retried. The economics: a DIY loop polling the same math once a minute past the free tier costs ~$7.20/day in per-call fees vs **$5 per 30 days**. Full walkthrough: [quantoracle.dev/writing/crypto-liquidation-alerts-for-agents](https://quantoracle.dev/writing/crypto-liquidation-alerts-for-agents).\n\n## x402 Payments\n\nQuantOracle uses the [x402 protocol](https://x402.org) for pay-per-call micropayments. When an agent exhausts its free tier (or calls a paid-only composite), the API returns a standard `402` response with payment instructions advertising **both Base and Solana**. x402-compatible agents (Coinbase AgentKit, AgentCash, OpenClaw, etc.) handle the rest automatically:\n\n1. Agent calls endpoint, gets `402` with `PAYMENT-REQUIRED` header listing accepted networks\n2. Agent signs a gasless USDC transfer authorization on Base (EIP-3009) or Solana\n3. Agent resends request with `PAYMENT-SIGNATURE` header\n4. Server verifies via CDP facilitator, serves the response, settles on-chain\n\n**No API keys. No subscriptions. No accounts. Just math and micropayments.**\n\n### Supported Networks\n\n| Network | Asset | Gas | Best for |\n|---------|-------|-----|----------|\n| **Base mainnet** (`eip155:8453`) | USDC (`0x8335...`) | ~$0.005/tx | EVM agents, Coinbase tooling, LangChain, Base ecosystem |\n| **Solana mainnet** (`solana:5eykt4...`) | USDC (`EPjFWdd5...`) | ~$0.0002/tx (CDP fee-payer) | Solana Agent Kit, Eliza, high-frequency bots |\n\n- **Settlement**: Via Coinbase Developer Platform facilitator (`api.cdp.coinbase.com/platform/v2/x402`)\n- **Base wallet**: `0xC94f5F33ae446a50Ce31157db81253BfddFE2af6`\n- **Solana wallet**: `9biztrXscReJ3Wi8EfkD2gL3WXzYUmzTEohD26Bxp39u`\n- **Discovery**: `https://api.quantoracle.dev/.well-known/x402` (returns both chains for every endpoint)\n\n### Test it with AgentCash\n\n```bash\nnpx agentcash@latest onboard\n# Fund the Base or Solana wallet shown, then:\nnpx agentcash fetch https://api.quantoracle.dev/v1/risk/full-analysis \\\n  -m POST --payment-network solana \\\n  --body '{\"returns\":[0.01,-0.02,0.03,0.005,-0.01,0.02,-0.015,0.025,0.01,-0.005,0.015]}'\n```\n\n---\n\n## MCP Server\n\nQuantOracle is available as a native MCP server with 80 tools (63 calculators + 11 composites + 2 live market-data endpoints + 3 QuantOracle Watch monitoring tools + batch). Works with Claude Desktop, Cursor, Windsurf, Smithery, and any MCP-compatible client.\n\n### Install via npm\n\n```bash\nnpx quantoracle-mcp\n```\n\n### Claude Desktop / Claude Code\n\nAdd as a connector in Settings, or add to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"quantoracle\": {\n      \"url\": \"https://mcp.quantoracle.dev/mcp\"\n    }\n  }\n}\n```\n\nOr run locally via npx:\n\n```json\n{\n  \"mcpServers\": {\n    \"quantoracle\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"quantoracle-mcp\"]\n    }\n  }\n}\n```\n\n### Remote MCP (Streamable HTTP)\n\nConnect directly to the hosted server — no install required:\n\n```\nhttps://mcp.quantoracle.dev/mcp\n```\n\n### Smithery\n\n```bash\nnpx @smithery/cli mcp add https://server.smithery.ai/QuantOracle/quantoracle\n```\n\n### OpenClaw / ClawHub\n\n```bash\nclawhub install quantoracle\n```\n\n---\n\n## Integrations\n\nQuantOracle is available across multiple agent ecosystems:\n\n| Platform | How to connect |\n|----------|---------------|\n| **Claude Desktop / Claude Code** | Connector URL: `https://mcp.quantoracle.dev/mcp` |\n| **Cursor / Windsurf** | MCP config: `npx quantoracle-mcp` |\n| **Smithery** | `npx @smithery/cli mcp add QuantOracle/quantoracle` |\n| **OpenClaw / ClawHub** | `clawhub install quantoracle` |\n| **CLI** | `npm install -g quantoracle-cli` or `npx quantoracle-cli` |\n| **Glama** | [glama.ai/mcp/servers/QuantOracledev/quantoracle](https://glama.ai/mcp/servers/QuantOracledev/quantoracle) |\n| **npm (MCP)** | `npx quantoracle-mcp` |\n| **x402 ecosystem** | [x402.org/ecosystem](https://x402.org/ecosystem) |\n| **ChatGPT GPT** | [QuantOracle GPT](https://chatgpt.com/g/g-69d9c28bddb481918e674e2f9d9f3e97-quantoracle) |\n| **LangChain** | `pip install langchain-quantoracle` |\n| **AgentCash** | `npx agentcash fetch https://api.quantoracle.dev/v1/...` |\n| **x402scan** | [Server page](https://www.x402scan.com/server/2c32a45a-f94b-4def-904c-8dbbac8dc042) — Base + Solana |\n| **REST API** | `https://api.quantoracle.dev/v1/...` |\n| **OpenAPI spec** | `https://api.quantoracle.dev/openapi.json` |\n| **Swagger UI** | `https://api.quantoracle.dev/docs` |\n\n### Tool Discovery\n\n```bash\n# List all tools (63 calculators + 10 composites) with paths and pricing\ncurl https://api.quantoracle.dev/tools\n\n# x402 discovery (advertises Base + Solana for every endpoint)\ncurl https://api.quantoracle.dev/.well-known/x402\n\n# Health check\ncurl https://api.quantoracle.dev/health\n\n# Usage check\ncurl https://api.quantoracle.dev/usage\n\n# MCP server card\ncurl https://mcp.quantoracle.dev/.well-known/mcp/server-card.json\n```\n\n---\n\n## Full Endpoint Reference\n\n### Options (4 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/options/price` | Black-Scholes pricing with 10 Greeks (delta through color) | $0.005 |\n| `POST /v1/options/implied-vol` | Newton-Raphson implied volatility solver | $0.005 |\n| `POST /v1/options/strategy` | Multi-leg options strategy P&L, breakevens, max profit/loss | $0.008 |\n| `POST /v1/options/payoff-diagram` | Multi-leg options payoff diagram data generation | $0.005 |\n\n### Derivatives (7 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/derivatives/binomial-tree` | CRR binomial tree pricing for American and European options | $0.008 |\n| `POST /v1/derivatives/barrier-option` | Barrier option pricing using analytical formulas | $0.008 |\n| `POST /v1/derivatives/asian-option` | Asian option pricing: geometric closed-form or arithmetic approximation | $0.008 |\n| `POST /v1/derivatives/lookback-option` | Lookback option pricing (floating/fixed strike, Goldman-Sosin-Gatto) | $0.008 |\n| `POST /v1/derivatives/option-chain-analysis` | Option chain analytics: skew, max pain, put-call ratios | $0.015 |\n| `POST /v1/derivatives/put-call-parity` | Put-call parity check and arbitrage detection | $0.002 |\n| `POST /v1/derivatives/volatility-surface` | Build implied volatility surface from market data | $0.015 |\n\n### Risk (8 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/risk/portfolio` | 22 risk metrics: Sharpe, Sortino, Calmar, Omega, VaR, CVaR, drawdown | $0.008 |\n| `POST /v1/risk/kelly` | Kelly Criterion: discrete (win/loss) or continuous (returns series) | $0.005 |\n| `POST /v1/risk/position-size` | Fixed fractional position sizing with risk/reward targets | $0.005 |\n| `POST /v1/risk/drawdown` | Drawdown decomposition with underwater curve | $0.005 |\n| `POST /v1/risk/correlation` | N x N correlation and covariance matrices from return series | $0.008 |\n| `POST /v1/risk/var-parametric` | Parametric Value-at-Risk and Conditional VaR | $0.008 |\n| `POST /v1/risk/stress-test` | Portfolio stress test across multiple scenarios | $0.008 |\n| `POST /v1/risk/transaction-cost` | Transaction cost model: commission + spread + Almgren market impact | $0.005 |\n\n### Indicators (6 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/indicators/technical` | 13 technical indicators (SMA, EMA, RSI, MACD, etc.) + composite signals | $0.005 |\n| `POST /v1/indicators/regime` | Trend + volatility regime + composite risk classification | $0.005 |\n| `POST /v1/indicators/crossover` | Golden/death cross detection with signal history | $0.005 |\n| `POST /v1/indicators/bollinger-bands` | Bollinger Bands with %B, bandwidth, and squeeze detection | $0.002 |\n| `POST /v1/indicators/fibonacci-retracement` | Fibonacci retracement and extension levels | $0.002 |\n| `POST /v1/indicators/atr` | Average True Range with normalized ATR and volatility regime | $0.002 |\n\n### Statistics (12 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/stats/linear-regression` | OLS linear regression with R-squared, t-stats, standard errors | $0.008 |\n| `POST /v1/stats/polynomial-regression` | Polynomial regression of degree n with goodness-of-fit metrics | $0.008 |\n| `POST /v1/stats/cointegration` | Engle-Granger cointegration test with hedge ratio and half-life | $0.008 |\n| `POST /v1/stats/hurst-exponent` | Hurst exponent via rescaled range (R/S) analysis | $0.008 |\n| `POST /v1/stats/garch-forecast` | GARCH(1,1) volatility forecast using maximum likelihood estimation | $0.015 |\n| `POST /v1/stats/zscore` | Rolling and static z-scores with extreme value detection | $0.002 |\n| `POST /v1/stats/distribution-fit` | Fit data to common distributions and rank by goodness of fit | $0.008 |\n| `POST /v1/stats/correlation-matrix` | Correlation and covariance matrices with eigenvalue decomposition | $0.015 |\n| `POST /v1/stats/realized-volatility` | Realized vol: close-to-close, Parkinson, Garman-Klass, Yang-Zhang | $0.005 |\n| `POST /v1/stats/normal-distribution` | Normal distribution: CDF, PDF, quantile, confidence intervals | $0.002 |\n| `POST /v1/stats/sharpe-ratio` | Standalone Sharpe ratio with Lo (2002) standard error and 95% CI | $0.002 |\n| `POST /v1/stats/probabilistic-sharpe` | Probabilistic Sharpe Ratio (Bailey & Lopez de Prado 2012) | $0.005 |\n\n### Portfolio (2 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/portfolio/optimize` | Portfolio optimization: max Sharpe, min vol, or risk parity | $0.015 |\n| `POST /v1/portfolio/risk-parity-weights` | Equal risk contribution portfolio weights (Spinu 2013) | $0.008 |\n\n### Fixed Income (4 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/fixed-income/bond` | Bond price, Macaulay/modified duration, convexity, DV01 | $0.008 |\n| `POST /v1/fixed-income/amortization` | Full amortization schedule with extra payment savings analysis | $0.005 |\n| `POST /v1/fi/yield-curve-interpolate` | Yield curve interpolation: linear, cubic spline, Nelson-Siegel | $0.015 |\n| `POST /v1/fi/credit-spread` | Credit spread and Z-spread from bond price vs risk-free curve | $0.008 |\n\n### Crypto / DeFi (7 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/crypto/impermanent-loss` | Impermanent loss calculator for Uniswap v2/v3 AMM positions | $0.005 |\n| `POST /v1/crypto/apy-apr-convert` | Convert between APY and APR with configurable compounding | $0.002 |\n| `POST /v1/crypto/liquidation-price` | Liquidation price calculator for leveraged positions | $0.002 |\n| `POST /v1/crypto/funding-rate` | Funding rate analysis with annualization and regime detection | $0.005 |\n| `POST /v1/crypto/dex-slippage` | DEX slippage estimator for constant-product AMM (x*y=k) | $0.005 |\n| `POST /v1/crypto/vesting-schedule` | Token vesting schedule with cliff, linear/graded unlock, TGE | $0.005 |\n| `POST /v1/crypto/rebalance-threshold` | Portfolio rebalance analyzer: drift detection and trade sizing | $0.005 |\n\n### Live Data (2 endpoints) — paid tier, fresh market data\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/live/volatility` | Live realized volatility (7d/30d/90d) + regime for a crypto asset | $0.01 |\n| `POST /v1/live/funding-rates` | Live perpetual funding rate + annualized carry for a crypto asset | $0.005 |\n\n*Paid from the first call (not part of the free tier); 20 free calls/IP/day. See [QuantOracle Live](#quantoracle-live--fresh-market-data--compute).*\n\n### Watch — position monitoring (6 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/watch/trial` | Free 48-hour trial monitor (one per IP per 30 days) | Free |\n| `POST /v1/watch/position` | 24/7 monitoring of a perp position for 30 days | $5.00 |\n| `POST /v1/watch/extend` | Extend or upgrade a monitor by 30 days | $5.00 |\n| `PATCH /v1/watch/{id}` | Update position params (direction/entry/size/collateral/mmr/webhook/thresholds) | Free |\n| `GET /v1/watch/{id}` | Live status + alert history (token auth) | Free |\n| `DELETE /v1/watch/{id}` | Cancel a monitor | Free |\n\n*Priced per monitor, not per call. See [QuantOracle Watch](#quantoracle-watch--247-position-monitoring).*\n\n### FX / Macro (7 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/fx/interest-rate-parity` | Interest rate parity calculator with arbitrage detection | $0.005 |\n| `POST /v1/fx/purchasing-power-parity` | Purchasing power parity fair value estimation | $0.005 |\n| `POST /v1/fx/forward-rate` | Bootstrap forward rates from a spot yield curve | $0.005 |\n| `POST /v1/fx/carry-trade` | Currency carry trade P&L decomposition | $0.005 |\n| `POST /v1/macro/inflation-adjusted` | Nominal to real returns using Fisher equation | $0.002 |\n| `POST /v1/macro/taylor-rule` | Taylor Rule interest rate prescription | $0.002 |\n| `POST /v1/macro/real-yield` | Real yield and breakeven inflation from nominal yields | $0.002 |\n\n### Time Value of Money (5 endpoints)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/tvm/present-value` | Present value of a future lump sum and/or annuity stream | $0.002 |\n| `POST /v1/tvm/future-value` | Future value of a present lump sum and/or annuity stream | $0.002 |\n| `POST /v1/tvm/irr` | Internal rate of return via Newton-Raphson | $0.005 |\n| `POST /v1/tvm/npv` | Net present value with profitability index and payback period | $0.002 |\n| `POST /v1/tvm/cagr` | Compound annual growth rate with forward projections | $0.002 |\n\n### Simulation (1 endpoint)\n\n| Endpoint | Description | Price |\n|----------|-------------|-------|\n| `POST /v1/simulate/montecarlo` | GBM Monte Carlo with contributions/withdrawals, up to 5000 paths | $0.015 |\n\n### Composite Endpoints (paid-only)\n\nHigher-level endpoints that combine multiple calculations into a single call. Same math as the individual endpoints -- just packaged for common agent workflows. No free tier.\n\n| Endpoint | Description | Replaces | Price |\n|----------|-------------|----------|-------|\n| `POST /v1/backtest/strategy` | Run SMA crossover, RSI mean reversion, momentum, or Bollinger breakout backtest | 10+ indicator + risk calls | $0.10 |\n| `POST /v1/options/spread-scan` | Scan and rank vertical spreads by risk/reward | 8-16 options/price calls | $0.05 |\n| `POST /v1/portfolio/rebalance-plan` | Generate trade list to hit target weights with cost estimate | portfolio/optimize + transaction-cost | $0.05 |\n| `POST /v1/options/strategy-optimizer` | Rank top options strategies given outlook + volatility view | options/strategy + payoff-diagram | $0.08 |\n| `POST /v1/hedging/recommend` | Rank cheapest effective hedges (protective put, collar, futures, partial) | options/price + Greeks | $0.04 |\n| `POST /v1/risk/full-analysis` | Complete risk tearsheet: Sharpe, Sortino, VaR, Kelly, drawdown, Hurst, CAGR | 7 individual calls | $0.04 |\n| `POST /v1/portfolio/health` | Portfolio health check: risk, correlation, rebalance, stress test | 6 individual calls | $0.04 |\n| `POST /v1/trade/evaluate` | Trade evaluation: sizing, risk/reward, Kelly, costs, regime, signals, verdict | 5 individual calls | $0.025 |\n| `POST /v1/pairs/signal` | Pairs trading signal: cointegration, Hurst, z-score, half-life, hedge ratio | 4 individual calls | $0.025 |\n| `POST /v1/indicators/regime-classify` | Trend, vol regime, RSI, direction, strategy suggestion | technical + regime + realized-vol | $0.015 |\n\n---\n\n## Example: Agent Backtest Workflow\n\nA typical agent backtest chains multiple QuantOracle calls per iteration:\n\n```\n1. /v1/indicators/technical    -- generate signals (SMA, RSI, MACD)\n2. /v1/risk/position-size      -- size the trade (fixed fractional)\n3. /v1/risk/transaction-cost   -- estimate execution costs\n4. /v1/options/price            -- price the hedge (Black-Scholes)\n5. /v1/risk/portfolio           -- compute running Sharpe, drawdown, VaR\n6. /v1/stats/probabilistic-sharpe -- is the Sharpe statistically significant?\n7. /v1/tvm/cagr                 -- compute CAGR of the equity curve\n```\n\nEach call is a pure calculator -- no state, no side effects, no API keys.\n\n### Strategy Optimizer (1,200+ calls)\n\n[`examples/strategy_optimizer.py`](examples/strategy_optimizer.py) is a full walk-forward parameter optimizer that demonstrates heavy API usage:\n\n| Phase | What it does | API calls |\n|-------|-------------|-----------|\n| **Parameter Sweep** | Test 180 lookback/rebalance/RSI combinations across 8 assets | ~1,080 |\n| **Deep Analysis** | 22 risk metrics + VaR + Kelly + Monte Carlo on top 3 configs | ~60-80 |\n| **Options Overlay** | Price covered calls across 6 assets x 4 expiries x 5 strikes | ~100-150 |\n| **Pairs Analysis** | Cointegration scan + Hurst exponent on 45 asset pairs | ~50-70 |\n\n```bash\npip install requests\npython examples/strategy_optimizer.py\n```\n\nA single run makes ~1,200-1,500 API calls. At paid rates that's ~$6-8 USDC. The same calculations done by an LLM in-context would cost $12-60 in tokens (Sonnet to Opus), take 4x longer, and get 15-30% of the complex math wrong.\n\n---\n\n## Self-Hosting\n\n```bash\n# Clone and run locally\ngit clone https://github.com/QuantOracledev/quantoracle.git\ncd quantoracle\npip install fastapi uvicorn\nuvicorn api.quantoracle:app --host 0.0.0.0 --port 8000\n\n# Docker\ndocker compose up -d\n\n# Docs at http://localhost:8000/docs\n```\n\n---\n\n## Accuracy\n\nEvery endpoint is tested against published analytical solutions:\n\n- **120 citation-backed benchmarks** (Hull, Wilmott, Bailey & Lopez de Prado, Goldman-Sosin-Gatto, Taylor, Fisher, Markowitz)\n- **65+ integration tests** covering all 63 calculators\n- Pure Python math -- no numpy/scipy, zero native dependencies\n- Deterministic: same inputs always produce the same outputs\n\nRun the verification suite yourself:\n```bash\npython tests/accuracy_benchmarks.py https://api.quantoracle.dev\n```\n\n---\n\n## Architecture\n\n```\nquantoracle/\n  api/quantoracle.py        -- FastAPI app, 63 calculators + 11 composites, pure Python math\n  worker/src/index.ts        -- Cloudflare Worker: rate limiting + x402 payments (Base + Solana)\n  mcp-server/src/index.ts    -- MCP server: 80 tools (incl. live data + Watch) over Streamable HTTP\n  cli/                       -- quantoracle-cli: all endpoints in the terminal (npm)\n  tests/\n    test_integration.py      -- 65 integration tests (all endpoints, live API)\n    accuracy_benchmarks.py   -- 120 citation-backed accuracy tests\n```\n\n**Stack**: FastAPI + Pydantic | Cloudflare Workers + KV | MCP (Streamable HTTP) | x402 + CDP Facilitator | USDC on Base and Solana\n\n---\n\n## License\n\n[MIT](LICENSE) -- use QuantOracle however you want.\n",
  "bytes": 37063,
  "sha": "ce397947e2f48ae14cd4e6555cf3c2c1f7f918d7cfabcba76d68d2bbc0d1f84f",
  "repo_slug": "quantoracledev/quantoracle",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_fel123_quantoracle_a9bd9af1/readme"
}