# Pairs Hedge Ratio OLS

> Pairs Hedge Ratio OLS is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Computes the OLS (ordinary least squares) hedge ratio beta of y on x (no intercept) for sizing the short leg in a pairs trade.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/pairs-hedge-ratio
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pairs-hedge-ratio-ols-6bfa47a4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Wbob7ZGWShfj6zcCM3sRt

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 pairs-hedge-ratio-ols-6bfa47a4 -d '<json body>'
```

Example prompt: Calculate the OLS hedge ratio for my pairs trade — here's the x series (independent): [100, 102, 101, 103, 105] and the y series (dependent): [200, 204, 202, 206, 210]. I need the beta so I can size the short leg.

## When to prefer this

Use this endpoint when you need a fast, cheap, deterministic OLS hedge ratio computation for pairs trading and have no need for a live market feed or external data. Ideal for offline sizing calculations, backtesting pipelines, or any scenario where you already have the price series and need beta quickly. Prefer this over a general statistics library call when you need a paid, auditable, x402-compatible micro-transaction API in an agentic workflow on Base.

## Known failure modes

- Mismatched array lengths between x and y — endpoint may return an error or undefined behavior
- Empty or single-element arrays — insufficient data for regression
- Arrays containing NaN or non-numeric values — may cause computation failure
- All-zero x array — results in division by zero for beta
- Extremely large arrays may increase latency slightly but endpoint is designed for offline/batch use

## How this service works

OLS hedge ratio beta of y on x (no intercept). Call when sizing the short leg in a pairs trade offline. Returns beta and n as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.

## Output

Returns a deterministic JSON object containing the OLS beta (hedge ratio) computed from the y-on-x regression without an intercept, and n (the number of observations used in the calculation). No external data sources or market feeds are used — the result is a pure function of the input arrays.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "x": {
   "type": "array",
   "description": "Independent series for OLS hedge ratio"
  },
  "y": {
   "type": "array",
   "description": "Dependent series for OLS hedge ratio"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "n": 5,
  "beta": 1.98,
  "schema": "delx/util-pairs-hedge-ratio/v1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pairs-hedge-ratio-ols-6bfa47a4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
