{"uid":"cap_or8cdbzCa2cvDm5Lhex0O","slug":"uniswap-v2-swap-output-calculator-38b81b43","name":"Uniswap V2 Swap Output Calculator","description":"Exact EVM address, calldata, Uniswap V2/V3 and impermanent-loss math. Pay per call in USDC on Base via x402.","url":"https://dominion-data.x402-evm-math.workers.dev/defi/v2-swap?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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","properties":{}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"amount_out":"499248..."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_g9G-QjByzn0WYnxmU5fXo","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the exact output amount for a Uniswap V2 token swap given pool reserves and input amount","exampleAgentPrompt":"What's the exact token output if I swap 1000 USDC for ETH on a Uniswap V2 pool with reserves of 500,000 USDC and 200 ETH?","exampleUseCases":[{"title":"Pre-trade swap output estimation","prompt":"Before I execute this trade, tell me exactly how many WBTC I'll receive if I swap 5 ETH on a Uniswap V2 pool where ETH reserve is 1000 and WBTC reserve is 50."},{"title":"Arbitrage opportunity sizing","prompt":"I'm checking an arbitrage path — what's the V2 swap output for putting in 10,000 USDT on a pool with 2,000,000 USDT and 800,000 USDC reserves?"},{"title":"Slippage check before DeFi bot execution","prompt":"My bot is about to swap 50,000 DAI on a Uniswap V2 DAI/USDC pool with 10M DAI and 9.8M USDC in reserves — calculate the exact output amount so I can verify slippage is under 0.5%."}],"resultDescription":"Returns a JSON object with `amount_out`, the precise number of output tokens the swap would yield, computed using the Uniswap V2 constant-product formula (x*y=k) with the 0.3% fee deducted.","failureModes":["Missing required query parameters returns an error","Zero or invalid reserve values may cause division errors or unexpected results","Very large input amounts relative to reserves will show extreme slippage in output","Payment not included or insufficient USDC payment returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need exact, deterministic Uniswap V2 swap output math without making an on-chain call — ideal for agents pre-checking trade outputs, simulating arbitrage paths, or validating slippage before submitting a transaction. Prefer over V3 calculator when dealing specifically with V2 constant-product pools.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-20T12:39:24.786Z","isFirstParty":false,"canonicalSlug":"uniswap-v2-swap-output-calculator-38b81b43"}