# XRPL Data Desk – Risk Math

> XRPL Data Desk – Risk Math is a paid API for AI agents from data.azeronyx.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-31).

Computes quantitative risk metrics (VaR, Sharpe, position sizing, etc.) from a price or returns series, with optional stop/entry/equity inputs for trade-level risk management.

## Facts

- Endpoint: POST https://data.azeronyx.com/v1/risk-math?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/xrpl-data-desk-risk-math-d822fef4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RTcYnVVwGjrxC62lf_wka

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 xrpl-data-desk-risk-math-d822fef4 -d '<json body>'
```

Example prompt: Calculate my position size and key risk metrics for an XRP trade where my entry is $0.52, stop is $0.48, and account equity is $5000 — use 1.5% equity risk and a 95% VaR confidence level on this returns series: 0.01, -0.02, 0.03, -0.01, 0.005.

## When to prefer this

Choose this endpoint when you need server-side quantitative risk computation — especially position sizing from entry/stop/equity — without running local math. It is well-suited for AI agents that need audited, structured risk metrics on XRP or other crypto price/return series, paid per-call on the XRP Ledger. Prefer it over generic statistics libraries when you want a single audited API call that bundles VaR, Sharpe, volatility, drawdown, and position sizing together.

## Known failure modes

- Missing both 'prices' and 'returns' fields — computation cannot proceed without a data series
- Invalid numeric strings cause parsing errors
- Stop price equal to or above entry price results in undefined position sizing
- Too few data points for meaningful statistical calculation
- Payment not settled on XRPL — 402 response with payment instructions
- Confidence value outside (0,1) range causes VaR failure

## How this service works

Live XRP Ledger market data for AI agents, paid per call in XRP. Settled on the XRP Ledger itself; every endpoint independently audited. Information, not advice.

## Output

Returns a JSON object containing computed risk metrics such as Value-at-Risk (VaR), Sharpe ratio, annualized volatility, maximum drawdown, recommended position size (units to trade), and dollar risk — derived from the supplied price or return series and optional position-sizing parameters.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "stop": {
   "type": "string",
   "description": "stop price, for position sizing"
  },
  "entry": {
   "type": "string",
   "description": "entry price, for position sizing"
  },
  "equity": {
   "type": "string",
   "description": "account size, for position sizing"
  },
  "prices": {
   "type": "string",
   "description": "comma-separated prices (instead of returns)"
  },
  "returns": {
   "type": "string",
   "description": "comma-separated returns (0.01 = +1%); or prices instead"
  },
  "risk_pct": {
   "type": "string",
   "description": "percent of equity risked at the stop (default 1)"
  },
  "risk_free": {
   "type": "string",
   "description": "annual risk-free rate (default 0)"
  },
  "confidence": {
   "type": "string",
   "description": "for value-at-risk (default 0.95)"
  },
  "periods_per_year": {
   "type": "string",
   "description": "periods in a year (default 365; 8760 hourly)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "description": "See https://data.azeronyx.com/v1/sample?path=/v1/risk-math for a recent example",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/xrpl-data-desk-risk-math-d822fef4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from data.azeronyx.com](https://www.zero.xyz/host/data.azeronyx.com/llms.txt)
