# QuantOracle Sharpe Ratio Calculator

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

Computes the annualized Sharpe ratio from a series of returns, including confidence intervals, standard error, excess return, and volatility statistics.

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/stats/sharpe-ratio
- Price: $0.002/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-865b2e84
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_U_i2aSBJtEUtmjx0qEXKJ

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-865b2e84 -d '<json body>'
```

Example prompt: Calculate the Sharpe ratio for these daily returns [0.001, -0.002, 0.003, 0.0015, -0.0005, 0.002] using a 4% annual risk-free rate and an annualization factor of 252, and give me the 95% confidence interval too.

## When to prefer this

Choose this endpoint when you need a statistically rigorous Sharpe ratio with confidence intervals and standard error, not just a point estimate. Especially useful when evaluating whether a strategy's Sharpe ratio is statistically distinguishable from zero, or when comparing strategies with limited return histories. Pairs well with the probabilistic-sharpe endpoint on the same platform for deeper significance testing.

## Known failure modes

- Empty or single-element returns array causing division-by-zero in volatility calculation
- Non-numeric values in the returns array causing a 400 validation error
- Negative annualization factor causing nonsensical results
- Extremely short return series producing very wide confidence intervals that may be misleading
- Missing required fields returning a 422 unprocessable entity error

## How this service works

QuantOracle: stats/sharpe-ratio

## Output

Returns the Sharpe ratio (annualized), annualized return, annualized volatility, excess return, standard error of the Sharpe, 95% confidence interval bounds (lower and upper), and sample size — along with response latency in milliseconds.

## Example request

```json
{
 "returns": [
  0.01,
  -0.02,
  0.03,
  0.015,
  -0.005,
  0.02,
  0.008,
  -0.01,
  0.012,
  0.005,
  -0.003,
  0.018,
  0.007,
  -0.015,
  0.022,
  0.011,
  -0.008,
  0.014,
  0.009,
  -0.006,
  0.016,
  0.004,
  -0.012,
  0.019,
  0.006,
  -0.009,
  0.013,
  0.01,
  -0.007,
  0.017
 ]
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "returns": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "title": "Returns",
   "maxItems": 5000,
   "minItems": 5,
   "description": "Array of periodic returns (max 5000)"
  },
  "risk_free_rate": {
   "type": "number",
   "title": "Risk Free Rate",
   "default": 0.05,
   "description": "Annual risk-free rate"
  },
  "annualization_factor": {
   "type": "integer",
   "title": "Annualization Factor",
   "default": 252,
   "description": "Trading days per year"
  }
 }
}
```

## More

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