{"uid":"cap_DwCX_uOB5egN_2beNimzD","slug":"api-quantoracle-dev-fc72c808","name":"QuantOracle DEX Slippage Calculator","description":"QuantOracle: crypto/dex-slippage","url":"https://api.quantoracle.dev/v1/crypto/dex-slippage","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"fee_bps":{"type":"integer","title":"Fee Bps","default":30,"description":"DEX fee in basis points (e.g. 30 = 0.3%)"},"reserve_a":{"type":"number","title":"Reserve A","description":"Pool reserve of token A","exclusiveMinimum":0},"reserve_b":{"type":"number","title":"Reserve B","description":"Pool reserve of token B","exclusiveMinimum":0},"trade_amount":{"type":"number","title":"Trade Amount","description":"Amount of input token to swap","exclusiveMinimum":0},"trade_direction":{"enum":["a_to_b","b_to_a"],"type":"string","title":"Trade Direction","default":"a_to_b","description":"Swap direction"}}},"responseSchema":null,"example":{"request":{"fee":0.003,"direction":"a_to_b","reserve_a":5000000,"reserve_b":2000000,"trade_amount":10000},"response":{"ms":10.88,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","powered_by":"QuantOracle"},"fee_amount":30,"spot_price":0.4,"slippage_bps":49.84,"output_amount":3980.0638,"effective_price":0.398006,"price_impact_pct":0.4984,"minimum_output_1pct_tolerance":3940.2631}},"exampleRequest":{"fee":0.003,"direction":"a_to_b","reserve_a":5000000,"reserve_b":2000000,"trade_amount":10000},"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_g6YheCYMFfdWCvaxrJu_Z","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates DEX trade slippage, price impact, output amount, and effective price for an AMM swap given pool reserves, trade size, fee, and direction","exampleAgentPrompt":"I'm about to swap 10,000 units of token A for token B on a DEX pool with 5,000,000 units of token A and 2,000 units of token B reserves, a 30 bps fee, trading in the a_to_b direction — what will the slippage, price impact, and output amount be?","exampleUseCases":null,"resultDescription":"Returns slippage in basis points, price impact percentage, output amount of the received token, effective execution price, spot price, fee amount charged, and minimum output amount under 1% slippage tolerance. Also includes computation latency in milliseconds.","failureModes":["Invalid trade direction (must be 'a_to_b' or 'b_to_a')","Zero or negative reserve values causing division by zero","Trade amount larger than available pool reserves","Negative or out-of-range fee_bps value","Missing required fields returns validation error","Payment failure or insufficient USDC balance (x402 protocol)"],"whenToPreferThis":"Use this endpoint when you need fast, precise AMM slippage and price impact calculations for DEX trades without connecting to an on-chain node. Ideal for pre-trade simulation, order routing, portfolio rebalancing logic, or any workflow that needs to estimate DEX execution quality programmatically. Prefer over on-chain calls when latency, cost, or infrastructure complexity matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:57:26.671Z","isFirstParty":false}