# Swap Quote – Best DEX Route (LI.FI Aggregator)

> Swap Quote – Best DEX Route (LI.FI Aggregator) is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-11-07).

Returns the best DEX swap quote across 30+ chains and multiple DEX aggregators, including amount out, slippage-adjusted minimum, gas/fee costs, route steps, and optionally an unsigned transaction ready to sign.

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/swap/quote?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-07
- Activations on Zero: 0
- Provider: agent-data-tools.revmesh2074.workers.dev
- Website: https://agent-data-tools.revmesh2074.workers.dev
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-swap-quote-best-dex-route-li-0fb53fe9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ELKNvIHA8DvIHL5jOKjO5

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 agent-data-tools-revmesh2074-workers-dev-swap-quote-best-dex-route-li-0fb53fe9
```

Example prompt: Can you get me the best DEX swap quote to trade 100 USDC for ETH on Base — include the unsigned transaction so I can sign it, and use my wallet address 0xAbC123...?

## When to prefer this

Use this endpoint when an AI trading agent needs to price a token swap across multiple DEX aggregators on 30+ chains before committing to a transaction. It is specifically backed by LI.FI aggregation, which covers cross-chain bridging as well as single-chain swaps. Prefer this over single-DEX APIs when you want best-price routing. Use it as a mandatory pre-execution step — it only produces quotes, never submits transactions, so there is zero risk of unintended trades.

## Known failure modes

- Unsupported chain name or ID returns an error
- Token symbol not found on the specified chain (use token address instead)
- No liquidity route found between the two tokens
- Amount too small to route (below minimum swap threshold)
- LI.FI upstream timeout or service unavailability
- Invalid wallet address format for fromAddress or toAddress
- Slippage tolerance out of valid range

## How this service works

Swap quote, best DEX route. Best price to swap one token for another on 30+ chains (Base, Ethereum, Arbitrum, Solana, BSC…) across DEX aggregators, via LI.FI: amount out, minimum after slippage, USD values, gas and fees, total cost in percent, route and approval address; with fromAddress, the unsigned transaction for your wallet to sign. Tokens by symbol or address, amounts in token units. A quote only: nothing is signed or sent. Use before a trading agent swaps.

## Output

A JSON object containing: output token and amount, minimum amount after slippage, USD value of the output, source token and amount in USD, exchange rate, gas cost in USD, protocol fees in USD, total loss percentage, DEX route description, step-by-step route breakdown (each with protocol name, type, and chain IDs), estimated execution time in seconds, approval address, slippage percentage applied, and optionally an unsigned transaction if fromAddress was provided.

## 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": [
      "fromChain",
      "fromToken",
      "amount",
      "toToken"
     ],
     "properties": {
      "amount": {
       "type": "string",
       "examples": [
        "1000"
       ],
       "description": "Amount of fromToken in token units, e.g. 100 or 0.5"
      },
      "toToken": {
       "type": "string",
       "examples": [
        "ETH"
       ],
       "description": "Token to buy: symbol or address"
      },
      "slippage": {
       "type": "number",
       "examples": [
        0.5
       ],
       "description": "Slippage tolerance in percent (default 0.5)"
      },
      "fromChain": {
       "type": "string",
       "examples": [
        "base"
       ],
       "description": "Chain name or id: base, ethereum, arbitrum, solana…"
      },
      "fromToken": {
       "type": "string",
       "examples": [
        "USDC"
       ],
       "description": "Token to sell: symbol (USDC, ETH) or address"
      },
      "toAddress": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "examples": [
        "0x000000000000000000000000000000000000dEaD"
       ],
       "description": "Optional receiving wallet, e.g. a Solana address when bridging to Solana"
      },
      "fromAddress": {
       "type": "string",
       "pattern": "^0x[0-9a-fA-F]{40}$",
       "examples": [
        "0x000000000000000000000000000000000000dEaD"
       ],
       "description": "Optional wallet that would send: adds the unsigned transaction to the answer"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "to": {
       "type": "object",
       "properties": {
        "token": {
         "type": "string"
        },
        "amount": {
         "type": "string"
        },
        "address": {
         "type": "string"
        },
        "chainId": {
         "type": "number"
        },
        "amountMin": {
   
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": {
   "token": "ETH",
   "amount": "0.448115540014",
   "address": "0x0000000000000000000000000000000000000000",
   "chainId": 8453,
   "amountMin": "0.445874290140619979",
   "amountUsd": 1000.92
  },
  "from": {
   "token": "USDC",
   "amount": "1000",
   "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
   "chainId": 8453,
   "amountUsd": 999.9
  },
  "note": "A quote, not an order…",
  "rate": 0.000448115540014,
  "costs": {
   "gasUsd": 0.02,
   "feesUsd": 2.5,
   "totalLossPercent": 0.25
  },
  "route": "Fly",
  "steps": [
   {
    "via": "Fly",
    "type": "swap",
    "toChainId": 8453,
    "fromChainId": 8453
   }
  ],
  "source": "LI.FI (li.quest)",
  "approvalAddress": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
  "slippagePercent": 0.5,
  "estimatedSeconds": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-swap-quote-best-dex-route-li-0fb53fe9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
