# Win Rate Calculator

> Win Rate 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 win rate fraction and percentage from a list of trade PnLs, classifying wins vs total closed trades.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/win-rate
- 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/win-rate-calculator-42fcafd0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9Ed3mfpN5U5mV6Ep4Hvt8

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 win-rate-calculator-42fcafd0 -d '<json body>'
```

Example prompt: Calculate my win rate from these closed trade PnLs: [150, -80, 200, -30, 75, -50, 120, -90, 300, -10] — give me the fraction and percentage.

## When to prefer this

Choose this endpoint when you need a fast, cheap, deterministic win rate calculation from raw PnL data without any external dependencies, API keys, or live market data. Ideal for trading scorecard pipelines, expectancy calculations, and performance dashboards where you already have closed trade PnL arrays and need the win fraction and percent as structured JSON. Prefer this over general-purpose computation or custom code when you need a ready-made, pay-per-call microservice at $0.001 USDC.

## Known failure modes

- Empty or missing pnls array returns error or zero division result
- Non-numeric values in the pnls array cause validation failure
- Malformed JSON body results in 400 bad request
- Insufficient USDC balance or x402 payment failure prevents execution
- All-zero PnL values may be ambiguously classified as wins or losses depending on implementation

## How this service works

Win rate from wins and total trades. Call when scorecards and expectancy inputs from closed trade counts. Returns win rate fraction and percent 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 win rate as a decimal fraction (e.g. 0.65) and as a percentage (e.g. 65.0), computed from the count of positive PnLs divided by total trade count in the input array.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "n": 5,
  "wins": 3,
  "schema": "delx/util-win-rate/v1",
  "win_rate": 0.6
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/win-rate-calculator-42fcafd0/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)
