# Execution Quality vs TWAP

> Execution Quality vs TWAP 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).

Compares an average fill price against a caller-supplied TWAP benchmark and returns the slippage in basis points

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/exec-quality-vs-twap
- 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/execution-quality-vs-twap-23198770
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xf2tjAhRFS88E9bsgTIqw

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 execution-quality-vs-twap-23198770 -d '<json body>'
```

Example prompt: I bought ETH with an average fill of 3452.10 and the TWAP benchmark was 3448.50 — can you compute the execution slippage in basis points versus TWAP?

## When to prefer this

Use this endpoint when you need a fast, deterministic, local computation of execution quality versus a caller-supplied TWAP — no market data feed or RPC connection needed. Prefer it for post-trade analytics workflows, algo audit logging, or any scenario where you already have the TWAP and average fill and simply need the bps differential calculated reliably and cheaply.

## Known failure modes

- Missing required fields (side, twap, avg_fill) return a validation error
- Invalid trade side string (not 'buy' or 'sell') may cause incorrect sign logic
- Zero or negative price values may produce nonsensical bps output
- Payment failure via x402 prevents the call from completing

## How this service works

Compare average fill to TWAP benchmark (bps). Call when post-trade quality vs a caller-supplied TWAP. Returns slippage_bps_vs_twap 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 slippage_bps_vs_twap — the signed basis-point difference between the average fill price and the caller-supplied TWAP benchmark, indicating how much better or worse the execution was relative to the benchmark.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "side": {
   "type": "string",
   "description": "Trade side: buy or sell"
  },
  "twap": {
   "type": "number",
   "description": "TWAP benchmark price"
  },
  "avg_fill": {
   "type": "number",
   "description": "Average fill price"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "side": "buy",
  "schema": "delx/util-exec-quality-vs-twap/v1",
  "slippage_bps": 50
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/execution-quality-vs-twap-23198770/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)
