# Agent402 UK – Sharpe Ratio Calculator

> Agent402 UK – Sharpe Ratio Calculator is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.002/call, status down (last checked 2026-09-15).

Computes the Sharpe ratio from a series of period returns and a risk-free rate, quantifying risk-adjusted investment performance.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/math/sharpe
- Price: $0.002/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-sharpe-ratio-calculator-9ae1332e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DKjCH8Rib6Zefs3hZIA-e

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 agent402-uk-sharpe-ratio-calculator-9ae1332e -d '<json body>'
```

Example prompt: Calculate the Sharpe ratio for this return series: [0.01, 0.02, -0.005, 0.015, 0.008, -0.003, 0.012], using a risk-free rate of 0.0004 per period.

## When to prefer this

Choose this endpoint when you need a quick, serverless computation of the Sharpe ratio without setting up a local financial library. It is ideal for agents performing portfolio analysis, strategy comparison, or backtesting pipelines where risk-adjusted performance needs to be quantified on demand. Prefer it over Black-Scholes (options pricing) or IRR endpoints when the task is specifically about return-series risk efficiency rather than option valuation or cash flow analysis.

## Known failure modes

- Empty or single-element returns array causes division-by-zero or undefined standard deviation
- Non-numeric values in the returns array cause validation errors
- Missing required 'returns' field results in a 400 bad request
- Extremely large or small float values may cause numerical instability
- Incorrect risk_free rate units (e.g. annual instead of per-period) will produce a misleading but non-error result

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a numeric Sharpe ratio representing the excess return per unit of risk (standard deviation) for the provided return series, adjusted by the given risk-free rate per period.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "returns": {
   "type": "array",
   "description": "Period returns"
  },
  "risk_free": {
   "type": "number",
   "description": "Risk-free per period"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mean": 0.00125,
  "stdev": 0.0152,
  "sharpe": 0.122
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-sharpe-ratio-calculator-9ae1332e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
