# Base DEX Best Execution Router

> Base DEX Best Execution Router is a paid API for AI agents from x402.donnyautomation.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Returns the best buy and sell venues, cross-exchange spread in bps, fee-adjusted arbitrage spread, and optimal trade size for a token pair across BaseSwap, SushiSwap, and Uniswap v3 on Base L2.

## Facts

- Endpoint: GET https://x402.donnyautomation.com/base/route
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-dex-best-execution-router-1cec2576
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JEWImEFQbJGSG4ANCPExw

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 base-dex-best-execution-router-1cec2576
```

Example prompt: Which DEX on Base gives me the best price to buy WETH with USDC right now — compare BaseSwap, SushiSwap, and Uniswap v3 and tell me the spread and optimal trade size for the WETH/USDC pair.

## When to prefer this

Use this endpoint when you need real-time best-execution routing specifically on Base L2 across BaseSwap, SushiSwap, and Uniswap v3. Prefer it over generic price feeds when you need venue-level comparison, spread data in bps, and an optimal trade size in a single call. Choose it over single-DEX price APIs when cross-DEX arbitrage or smart order routing is the goal. If you need the same analysis on Arbitrum One or BSC, use the sibling endpoints for those chains.

## Known failure modes

- Unsupported token pair symbol returns an error or empty result
- Token pair with no liquidity on one or more venues may return incomplete venue comparison
- Network latency or RPC issues on Base L2 may cause stale or failed price fetches
- Malformed pair parameter (wrong format, missing slash) returns a validation error
- Very low liquidity pairs may return zero optimal trade size

## How this service works

Cheapest venue to buy and richest to sell ONE pair on Base across BaseSwap, SushiSwap and Uniswap v3. Returns buyAt and sellAt (venue, price, tvlUsd), midSpreadBps, grossSpreadBps, optimalInput, venuesConsidered. Requires ?pair=SYM/SYM (e.g. WETH/USDC). Errors: 400 bad_pair, 404 not_routable, 502 upstream_read_failed. Ranks venues for one pair; to rank EVERY pair use /scan. Execution at a size is /slippage. Chain-pinned; bare /route = BSC.

## Output

Returns the best buy venue (cheapest DEX), best sell venue (highest price DEX), cross-exchange spread expressed in basis points, fee-adjusted gross arbitrage spread, and an optimal trade size for the requested token pair on Base L2.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "pair"
     ],
     "properties": {
      "pair": {
       "type": "string",
       "description": "Token pair as SYM/SYM on Base (e.g. WETH/USDC)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ts": "2026-07-31T00:00:00.000Z",
  "chainId": 8453,
  "network": "base"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-dex-best-execution-router-1cec2576/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.donnyautomation.com](https://www.zero.xyz/host/x402.donnyautomation.com/llms.txt)
