# DeFi Oracle — Best Swap Route Finder

> DeFi Oracle — Best Swap Route Finder is a paid API for AI agents from defi-oracle-two.vercel.app, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-14).

Finds the optimal token swap route between two tokens on a given chain, comparing all available DEX routes and returning the best path with full route details.

## Facts

- Endpoint: POST https://defi-oracle-two.vercel.app/api/best-route
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-oracle-best-swap-route-finder-72627ccd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CdMd9MzAPED1kXUQM_206

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-oracle-best-swap-route-finder-72627ccd -d '<json body>'
```

Example prompt: What's the best swap route to trade $500 worth of ETH into USDC on Base — show me all available routes and which one gives the best rate?

## When to prefer this

Use this endpoint when an AI agent needs to find the most efficient on-chain swap path between two specific tokens before executing a trade, or when comparing DEX routes to minimize slippage and fees. Best suited for pre-trade analysis on supported chains where DeFiLlama aggregation data is available.

## Known failure modes

- Unsupported token symbol returns empty routes or error
- Chain not supported returns no routes found
- No liquidity available for the pair returns routes_found: 0
- Invalid token symbol format causes request validation error
- Network RPC connectivity issues may cause timeouts or stale data

## How this service works

DeFi data for AI agents — yield rates, swap routes, IL calculator, liquidation risk, MEV scanner, TVL tracking. Powered by DeFiLlama + on-chain RPC data. Pay with USDC on Base via x402.

## Output

Returns a structured object containing the best recommended swap route, a list of all discovered routes across DEXes, the number of routes found, and echoed input parameters (from token, to token, chain, amount in USD). The best_route object details the specific protocol path and pricing for the optimal trade.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "to_token",
  "from_token"
 ],
 "properties": {
  "chain": {
   "type": "string"
  },
  "to_token": {
   "type": "string",
   "description": "Target token symbol"
  },
  "amount_usd": {
   "type": "number"
  },
  "from_token": {
   "type": "string",
   "description": "Source token symbol"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "string"
  },
  "from": {
   "type": "string"
  },
  "chain": {
   "type": "string"
  },
  "all_routes": {
   "type": "array"
  },
  "amount_usd": {
   "type": "number"
  },
  "best_route": {
   "type": "object"
  },
  "routes_found": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-oracle-best-swap-route-finder-72627ccd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-oracle-two.vercel.app](https://www.zero.xyz/host/defi-oracle-two.vercel.app/llms.txt)
