{"uid":"cap_BIJhP7YYrUNILmhaWy-aQ","slug":"signalharness-defi-constant-product-amm-quote-9fe56b04","name":"SignalHarness DeFi Constant Product AMM Quote","description":"Explore 330 pay-per-call x402 API services and 27 agent-native digital products, with Base USDC pricing, secure Polar checkout, and free discovery.","url":"https://signalharness.ai/api/agent/services/defi_constant_product_quote/invoke","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"amm_quote_request":{"type":"string","maxLength":65536,"minLength":2}}},"responseSchema":{"type":"json","example":{"replay":false,"result":{"warnings":["Quote ignores routing, MEV, state changes, and token transfer fees."],"amm_quote":"{\"amount_out\":\"19.743160687941225977\",\"effective_amount_in\":\"9.97\",\"execution_price\":\"1.974316068794122597\",\"invariant_model\":\"constant_product\",\"price_impact_percent\":\"1.284196560293\",\"spot_price\":\"2\"}","service_id":"defi_constant_product_quote","evidence_scope":"caller_supplied_data"},"status":"succeeded","receipt":{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","usage":[],"status":"succeeded","network":"eip155:8453","artifacts":[],"endedAtMs":0,"latencyMs":0,"paymentId":"example-payment","receiptId":"example-receipt","requestId":"example-request","serviceId":"defi_constant_product_quote","executionId":"example-execution","startedAtMs":0,"amountAtomic":"10000","resultSha256":"d1a78a0d4930acab76da52d0b9e24363dfa1c252833e800052a18ee8c9d2abfb","serviceVersion":"1.0.0","settlementReference":"0x0000000000000000000000000000000000000000000000000000000000000000"},"artifacts":[],"requestId":"example-request","executionId":"example-execution"}},"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_iHdCvgCO1l-oe30OQ1Q72","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":"Computes a constant-product AMM (x*y=k) price quote given caller-supplied swap parameters, returning the expected output amount and any warnings.","exampleAgentPrompt":"Can you calculate a constant product AMM quote for swapping 500 USDC for ETH in a pool with 1,000,000 USDC and 400 ETH reserve — I need the expected output and any slippage warnings before I execute the trade.","exampleUseCases":[{"title":"Pre-trade slippage check for DEX swap","prompt":"Before I swap 10,000 USDC for WBTC on a constant product AMM pool with reserves of 2,000,000 USDC and 50 WBTC, can you compute the expected output amount and flag any high-slippage warnings?"},{"title":"DeFi arbitrage opportunity sizing","prompt":"I think there's an arbitrage opportunity between two liquidity pools — can you run a constant product quote for buying 5 ETH worth of USDC from a pool with 500 ETH and 900,000 USDC reserves so I can check the effective price?"},{"title":"AMM price impact analysis for large order","prompt":"I'm about to execute a large order: swapping 100,000 DAI in a pool with 500,000 DAI and 200,000 USDC. Can you use the constant product formula to estimate my output and tell me how bad the price impact will be?"}],"resultDescription":"Returns a JSON object containing the computed AMM quote (expected output token amount), a list of warnings (e.g. high slippage, insufficient liquidity), the service ID, a receipt with payment details, network info (Base/eip155:8453), execution timing metadata, and a SHA-256 result hash for verification.","failureModes":["Malformed amm_quote_request JSON string causes a parse error or validation failure","Pool reserve values of zero or near-zero may produce division-by-zero or nonsensical quotes with warnings","Extremely large swap amounts relative to pool size may produce warnings about excessive price impact","Payment failure (insufficient USDC balance or x402 protocol error) prevents execution","Missing required fields in the quote request body result in an error response"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic constant-product (x*y=k) AMM price quote computation without executing an on-chain transaction. It is ideal for pre-trade simulation, slippage estimation, and arbitrage analysis on any token pair where you supply the pool reserves. Prefer it over on-chain RPC calls when you want a hosted, auditable computation with a verifiable receipt on Base.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T13:07:11.316Z","isFirstParty":false}