# PnL After Fees

> PnL After Fees 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 net profit and loss on a sized position after applying entry and exit fee rates, returning a deterministic JSON result.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/pnl-with-fees
- 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/pnl-after-fees-50b84183
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_j55T3RQXSax_SEXllgj9k

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 pnl-after-fees-50b84183 -d '<json body>'
```

Example prompt: What's my net PnL after fees on a 500-unit position entered at 42000 and exited at 43500, with a fee rate of 0.001 on both sides?

## When to prefer this

Use this endpoint when you need a quick, deterministic, fee-adjusted PnL calculation for a known position size, entry, and exit price without needing live market data, external APIs, or complex infrastructure. Ideal for trading bots, algo strategy validation, and journaling tools where accurate fee accounting matters to edge evaluation.

## Known failure modes

- Missing required fields (entry, exit, size, fee_rate) result in an error response
- Non-numeric or invalid values for price or size fields may cause computation failure
- Negative size or fee_rate values may produce unexpected results
- Payment failure (insufficient USDC) blocks the request before computation

## How this service works

Net PnL after entry and exit fee rates on a sized position. Call when realistic fill accounting when fees matter to edge. Returns net pnl after fees 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 net PnL value after subtracting entry and exit fees from the gross profit or loss on the sized position. The result is advisory only and computed using local math with no live market data.

## 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."
  },
  "fee_rate": {
   "type": "number",
   "description": "Input field: fee rate."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fees": 0.21,
  "schema": "delx/util-pnl-with-fees/v1",
  "net_pnl": 9.79,
  "gross_pnl": 10
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pnl-after-fees-50b84183/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)
