# QuantOracle Monte Carlo Portfolio Simulation

> QuantOracle Monte Carlo Portfolio Simulation is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.015/call, status unknown (last checked 2026-10-12).

Runs Monte Carlo simulations on a portfolio to project terminal value distributions, probability of ruin/loss/doubling, and sample price paths over a specified horizon.

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/simulate/montecarlo?utm_source=zero.xyz
- Price: $0.015/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-quantoracle-dev-b28261e7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YJ587ppvu0FdxOy053jKD

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-quantoracle-dev-b28261e7 -d '<json body>'
```

Example prompt: Run a 1,000-path Monte Carlo simulation on a $100,000 portfolio over 10 years assuming 8% annual return and 12% annual volatility, with $5,000 added each year and no withdrawals — I want to see the p5/p25/median/p75/p95 terminal values, the probability it doubles, and the probability of ruin.

## When to prefer this

Use this endpoint when you need probabilistic, path-based portfolio projections — especially for retirement planning, drawdown analysis, or risk assessment with contributions/withdrawals. Prefer this over deterministic compound growth calculators when tail risk, variance, and probability distributions matter. It is well-suited for scenarios where you want to understand downside risk (prob_ruin, prob_loss) alongside upside potential across thousands of simulated paths.

## Known failure modes

- Invalid parameter types (e.g. non-numeric annual_return) return 4xx validation error
- Negative initial_value or years may return an error or undefined behavior
- Very large simulation counts may time out or return degraded results
- Missing required fields such as years or initial_value return 400 bad request
- Network or server-side failure returns 5xx with no simulation data

## How this service works

Free, fast quant finance calculators powered by a deterministic, multi-chain API. Black-Scholes, options profit, Kelly, VaR, crypto liquidation, and more.

## Output

Returns terminal value percentiles (p5, p25, p75, p95), mean and median terminal value, CAGR, probability of loss, probability of ruin, probability of doubling, and an array of sample portfolio price paths — all computed across the requested number of simulations.

## Example request

```json
{
 "params": {
  "fast": 10,
  "slow": 20
 },
 "prices": [
  100,
  101.5,
  102.3,
  101.8,
  103.2,
  104.1,
  103.5,
  105,
  106.2,
  105.8,
  107.1,
  108.3,
  107.9,
  109.2,
  110.1,
  109.5,
  111,
  112.3,
  111.8,
  113.2,
  114.5,
  113.9,
  115.2,
  116.1,
  115.6,
  117,
  118.2,
  117.8,
  119.1,
  120
 ],
 "strategy": "sma_crossover",
 "slippage_bps": 5,
 "commission_bps": 5,
 "initial_capital": 10000
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "years": {
   "type": "number",
   "title": "Years",
   "default": 5,
   "maximum": 30,
   "description": "Simulation horizon in years (max 30)",
   "exclusiveMinimum": 0
  },
  "annual_vol": {
   "type": "number",
   "title": "Annual Vol",
   "default": 0.2,
   "description": "Annual volatility (e.g. 0.20 = 20%)"
  },
  "simulations": {
   "type": "integer",
   "title": "Simulations",
   "default": 1000,
   "maximum": 2500,
   "minimum": 100,
   "description": "Number of Monte Carlo paths (100-2500; default 1000 matches industry standard)"
  },
  "annual_return": {
   "type": "number",
   "title": "Annual Return",
   "default": 0.1,
   "description": "Expected annual return (e.g. 0.10 = 10%)"
  },
  "contributions": {
   "type": "number",
   "title": "Contributions",
   "default": 0,
   "description": "Periodic contribution amount (per year)"
  },
  "initial_value": {
   "type": "number",
   "title": "Initial Value",
   "default": 100000,
   "description": "Starting portfolio value"
  },
  "withdrawal_rate": {
   "type": "number",
   "title": "Withdrawal Rate",
   "default": 0,
   "description": "Annual withdrawal rate as fraction of portfolio"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-b28261e7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.quantoracle.dev](https://www.zero.xyz/host/api.quantoracle.dev/llms.txt)
