# Slippage Percent Calculator

> Slippage Percent 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).

Calculates the slippage percent between an expected mid price and an actual fill/impact price for pre- and post-trade quality checks.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/slippage-pct
- 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/slippage-percent-calculator-45060cab
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KO8QSKuGq6SYYmxOdPr8v

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 slippage-percent-calculator-45060cab -d '<json body>'
```

Example prompt: Calculate the slippage percent for a trade where the mid price was 1500 and the fill price came in at 1503.75.

## When to prefer this

Use this endpoint when you need a lightweight, deterministic, no-dependency slippage percent calculation for post-trade quality checks or pre-trade impact budgeting. It requires no API keys, market data feeds, or RPC connections — making it ideal for sandboxed agents, audit pipelines, or strategy backtests that need reproducible slippage math at minimal cost ($0.001 USDC per call).

## Known failure modes

- Missing or invalid 'mid' field (zero or null mid would cause division by zero)
- Non-numeric values for mid or fill causing computation failure
- Mid price of zero causing divide-by-zero error
- Malformed JSON request body returning a 400 error
- Payment failure or insufficient USDC balance returning a 402 error

## How this service works

Slippage percent of expected mid versus fill/impact price. Call when post-trade quality checks and pre-trade impact budgets. Returns slippage percent vs mid 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 object containing the slippage percent computed as the difference between the fill/impact price and the mid price, expressed as a percentage of the mid price. No live market data, RPC calls, or external feeds are involved — the result is pure local arithmetic.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mid": {
   "type": "integer",
   "description": "Input field: mid."
  },
  "fill": {
   "type": "number",
   "description": "Input field: fill."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mid": 100,
  "fill": 100.3,
  "schema": "delx/util-slippage-pct/v1",
  "slippage_pct": 0.2999999999999972
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/slippage-percent-calculator-45060cab/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)
