# QuantOracle Risk/Drawdown Calculator

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

Computes maximum drawdown, current drawdown, and underwater percentage from an equity curve

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/risk/drawdown
- Price: $0.005/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-5f8f912e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b3y_T5GhN_iuhnJvq59CM

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-5f8f912e -d '<json body>'
```

Example prompt: Calculate the max drawdown and underwater percentage for this equity curve: [10000, 10500, 10200, 9800, 9500, 9900, 10300, 10800] — I want to know the worst peak-to-trough loss and how much of the time it was below its high-water mark.

## When to prefer this

Use this endpoint when you need fast, precise drawdown metrics for a portfolio or strategy equity curve — particularly when you need both the maximum historical drawdown and the current drawdown simultaneously. Prefer over manual computation when you also need the underwater percentage (fraction of time spent below high-water mark). Ideal for backtesting pipelines, risk dashboards, or real-time strategy monitoring.

## Known failure modes

- Empty or single-element equity curve returns error — needs at least two data points
- Non-numeric values in equity curve array cause validation failure
- Negative equity values may produce unexpected results
- Very large arrays may increase latency beyond typical ~15ms
- Malformed JSON body returns 400-level error

## How this service works

QuantOracle: risk/drawdown

## Output

Returns maximum drawdown as a decimal (e.g. -0.0952) and as a percentage (e.g. -9.52%), current drawdown from the last peak, the percentage of time the portfolio was underwater (e.g. 62.5%), and computation time in milliseconds.

## Example request

```json
{
 "input": {
  "body": {
   "equity_curve": [
    10000,
    10500,
    10200,
    9800,
    9500,
    9900,
    10300,
    10800
   ]
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "equity_curve": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "title": "Equity Curve",
   "minItems": 3,
   "description": "Array of portfolio equity values over time"
  }
 }
}
```

## More

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