# QuantOracle Risk/Portfolio Analytics

> QuantOracle Risk/Portfolio Analytics is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-14).

Computes comprehensive portfolio risk metrics including Sharpe, Sortino, VaR, CVaR, max drawdown, alpha/beta, and return distribution statistics from a return series

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/risk/portfolio
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-quantoracle-dev-1fe50ab6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rw9Bix_EOzvlL3r1k0f2X

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-1fe50ab6 -d '<json body>'
```

Example prompt: Can you run a full risk and performance analysis on this return series [0.001, -0.002, 0.003, 0.0015, -0.0008, 0.002, 0.0005, -0.001, 0.0012, 0.0018] using a risk-free rate of 5% and benchmark returns [0.0008, -0.0015, 0.0025, 0.001, -0.0005, 0.0018, 0.0003, -0.0012, 0.001, 0.0016] — I want Sharpe, Sortino, VaR, max drawdown, alpha, beta, and distribution stats?

## When to prefer this

Use this endpoint when you need a comprehensive, multi-metric portfolio risk and performance report in a single call — covering risk ratios, VaR/CVaR, benchmark attribution, and return distribution. Prefer this over individual metric calculators when you want Sharpe, Sortino, alpha/beta, and VaR computed together at low latency. Best suited for evaluating trading strategies, backtests, or portfolio slices where you already have a return series.

## Known failure modes

- Empty or too-short returns array causing insufficient data for statistical calculations
- Mismatched length between returns and benchmark_returns arrays
- Invalid risk_free_rate (e.g. negative or extremely large values)
- Non-numeric values in returns arrays causing parse errors
- Missing required returns field returning 400 or validation error

## How this service works

QuantOracle: risk/portfolio

## Output

Returns a JSON object containing: risk metrics (Sharpe, Sortino, Omega, Calmar ratios; VaR at 95/99; CVaR at 95; max drawdown), return statistics (volatility, best/worst return, total return, annualized return, win rate, profit factor), benchmark comparison (alpha, beta, tracking error, information ratio), and distribution properties (skewness, excess kurtosis, fat tails flag), plus computation metadata (n observations, latency in ms).

## Example request

```json
{
 "input": {
  "body": {
   "returns": [
    0.001,
    -0.002,
    0.003,
    0.0015,
    -0.0008,
    0.002,
    0.0005,
    -0.001,
    0.0012,
    0.0018,
    0.0022,
    -0.0005,
    0.0008,
    0.0011,
    0.0009
   ],
   "risk_free_rate": 0.05,
   "benchmark_returns": [
    0.0008,
    -0.0015,
    0.0025,
    0.001,
    -0.0005,
    0.0018,
    0.0003,
    -0.0012,
    0.001,
    0.0016,
    0.002,
    -0.0003,
    0.0006,
    0.0009,
    0.0007
   ]
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "returns": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "title": "Returns",
   "maxItems": 5000,
   "minItems": 5,
   "description": "Array of periodic portfolio returns (e.g. daily), max 5000"
  },
  "risk_free_rate": {
   "type": "number",
   "title": "Risk Free Rate",
   "default": 0.05,
   "description": "Annual risk-free rate for Sharpe/Sortino calculation"
  },
  "benchmark_returns": {
   "anyOf": [
    {
     "type": "array",
     "items": {
      "type": "number"
     },
     "maxItems": 5000
    },
    {
     "type": "null"
    }
   ],
   "title": "Benchmark Returns",
   "description": "Optional benchmark return series for relative metrics"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-1fe50ab6/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)
