{"uid":"cap_WCYjbBJsD49NjXzLvI6wx","slug":"uniswap-v2-exact-input-swap-calldata-builder-5fad011c","name":"Uniswap V2 Exact-Input Swap Calldata Builder","description":"Build Uniswap-V2-style exact-input swap calldata with the token path","url":"https://evm-canon-base.onrender.com/encode/swap","method":"POST","headers":{},"bodySchema":{"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"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__hOUUmCRdJkjOKpmH8TIF","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Builds Uniswap-V2-style exact-input swap calldata for a given token path, ready to submit on-chain.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Multi-hop DeFi swap transaction","prompt":"I want to swap 500 USDC for WETH and then into cbETH in a single exact-input swap — can you build the Uniswap-V2-style calldata for the full path with 1% slippage and a 30-minute deadline, sending output to my wallet 0xDead...Beef?"},{"title":"Automated DeFi rebalancing bot","prompt":"My rebalancing bot needs to swap 1000 DAI directly to USDC using a Uniswap-V2-compatible router — generate the exact-input swap calldata for that single-hop path with 0.3% slippage and recipient address 0x1234...5678."},{"title":"On-chain swap calldata for wallet integration","prompt":"Build the encoded calldata for a Uniswap-V2-style swapExactTokensForTokens call: 250 WETH in, path is WETH → USDC, 0.5% max slippage, recipient 0xABCD...EF01, deadline 15 minutes from now."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:34:28.750Z","isFirstParty":false}