# Absolute PnL Calculator

> Absolute 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).

Computes the absolute profit or loss in quote currency units from a closed trade given entry price, exit price, and position size.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/pnl-abs
- 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/absolute-pnl-calculator-9b097889
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dc1I-O7pt-GepYLanH3GK

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 absolute-pnl-calculator-9b097889 -d '<json body>'
```

Example prompt: Calculate the absolute PnL for a trade I entered at 42000, exited at 45500, with a position size of 10 units.

## When to prefer this

Choose this endpoint when you need a fast, deterministic, server-side computation of absolute trade PnL without connecting to a broker API, live market feed, or maintaining local math logic. Ideal for paper trading systems, backtesting pipelines, trade journaling agents, and fill reconciliation where you already have entry, exit, and size values and just need the quote-unit result.

## Known failure modes

- Missing required fields (entry, exit, or size) result in a validation error
- Non-integer or malformed numeric inputs may cause a 400 bad request
- Payment failure via x402 protocol prevents the call from being processed
- Division or overflow edge cases with extreme numeric values may return an error

## How this service works

Absolute profit/loss from entry, exit, and position size. Call when marking closed trades or paper fills without a broker API. Returns absolute pnl in quote units 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 absolute PnL value expressed in quote currency units, computed locally from entry price, exit price, and position size — no live market data or external dependencies involved.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "pnl": 20,
  "exit": 110,
  "size": 2,
  "entry": 100,
  "schema": "delx/util-pnl-abs/v1"
 }
}
```

## More

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