# Uniswap V2 Exact-Input Swap Calldata Builder

> Uniswap V2 Exact-Input Swap Calldata Builder is a paid API for AI agents from evm-canon-base.onrender.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Builds Uniswap-V2-style exact-input swap calldata for a given token path, ready to submit on-chain.

## Facts

- Endpoint: POST https://evm-canon-base.onrender.com/encode/swap
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/uniswap-v2-exact-input-swap-calldata-builder-5fad011c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WCYjbBJsD49NjXzLvI6wx

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 uniswap-v2-exact-input-swap-calldata-builder-5fad011c -d '<json body>'
```

Example prompt: Build me the Uniswap-V2-style exact-input swap calldata to swap 100 USDC through the path USDC → WETH → DAI, with a 0.5% slippage tolerance, sending the output to 0xAbCd...1234, and a 20-minute deadline.

## When to prefer this

Choose this endpoint when you need deterministic, auditable Uniswap-V2-compatible swap calldata built server-side without running a local ABI encoder or web3 library. Ideal for agents that need to construct DeFi swap transactions on Base or EVM-compatible chains without embedding a full Uniswap SDK, especially when human-readable amounts and token symbols need to be resolved to exact calldata. Prefer over raw ABI encoding when you want built-in risk flagging and decimal resolution.

## Known failure modes

- Invalid or unrecognized token addresses in the path returns an error
- Malformed path array (fewer than 2 tokens) causes a validation failure
- Slippage out of acceptable range returns a parameter error
- Missing required fields (amount, path, recipient, deadline) returns a 400-level error
- Token not found in the pinned registry may cause resolution failure
- Payment not included or insufficient (x402) results in a 402 Payment Required response

## How this service works

Build Uniswap-V2-style exact-input swap calldata with the token path

## Output

Returns ABI-encoded calldata for a Uniswap-V2-style swapExactTokensForTokens (or equivalent exact-input) function call, including the function selector and all encoded parameters (amountIn, amountOutMin, path array, recipient, deadline). The calldata is ready to be submitted as the `data` field of an EVM transaction to a compatible Uniswap V2 router contract.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "args"
     ],
     "properties": {
      "args": {
       "type": "object",
       "description": "arguments keyed by parameter name"
      },
      "chain": {
       "description": "chain name, alias or numeric chainId"
      },
      "token": {
       "type": "string",
       "description": "symbol or contract address"
      },
      "value": {
       "type": "string",
       "description": "native value in wei"
      },
      "function": {
       "type": "string",
       "description": "name or full signature (generic route only)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "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/uniswap-v2-exact-input-swap-calldata-builder-5fad011c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from evm-canon-base.onrender.com](https://www.zero.xyz/host/evm-canon-base.onrender.com/llms.txt)
