{"uid":"cap_7QNrAY1ykZdfv_w36IbZW","slug":"p0-quote-swap-on-chain-token-swap-quote-fa0d824a","name":"P0 Quote/Swap — On-Chain Token Swap Quote","description":"An open index of the machine-to-machine (agent) economy. x402 routes: ranked discovery over the live x402 service market, every indexed service scored by real 30-day calls and paying-wallet bounds, with a receipt naming the snapshot hash and scoring revision. /economy routes, for Tempo MPP, Virtuals ACP, Olas, Masumi, ERC-8004 agent registries, Solana agent registries, Base agent contracts and MCP servers (Official MCP Registry): each protocol's published figures (agent or server counts, transactions or payment events; payers and USD volume only where the source publishes them: payers for x402 and Tempo MPP, USD volume for x402 and Virtuals ACP), each with its unit, window and source; units differ, so totals are not summed. L402 and per-service MPP listings are not covered.","url":"https://x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/quote/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","HEAD"],"type":"string"},"queryParams":{"type":"object","required":["chain","from","to","amount","taker"],"properties":{"to":{"type":"string","description":"token to buy: symbol or 0x address"},"from":{"type":"string","description":"token to sell: symbol (USDC, WETH, ETH...) or 0x address"},"chain":{"type":"string","description":"base, arbitrum, ethereum, optimism, polygon or bsc (or chain id)"},"taker":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"wallet that will sign and send the swap"},"amount":{"type":"string","pattern":"^[0-9]{1,78}$","description":"amount to sell in base units (10 USDC = 10000000)"},"to_decimals":{"type":"integer","maximum":36,"minimum":0,"description":"only for tokens P0 does not know"},"slippage_bps":{"type":"integer","default":50,"maximum":500,"minimum":1,"description":"max slippage in basis points (50 = 0.5%). The alias 'slippage' is read as basis points too (Velora's unit); a 'slippage' below 10 is refused as ambiguous"},"from_decimals":{"type":"integer","maximum":36,"minimum":0,"description":"only for tokens P0 does not know"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["chain","chainId","provider","sellToken","buyToken","sellAmount","buyAmount","tx","integratorFee","quotedAt","note"],"properties":{"tx":{"type":"object","required":["from","to","data","value","chainId"],"properties":{"to":{"type":"string"},"data":{"type":"string"},"from":{"type":"string"},"value":{"type":"string"},"chainId":{"type":"integer"}}},"note":{"type":"string"},"chain":{"type":"string"},"chainId":{"type":"integer"},"approval":{"type":["object","null"],"properties":{"token":{"type":"string"},"amount":{"type":"string"},"spender":{"type":"string"}}},"buyToken":{"type":"object","required":["address"],"properties":{"symbol":{"type":["string","null"]},"address":{"type":"string"},"decimals":{"type":["integer","null"]}}},"provider":{"type":"string"},"quotedAt":{"type":"string"},"buyAmount":{"type":"string"},"sellToken":{"type":"object","required":["address"],"properties":{"symbol":{"type":["string","null"]},"address":{"type":"string"},"decimals":{"type":["integer","null"]}}},"sellAmount":{"type":"string"},"gasEstimate":{"type":["string","null"]},"slippageBps":{"type":"integer"},"fallbackFrom":{"type":["string","null"]},"integratorFee":{"type":"object","required":["bps","receiver","chargedOn","inCalldata","confirmed","note"],"properties":{"bps":{"type":"integer"},"note":{"type":"string"},"split":{"type":["object","null"],"properties":{"p0":{"type":"number"},"aggregator":{"type":"number"}}},"token":{"type":"string"},"amount":{"type":["string","null"]},"percent":{"type":"number"},"receiver":{"type":"string"},"chargedOn":{"type":"string"},"confirmed":{"type":"boolean"},"inCalldata":{"type":"boolean"}}},"fallbackReason":{"type":["string","null"]}}}}}}},"responseSchema":{"type":"json","example":{"tx":{"to":"0x6a000f20005980200259b80c5102003040001068","data":"0x876a02f6...(shortened example)","from":"0x1111111111111111111111111111111111111111","value":"0","chainId":8453},"note":"Unsigned transaction for you to review, sign and broadcast yourself. P0 never signs, holds or sends funds. Quotes go stale within seconds: run eth_estimateGas and send promptly, or request a new quote. Not financial advice.","chain":"base","chainId":8453,"approval":{"token":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"10000000","spender":"0x6a000f20005980200259b80c5102003040001068"},"buyToken":{"symbol":"WETH","address":"0x4200000000000000000000000000000000000006","decimals":18},"provider":"velora","quotedAt":"2026-10-04T18:37:00.000Z","buyAmount":"3695089715876312","sellToken":{"symbol":"USDC","address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","decimals":6},"sellAmount":"10000000","gasEstimate":"131096","slippageBps":50,"fallbackFrom":null,"integratorFee":{"bps":20,"note":"Integrator fee of 20 bps (0.20%) of this swap is taken by the aggregator contract inside the swap transaction you sign; buyAmount already excludes it. Velora keeps 15% of that fee and P0 receives 85% (about 17 bps).","split":{"p0":0.85,"aggregator":0.15},"token":"0x4200000000000000000000000000000000000006","amount":"7404989410574","percent":0.2,"receiver":"0xECa891e34b3E5873181Fb779672564E198C55354","chargedOn":"output","confirmed":true,"inCalldata":true},"fallbackReason":null}},"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_svOmTbgLStLiCVuK5gqeH","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":"Returns an unsigned swap transaction (with approval details, gas estimate, and fee breakdown) for exchanging one ERC-20 token for another across major EVM chains, sourced from the best aggregator route available.","exampleAgentPrompt":"Get me a swap quote to sell 10 USDC (that's 10000000 base units) for WETH on Base using my wallet 0x1111111111111111111111111111111111111111, with a max slippage of 50 basis points.","exampleUseCases":[{"title":"AI agent executing DeFi rebalance","prompt":"I need to rebalance my portfolio — get me an unsigned swap quote to sell 500 USDC (500000000 base units) for WETH on Base using wallet 0xAbCd1234abcd1234abcd1234abcd1234abcd1234, slippage max 50 bps, so I can review and sign it myself."},{"title":"Checking cross-chain swap rates","prompt":"What's the best rate to swap 1 ETH (1000000000000000000 base units) for USDC on Arbitrum from wallet 0xDeAdBeef00000000000000000000000000000001 with 100 bps slippage?"},{"title":"Fetching calldata for a bot trade","prompt":"Pull me a swap quote on Polygon to sell 200 USDC (200000000 base units) for WMATIC using wallet 0xFeed0000000000000000000000000000000Cafe1 at 50 bps slippage — I need the full transaction calldata and approval info."}],"resultDescription":"A JSON object containing: the unsigned swap transaction (to, from, data, value, chainId fields ready to sign and broadcast), an approval object (token address, amount, spender) if needed, buy/sell token metadata (symbol, address, decimals), buy and sell amounts, a gas estimate, the aggregator provider used, the quote timestamp, slippage in bps, and a detailed integrator fee breakdown (bps, token, amount, receiver, how the fee is split between P0 and the aggregator, and confirmation that the fee is embedded in calldata).","failureModes":["Missing required query params (chain, from, to, amount, taker) → 400 error","Ambiguous slippage value below 10 bps → rejected as ambiguous","Unknown token symbol with no address provided → lookup failure","Quote goes stale within seconds — must re-request if not broadcast immediately","Unsupported chain identifier → error","Invalid taker address format (not 0x + 40 hex chars) → schema validation failure","Payment of $0.002 USDC not completed → 402 Payment Required"],"whenToPreferThis":"Use this endpoint when an AI agent or autonomous wallet needs a ready-to-sign unsigned swap transaction across major EVM chains (Base, Arbitrum, Ethereum, Optimism, Polygon, BSC) with transparent fee breakdown and gas estimation, without custody or signing by any third party. Prefer it over raw DEX APIs when you want aggregated routing, integrator fee transparency, and a schema designed for machine-to-machine use in the x402 payment protocol ecosystem.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T18:45:26.156Z","isFirstParty":false,"canonicalSlug":"p0-quote-swap-on-chain-token-swap-quote-fa0d824a"}