# Delx Commerce — Execution Quality vs TWAP Calculator

> Delx Commerce — Execution Quality vs TWAP 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-02).

Computes slippage in basis points by comparing an average fill price against a TWAP benchmark for a given trade side.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/exec-quality-vs-twap?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-execution-quality-vs-twap-calculator-c8a3afd2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6gqP3A5dB3xpxDb4E7Phx

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

Example prompt: I just filled a buy order at an average price of 102.50 and the TWAP benchmark was 102.00 — how many basis points of slippage did I get?

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call computation of execution quality measured in basis points against a TWAP benchmark, without building your own formula. It is ideal for AI trading agents that need verifiable, schema-stamped slippage metrics per trade at near-zero cost ($0.001 USDC). Prefer it over rolling your own math when you need an auditable, schema-versioned result suitable for logging or downstream compliance reporting.

## Known failure modes

- Missing required fields (side, twap, avg_fill) return a 400-level error
- Invalid side value (not 'buy' or 'sell') causes a validation error
- Non-numeric twap or avg_fill values cause a schema validation failure
- Payment not included or insufficient USDC causes a 402 Payment Required response
- Network or infrastructure timeout returns a 5xx error

## 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 trade side, the schema identifier (delx/util-exec-quality-vs-twap/v1), and the computed slippage expressed in basis points (e.g. slippage_bps: 50). Positive values indicate adverse slippage; the sign convention follows standard market microstructure convention for the given side.

## 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/delx-commerce-execution-quality-vs-twap-calculator-c8a3afd2/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)
