# Margin Required Calculator

> Margin Required Calculator 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).

Computes the margin required for a given notional amount at a specified leverage, using pure local math with no exchange API calls.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/margin-required
- 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/margin-required-calculator-f0c10f4e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5v77PBTIJoz36Es1lGf1k

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 margin-required-calculator-f0c10f4e -d '<json body>'
```

Example prompt: What margin is required for a notional of 50000 at 20x leverage? I need to do a pre-trade check before placing the order.

## When to prefer this

Use this endpoint when you need a fast, deterministic, offline margin calculation — especially in pre-trade checks within automated trading pipelines where you cannot or do not want to call a live exchange API. Ideal for bots, risk systems, and backtesting workflows that need margin math without external dependencies or API keys.

## Known failure modes

- Missing or zero leverage value causing division-by-zero or validation error
- Non-integer or negative notional/leverage inputs rejected with a 400-level error
- Payment failure via x402 resulting in request not being processed
- Extremely large notional values may exceed integer bounds

## How this service works

Margin required for a notional at a given leverage. Call when pre-trade margin checks without exchange APIs. Returns margin required 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

A deterministic JSON response containing the margin required (in currency units matching the notional) computed as notional divided by leverage, with no dependency on live market feeds, exchange APIs, or external state.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "leverage": {
   "type": "integer",
   "description": "Input field: leverage."
  },
  "notional": {
   "type": "integer",
   "description": "Input field: notional."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "margin": 1000,
  "schema": "delx/util-margin-required/v1",
  "leverage": 5,
  "notional": 5000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/margin-required-calculator-f0c10f4e/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)
