{"uid":"cap_Zevwp0m0prCwan8NMpOqD","slug":"base-dex-swap-quote-best-route-ea9bc007","name":"Base DEX Swap Quote (Best-Route)","description":"How much will I get, and what do I sign? Best-route swap quote on Base for any token pair: from=USDC|ETH|WETH|cbBTC|DAI|AERO|DEGEN|BRETT|VIRTUAL or 0x.. &to=..&amount=10 (human units) [&wallet=0x.. for ready-to-sign calldata + approval check] [&slippage_bps=50]. Aggregates 100+ Base DEX pools (KyberSwap meta-aggregator, OpenOcean fallback).","url":"https://kr-x402-mvp.kgy5612.workers.dev/crypto/swap-quote?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","required":["from","to","amount"],"properties":{"to":{"type":"string","examples":["WETH"],"description":"Token out: symbol or 0x address"},"from":{"type":"string","examples":["USDC"],"description":"Token in: symbol (USDC, ETH, WETH, cbBTC, DAI, USDbC, AERO, DEGEN, BRETT, VIRTUAL) or 0x address"},"amount":{"type":"string","examples":["10"],"description":"Amount of token in, human units (e.g. 10 = 10 USDC)"},"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Optional sender/recipient: returns ready-to-sign tx + allowance/balance check"},"slippage_bps":{"type":"integer","maximum":2000,"minimum":1,"description":"Slippage tolerance in bps (default 50 = 0.5%)"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"to":{"symbol":"WETH","address":"0x4200000000000000000000000000000000000006","decimals":18},"from":{"symbol":"USDC","address":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","decimals":6},"hops":1,"chain":"base","price":2224.6,"route":["pmm-2"],"router":"0x6131b5fae19ea4f9d964eac0408e4408b66337b5","source":"kyberswap","gas_usd":0.0319,"min_out":0.00447272,"verdict":"GOOD","cost_pct":-0.73,"guidance":"Good fill. Pass wallet= for ready-to-sign calldata; verify it with /crypto/decode-calldata before signing.","amount_in":10,"amount_out":0.0044952,"l1_fee_usd":0.0015,"net_out_usd":10.0153,"router_label":"KyberSwap MetaAggregation Router v2","slippage_bps":50,"amount_in_usd":9.976,"amount_out_usd":10.0487}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_yHm0U8bVBbqfqYcnJRdKn","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the best-route swap quote on Base for any token pair, with optional ready-to-sign calldata and wallet approval checks, aggregating 100+ DEX pools via KyberSwap and OpenOcean.","exampleAgentPrompt":"How much WETH will I get if I swap 10 USDC on Base right now, and can you get me the ready-to-sign calldata for my wallet 0xAbCd1234...5678 with 0.5% slippage?","exampleUseCases":[{"title":"Pre-trade swap price check","prompt":"What's the best rate I can get swapping 500 USDC to WETH on Base right now? Show me the route, gas cost, and whether it's a good fill."},{"title":"Onchain agent self-funded swap","prompt":"I want to swap 50 USDC to cbBTC on Base from my wallet 0x1234567890abcdef1234567890abcdef12345678 — give me the ready-to-sign calldata and check my allowance, with 1% slippage tolerance."},{"title":"Arbitrage cost analysis","prompt":"What's the net USD value I'd get swapping 1000 BRETT to USDC on Base, including gas fees? I need the cost percentage and route details to decide if it's worth executing."}],"resultDescription":"Returns a JSON object containing: input and output token metadata (symbol, address, decimals), amount in and out (human units), USD valuations for both sides, net USD output after gas, gas cost in USD, L1 fee in USD, routing details (route array, hops, router address and label, source DEX), slippage in bps, min out amount, a GOOD/BAD/NEUTRAL verdict, cost percentage, and a human-readable guidance string. When wallet is provided, also includes ready-to-sign transaction calldata and wallet allowance/balance status.","failureModes":["Unsupported token symbol or invalid 0x address returns error","No liquidity route found between the given pair","Amount too small to route efficiently — may return zero or very high cost_pct","Invalid wallet address format (must match ^0x[0-9a-fA-F]{40}$)","Slippage_bps out of range (must be 1–2000)","KyberSwap aggregator temporarily unavailable — falls back to OpenOcean; if both fail, returns error","Payment failure (x402): insufficient USDC balance or approval for $0.003 per call fee"],"whenToPreferThis":"Choose this endpoint when you need a best-execution swap quote specifically on the Base L2 network, especially when you need ready-to-sign calldata for a wallet (not just a price estimate). It aggregates 100+ Base DEX pools via KyberSwap meta-aggregator with OpenOcean fallback, making it superior to single-DEX price queries. Ideal for AI agents executing or planning onchain trades on Base with USDC, ETH, WETH, cbBTC, DAI, AERO, DEGEN, BRETT, or VIRTUAL. Prefer this over generic price feeds when you need routing details, gas estimates, slippage tolerance, wallet approval checks, and actionable transaction data in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T18:39:50.942Z","isFirstParty":false,"canonicalSlug":"base-dex-swap-quote-best-route-ea9bc007"}