{"uid":"cap_DcVpH0qaF_1gclkFE9ZGV","slug":"delx-commerce-amm-output-given-input-calculator-671fea01","name":"Delx Commerce AMM Output Given Input Calculator","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/amm-out-given-in?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"fee_bps":{"type":"integer","description":"Input field: fee bps."},"amount_in":{"type":"integer","description":"Input field: amount in."},"reserve_in":{"type":"integer","description":"Input field: reserve in."},"reserve_out":{"type":"integer","description":"Input field: reserve out."}}},"responseSchema":{"type":"json","example":{"schema":"delx/util-amm-out-given-in/v1","fee_bps":30,"amount_in":10,"amount_out":9.871580343970614}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_sizINjdV6LS2TxeAGvzAP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the output token amount for a given input amount in a constant-product AMM (automated market maker) swap, accounting for a specified fee","exampleAgentPrompt":"Using the AMM out-given-in formula, calculate how many tokens I'd receive if I put in 1000 units, with a pool reserve_in of 500000, reserve_out of 800000, and a fee of 30 basis points.","exampleUseCases":[{"title":"Pre-trade swap quote for DeFi agent","prompt":"Before executing a token swap on a DEX, tell me how many tokens I'll get out if I put in 250 units, with reserve_in of 100000, reserve_out of 95000, and a 30 bps fee."},{"title":"Comparing pool routes for best output","prompt":"I'm deciding between two liquidity pools — for Pool A with reserve_in 200000, reserve_out 180000, and 25 bps fee, how much would I get if I swap in 500 units?"},{"title":"Slippage estimation for large trade","prompt":"I want to understand the price impact of a large trade: calculate the AMM output if I put in 50000 units into a pool with reserve_in 300000, reserve_out 310000, and 30 bps fee."}],"resultDescription":"Returns a JSON object with the schema identifier ('delx/util-amm-out-given-in/v1'), the input fee_bps and amount_in echoed back, and the computed amount_out representing how many output tokens the trader would receive after fees using the constant-product (x*y=k) formula.","failureModes":["Missing required fields (amount_in, reserve_in, reserve_out, fee_bps) returns an error","Zero or negative reserve values may cause division errors or invalid results","Integer overflow for very large reserve or amount values","Payment failure via x402 protocol (insufficient USDC balance) blocks the call"],"whenToPreferThis":"Use this endpoint when you need a fast, verifiable, pay-per-use computation of AMM swap output without integrating a full DEX SDK or running your own smart contract simulation. Ideal for AI agents that need on-demand DeFi pricing math without signup, API keys, or subscription costs — especially when operating on Base or Solana with USDC via the x402 protocol.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:54:00.403Z","isFirstParty":false,"canonicalSlug":"delx-commerce-amm-output-given-input-calculator-671fea01"}