# Delx MEV Sandwich Upper Bound Calculator

> Delx MEV Sandwich Upper Bound 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-01).

Computes the upper-bound loss and price impact fraction a trade would suffer from a MEV sandwich attack given pool reserves and trade size

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/mev-sandwich-upper?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-mev-sandwich-upper-bound-calculator-11981dce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5MoQ6sZtrJzwhlKyVI6Sw

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-mev-sandwich-upper-bound-calculator-11981dce -d '<json body>'
```

Example prompt: I'm about to swap 1000 USDC on a pool with 500000 USDC reserve in and 450000 ETH reserve out — what's the worst-case loss I could take from a sandwich attack?

## When to prefer this

Use this endpoint when you need a fast, pay-per-call computation of the maximum value a sandwich attacker could extract from a specific AMM trade, without setting up any infrastructure. Prefer this over building custom AMM math when you want a verifiable, auditable result with exact pricing and no subscription.

## Known failure modes

- Missing required fields (amount_in, reserve_in, reserve_out) returns a validation error
- Non-positive reserve or trade values may produce undefined or infinite results
- Payment failure via x402 protocol results in 402 Payment Required response
- Extremely large or small floating point inputs may cause precision issues

## 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 with schema tag 'delx/util-mev-sandwich-upper/v1', the upper-bound notional loss the trade would suffer (loss_notional, in input asset units), and the fractional price impact (impact_fraction as a decimal between 0 and 1) that a sandwich attacker could extract.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "amount_in": {
   "type": "number",
   "description": "Trade size in input asset units"
  },
  "reserve_in": {
   "type": "number",
   "description": "Pool reserve of input asset"
  },
  "reserve_out": {
   "type": "number",
   "description": "Pool reserve of output asset"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": "delx/util-mev-sandwich-upper/v1",
  "loss_notional": 0.990099009900991,
  "impact_fraction": 0.00990099009900991
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-mev-sandwich-upper-bound-calculator-11981dce/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)
