# DeFi Shield MEV Optimal Route Finder

> DeFi Shield MEV Optimal Route Finder is a paid API for AI agents from defi-shield-hazel.vercel.app, paid per call via x402, $0.5/call, status unknown (last checked 2026-09-14).

Finds the optimal trading route across DEXs to minimize price impact and MEV (Miner Extractable Value) exposure for a given swap

## Facts

- Endpoint: POST https://defi-shield-hazel.vercel.app/api/mev/optimal-route
- Price: $0.5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-shield-hazel-vercel-app-55eb1005
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OA4ZJBr96TCpoktoP4bBT

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 defi-shield-hazel-vercel-app-55eb1005 -d '<json body>'
```

Example prompt: Find me the optimal trading route to swap 5 ETH for USDC across DEXs — I want to minimize price impact and protect against MEV sandwich attacks as much as possible.

## When to prefer this

Use this endpoint when an AI agent or user needs to execute a DeFi token swap and wants to minimize both price impact from large trades and MEV exposure (front-running, sandwich attacks). Particularly valuable for trades above a few hundred dollars where routing quality meaningfully affects execution price. Prefer over generic DEX aggregators when MEV protection is an explicit concern.

## Known failure modes

- Invalid or unsupported token address — endpoint returns error indicating unrecognized token
- Trade size too large for available liquidity — returns warning about insufficient pool depth
- Network congestion causing stale route data — may return outdated pricing information
- Unsupported token pair with no viable DEX path — returns no-route-found error
- Payment of 0.5 USDC not processed — returns 402 payment required

## Output

Returns the optimal DEX routing path for the requested swap, including recommended sequence of exchanges, estimated price impact percentage, MEV exposure risk score, and any suggested execution strategies to minimize front-running or sandwich attack risk.

## Example request

```json
{
 "chain": "base",
 "tokenOut": "0x4200000000000000000000000000000000000006",
 "amount_usd": 100,
 "token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
 "slippageTolerance": 0.5
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "properties": {
      "chain": {
       "type": "string",
       "description": "Chain (default: base)"
      },
      "amount_usd": {
       "type": "number",
       "description": "Trade amount in USD"
      },
      "token_address": {
       "type": "string",
       "description": "Token address"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-shield-hazel-vercel-app-55eb1005/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-shield-hazel.vercel.app](https://www.zero.xyz/host/defi-shield-hazel.vercel.app/llms.txt)
