# Delx Commerce — ROI on Margin Calculator

> Delx Commerce — ROI on Margin 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 return on investment (ROI) as a ratio and percentage given a profit/loss (PnL) and margin (capital deployed).

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/roi-on-margin?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-roi-on-margin-calculator-d51e4dc3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_De5Hb5v2PC5KqKBNlB-Tm

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-roi-on-margin-calculator-d51e4dc3 -d '<json body>'
```

Example prompt: Calculate the ROI for a trade where I made a profit of 50 and had a margin of 500 — give me both the ratio and the percentage.

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call, no-signup computation of ROI from PnL and margin, particularly inside automated agent workflows where you want verifiable, on-chain micropayment billing via x402 and USDC on Base or Solana rather than a subscription or API key.

## Known failure modes

- Missing pnl or margin fields returns an error response
- margin of zero causes division-by-zero and likely a 400 or error JSON
- Non-integer values for pnl or margin may be rejected or truncated
- Network or payment failure (x402) if USDC payment is not properly submitted

## 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 the input pnl and margin echoed back, the ROI as a decimal ratio (e.g. 0.1), and the ROI as a percentage (e.g. 10), along with a schema identifier 'delx/util-roi-on-margin/v1'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "pnl": {
   "type": "integer",
   "description": "Input field: pnl."
  },
  "margin": {
   "type": "integer",
   "description": "Input field: margin."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "pnl": 50,
  "roi": 0.1,
  "margin": 500,
  "schema": "delx/util-roi-on-margin/v1",
  "roi_pct": 10
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-roi-on-margin-calculator-d51e4dc3/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)
