# Delx Commerce PnL with Fees Calculator

> Delx Commerce PnL with Fees Calculator is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Computes gross PnL, trading fees, and net PnL for a trade given entry price, exit price, position size, and fee rate

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/pnl-with-fees?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-pnl-with-fees-calculator-4c07bf30
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xJ6FRa7Ee_LSKxUytg-1b

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 delx-commerce-pnl-with-fees-calculator-4c07bf30 -d '<json body>'
```

Example prompt: Calculate my net PnL for a trade where I entered at 42000, exited at 42500, with a position size of 2, and a fee rate of 0.001 — break out the gross profit, fees paid, and what I actually take home.

## When to prefer this

Choose this endpoint when an agent needs a fast, verifiable, pay-per-use PnL computation that breaks down gross profit, fees, and net profit in a single call — particularly useful for trading bots, portfolio trackers, or automated trade journals that process many positions without needing a persistent subscription or account. Prefer over manual calculation when auditability and exact fee accounting are required.

## Known failure modes

- Missing required fields (entry, exit, size, fee_rate) result in a validation error
- Non-integer entry/exit/size values may cause type errors
- Negative or zero size values may yield unexpected results
- Payment failure via x402 will prevent result delivery
- Extremely high fee rates may produce negative net PnL edge cases

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object containing gross_pnl (profit before fees), fees (total fees charged based on size and fee rate), and net_pnl (gross_pnl minus fees), along with a schema identifier string for the response format.

## 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/delx-commerce-pnl-with-fees-calculator-4c07bf30/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
