# Vextorium PnL Calculator (Leveraged Trades)

> Vextorium PnL Calculator (Leveraged Trades) 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-16).

Calculates gross and net profit/loss, return on margin, break-even price, and notional for a leveraged long or short trade after entry/exit fees and funding costs.

## Facts

- Endpoint: POST https://api.vextorium.com/calculadora-pnl-pago?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/vextorium-pnl-calculator-leveraged-trades-78629b7b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dmZLvPTBTjD2T5Hu36YG_

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-leveraged-trades-78629b7b -d '<json body>'
```

Example prompt: Calculate my net PnL for a long trade: I entered at 60000 and exited at 63000 with a position size of 0.1 BTC, 5x leverage, 0.1% commission each way, and held for 3 days with a 0.01% daily funding rate.

## When to prefer this

Use this endpoint when you need a precise, fee-aware PnL calculation for a leveraged long or short trade, including commission and funding cost deductions. Ideal for post-trade analysis, pre-trade scenario planning, or building trading dashboards. Prefer this over generic calculators when you need break-even price and return-on-margin alongside net profit in a single call.

## Known failure modes

- Missing required fields (entrada, salida, cantidad) returns a validation error
- Invalid enum value for 'lado' (must be 'long' or 'short') causes request failure
- Zero or negative leverage may produce calculation errors or division by zero
- Extremely large leverage values may produce unrealistic results without warning
- Negative funding or commission values may not be validated and could yield unexpected outputs

## How this service works

Trade result: gross and net profit or loss after entry/exit fees and funding, return on margin, price change, break-even price and notional. Long or short, with leverage.

## Output

Returns a JSON object with: trade side (long/short), margin used, gross PnL, net PnL, total commissions, funding paid, notional value at entry, price change percentage, approximate break-even price, and return on margin percentage.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "dias": {
   "type": "number"
  },
  "lado": {
   "enum": [
    "long",
    "short"
   ],
   "type": "string"
  },
  "salida": {
   "type": "number"
  },
  "entrada": {
   "type": "number"
  },
  "cantidad": {
   "type": "number"
  },
  "comision_pct": {
   "type": "number"
  },
  "apalancamiento": {
   "type": "number"
  },
  "funding_pct_dia": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lado": "long",
  "margen": 1200,
  "pnl_neto": 293.85,
  "pnl_bruto": 300,
  "comisiones": 6.15,
  "funding_pagado": 0,
  "nocional_entrada": 6000,
  "variacion_precio_pct": 5,
  "precio_equilibrio_aprox": 60060,
  "rentabilidad_sobre_margen_pct": 24.488
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/vextorium-pnl-calculator-leveraged-trades-78629b7b/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)
