# Neuroterminal Portfolio Risk Calculator

> Neuroterminal Portfolio Risk Calculator is a paid API for AI agents from api.neuroterminal.xyz, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Computes portfolio risk metrics (Sharpe, Sortino, VaR, CVaR, CAGR, Calmar, max drawdown, win rate) from a series of periodic returns

## Facts

- Endpoint: GET https://api.neuroterminal.xyz/v1/portfolio-risk
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/neuroterminal-portfolio-risk-calculator-0586406a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hLD5AG7O_6TccfIzujalT

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 neuroterminal-portfolio-risk-calculator-0586406a
```

Example prompt: Calculate the portfolio risk metrics for these monthly returns: 0.02, -0.01, 0.03, 0.015, -0.005 — use a risk-free rate of 0.04 and 12 periods per year, and give me the Sharpe ratio, Sortino ratio, VaR, CVaR, and max drawdown.

## When to prefer this

Choose this endpoint when you need a comprehensive suite of risk-adjusted performance metrics computed in a single call from raw return data, without managing API keys or subscriptions. It is ideal for agents processing investment strategies, backtests, or portfolio analytics where you need Sharpe, Sortino, Calmar, VaR, CVaR, CAGR, max drawdown, and win rate together. Prefer it over building these calculations locally when you want a reliable, pay-per-use computation with no infrastructure overhead.

## Known failure modes

- Missing required 'returns' query parameter returns an error
- Malformed or non-numeric return values cause computation failure
- Too few data points (e.g. only 1-2 returns) may produce unreliable or undefined ratios
- Invalid confidence level outside (0,1) range may error
- Payment failure via x402 protocol results in 402 response before computation

## How this service works

Paid HTTP endpoints for AI agents, settled in USDC on Base via the x402 protocol. No account, no API key — pay per call.

## Output

Returns a JSON object containing: VaR (value at risk), CVaR (conditional VaR), Sharpe ratio, Sortino ratio, Calmar ratio, CAGR (compound annual growth rate), max drawdown, win rate, and number of periods analyzed — all derived from the provided return series.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "returns"
     ],
     "properties": {
      "returns": {
       "type": "string",
       "description": "comma-separated decimal returns"
      },
      "confidence": {
       "type": "number"
      },
      "riskFreeRate": {
       "type": "number"
      },
      "periodsPerYear": {
       "type": "integer"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "var": -0.02,
  "cagr": 3.352706,
  "cvar": -0.02,
  "calmar": 167.6353,
  "sharpe": 4.9685,
  "periods": 5,
  "sortino": 6.5339,
  "winRate": 0.6,
  "maxDrawdown": -0.02
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/neuroterminal-portfolio-risk-calculator-0586406a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.neuroterminal.xyz](https://www.zero.xyz/host/api.neuroterminal.xyz/llms.txt)
