# Vextorium PnL Calculator

> Vextorium PnL Calculator is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-19).

Calculates gross PnL, net PnL, fees, funding costs, margin, and return on margin for long or short leveraged trading positions given entry/exit prices and position size.

## Facts

- Endpoint: POST https://api.vextorium.com/v1/pnl-calculator?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/vextorium-pnl-calculator-94cdec77
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OKSr24XzWRQVTt6bJcRrI

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 vextorium-pnl-calculator-94cdec77 -d '<json body>'
```

Example prompt: Calculate my PnL for a long position where I entered at 60000 and exited at 63000 with a notional size of 6000 USDC, using 5x leverage, a 0.1% fee each way, and held for 3 days with 0.01% daily funding.

## When to prefer this

Use this endpoint when you need a structured, multi-factor PnL breakdown for leveraged trading positions including funding costs, fees, and return on margin — especially for DeFi perpetuals or crypto derivatives. Prefer over manual calculation when all variables (leverage, funding rate, fees, holding period) need to be combined accurately. Best suited for post-trade analysis, pre-trade scenario planning, or building trading dashboards.

## Known failure modes

- Missing required fields (input, output, amount) returns validation error
- Invalid side enum value (not 'long' or 'short') causes rejection
- Negative or zero amount/input/output values may produce nonsensical results
- Leverage of zero or negative causes division errors
- Days value of zero with non-zero funding rate produces zero funding cost silently

## How this service works

232 pay-per-call data APIs for AI agents: official statistics and economy (ECB, Fed, Eurostat, World Bank, SEC, BOE, INE), crypto prices and sentiment, Spanish public data, compliance (sanctions, VAT, IBAN, LEI), science, weather, web and developer tools and local AI text tools. Pay in USDC via x402.

## Output

Returns a JSON object with: gross_pnl (pre-fee profit/loss), net_pnl (after fees and funding), fees (total fee cost), paid_funding (total funding paid over holding period), margin (capital at risk), input_notional (full position size), price_change_pct (percentage move from entry to exit), return_on_margin_pct (net PnL as % of margin), side (long/short), and breakeven_price_approx (approximate price needed to break even after costs).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "days": {
   "type": "number"
  },
  "side": {
   "enum": [
    "long",
    "short"
   ],
   "type": "string"
  },
  "input": {
   "type": "number"
  },
  "amount": {
   "type": "number"
  },
  "output": {
   "type": "number"
  },
  "fee_pct": {
   "type": "number"
  },
  "leverage": {
   "type": "number"
  },
  "funding_pct_day": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fees": 6.15,
  "side": "long",
  "margin": 1200,
  "net_pnl": 293.85,
  "gross_pnl": 300,
  "paid_funding": 0,
  "input_notional": 6000,
  "price_change_pct": 5,
  "return_on_margin_pct": 24.488,
  "breakeven_price_approx": 60060
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/vextorium-pnl-calculator-94cdec77/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
