# Spread Percent Calculator

> Spread 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-14).

Computes the bid-ask spread as a percentage of the mid-price for cross-asset liquidity comparison

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/spread-pct
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spread-percent-calculator-3d4a81ad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NJhVW41MOC8VxVNdaY9OL

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 spread-percent-calculator-3d4a81ad -d '<json body>'
```

Example prompt: What's the bid-ask spread as a percent of mid for a stock quoted at bid 99.80 and ask 100.20?

## When to prefer this

Use this endpoint when you need a fast, deterministic, local-math computation of spread percent with no external data dependencies — ideal for normalizing bid-ask spreads across assets at wildly different price levels (e.g. comparing a $1 asset to a $5000 asset). Prefer this over manual calculation when you need consistent, auditable results in a pipeline. It is not suitable for fetching live market quotes — caller must supply bid and ask values from their own data source.

## Known failure modes

- Missing bid or ask field returns a validation error
- Ask less than or equal to bid produces an invalid or zero/negative spread — may return an error or unexpected result
- Non-numeric input for bid or ask causes a schema validation failure
- Bid or ask of zero causes division-by-zero in mid-price calculation
- Payment failure or insufficient USDC balance blocks the request via x402 protocol

## How this service works

Bid–ask spread as percent of mid for cross-asset compare. Call when comparing liquidity across price levels and assets. Returns spread percent of 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

Returns a deterministic JSON object containing the bid-ask spread expressed as a percentage of the mid-price (calculated as (ask - bid) / mid * 100), enabling normalized liquidity comparison across assets at different price levels.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ask": {
   "type": "number",
   "description": "Input field: ask."
  },
  "bid": {
   "type": "number",
   "description": "Input field: bid."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ask": 100.5,
  "bid": 99.5,
  "mid": 100,
  "schema": "delx/util-spread-pct/v1",
  "spread_pct": 1
 }
}
```

## More

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