# Profit Factor Calculator

> Profit Factor Calculator 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 profit factor (gross wins divided by gross losses) from a list of PnL values using local deterministic math.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/profit-factor
- 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/profit-factor-calculator-4ed5ce2d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EyVXVRETPUxt8GtnYlNHv

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 profit-factor-calculator-4ed5ce2d -d '<json body>'
```

Example prompt: Can you calculate the profit factor for my strategy tape? Here are the PnL values: [120, -45, 85, -30, 200, -60, 95, -20].

## When to prefer this

Use this endpoint when you need a fast, cheap, deterministic profit factor calculation from a list of PnL values with no API keys, no external market data, and no side effects — ideal as a quality gate before promoting a strategy to production. Prefer this over general-purpose computation when you want a single-purpose, auditable ratio with a known $0.001 cost per call.

## Known failure modes

- Empty or missing pnls array — cannot compute ratio with no data
- All losses and no wins (gross wins = 0) — profit factor is undefined or zero, may return null or error
- All wins and no losses (gross losses = 0) — profit factor is infinite, may return null or special value
- Malformed input (non-numeric values in array) — validation error returned
- Payment failure via x402 — request rejected before computation

## How this service works

Profit factor = gross wins / gross losses. Call when quality filters on strategy tapes before promotion. Returns profit factor 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 computed profit factor (gross wins divided by gross losses), calculated purely from the supplied PnL array using local math — no external data sources involved.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "pnls": {
   "type": "array",
   "description": "Input field: pnls."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": "delx/util-profit-factor/v1",
  "infinite": false,
  "gross_win": 20,
  "gross_loss": 7,
  "profit_factor": 2.857142857142857
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/profit-factor-calculator-4ed5ce2d/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)
