# Percent PnL Calculator

> Percent PnL 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).

Calculates percent profit/loss from entry and exit prices as deterministic local math, returning a JSON result for $0.001 USDC.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/pnl-pct
- 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/percent-pnl-calculator-556c4e30
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_COI-6au3JgctGBRuA3M9M

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 percent-pnl-calculator-556c4e30 -d '<json body>'
```

Example prompt: What's the percent profit/loss on a trade where I entered at 850 and exited at 920?

## When to prefer this

Use this endpoint when you need a fast, cheap, deterministic percent PnL calculation with no API keys, no market data feed, and no external dependencies — especially when ranking or filtering trades by return rather than absolute dollar value. Prefer this over building custom math in an agent when you want a reliable JSON result via x402 micropayment on Base.

## Known failure modes

- Missing entry or exit field returns a validation error
- Non-numeric or non-integer values may cause a 400 bad request
- Entry price of zero causes a division-by-zero error
- Payment not attached or insufficient USDC results in a 402 Payment Required response

## How this service works

Percent profit/loss from entry and exit prices. Call when ranking trades or alerts by return instead of absolute dollars. Returns pnl percent from entry→exit 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 percent profit or loss calculated from the entry and exit price inputs, with no external data sources or state involved.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "exit": {
   "type": "integer",
   "description": "Input field: exit."
  },
  "entry": {
   "type": "integer",
   "description": "Input field: entry."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "exit": 110,
  "entry": 100,
  "schema": "delx/util-pnl-pct/v1",
  "pnl_pct": 10
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/percent-pnl-calculator-556c4e30/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)
