{"uid":"cap_6et2-CSKkub7fAd8GoHGa","slug":"mev-sandwich-risk-analyzer-7b263294","name":"MEV Sandwich Risk Analyzer","description":"Theoretical sandwich-attack profit for a swap of a given size in one DEX pool, at the pool's current reserves (DexScreener) and the swap's slippage tolerance: the largest front-run that still lets the victim's trade succeed, and the profit it would give. Constant-product pools only, no mempool view, no competing bots: a worst-case estimate, not a prediction. Suggests a slippage tolerance.","url":"https://api.fadeandco.workers.dev/api/agent-intel/mev-sandwich-risk-analyzer?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":["pair","amount"],"properties":{"pair":{"type":"string","description":"Pool (pair) address"},"side":{"type":"string","description":"sell = victim gives base token; buy = victim gives quote token (default sell)"},"chain":{"type":"string","description":"DexScreener chain name, e.g. base, ethereum (default base)"},"amount":{"type":"string","description":"Victim's input amount in that token's units"},"feePct":{"type":"string","description":"Pool fee in percent, 0 to 5 (default 0.3)"},"slippagePct":{"type":"string","description":"Victim's slippage tolerance in percent, 0 to 50 (default 1)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"dex":"aerodrome","note":"Worst-case theory at current reserves. Real sandwiches face competition and gas costs.","pair":"0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d","risk":"NO_PROFITABLE_SANDWICH","side":"sell","chain":"base","model":"constant-product x*y=k, worst case, no competing bots","source":"https://api.dexscreener.com/latest/dex/pairs/base/0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d","checkedAt":"2026-10-23T09:35:18.707Z","victimAmount":10000,"victimMinOut":7731.07539839,"maxFrontRunSize":37037.702559,"theoreticalProfit":0,"victimExpectedOut":7809.16706908,"victimSlippagePct":1,"suggestedSlippagePct":0.54,"victimPriceImpactPct":0.4355,"profitAsPctOfVictimSize":0}},"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_PXWyzDghs1aqN5LGjCt8y","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":"Calculates the theoretical maximum sandwich-attack profit for a swap in a constant-product DEX pool, based on current reserves and slippage tolerance, and suggests an optimal slippage setting.","exampleAgentPrompt":"Before I swap 10000 USDC on the Base pool at address 0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d, can you analyze the sandwich attack risk and tell me the worst-case front-run profit and the best slippage tolerance I should set?","exampleUseCases":[{"title":"Pre-trade MEV risk check","prompt":"I'm about to sell 50000 USDT in the Aerodrome pool 0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d on Base with a 1% slippage tolerance — can you tell me how profitable a sandwich attack on my trade could be and what slippage I should actually use?"},{"title":"Optimal slippage setting for large swap","prompt":"I want to buy 200 ETH worth of tokens on the Ethereum pair 0xabc123def456... using a 2% slippage setting — analyze the MEV sandwich risk and suggest a safer slippage tolerance for me."},{"title":"DeFi bot safety audit for a swap strategy","prompt":"My trading bot is about to execute a sell of 5000 tokens on the BSC pool 0xdeadbeef... with 0.5% slippage and a 0.25% pool fee — what's the theoretical maximum sandwich profit an attacker could extract, and is there any profitable attack possible?"}],"resultDescription":"Returns a JSON object with: the DEX name, pool address, chain, trade side, victim input amount, victim's expected and minimum output, victim price impact percentage, maximum front-run size in token units, theoretical sandwich profit (in quote token units and as percentage of victim trade size), a risk label (e.g. NO_PROFITABLE_SANDWICH or a risk tier), the suggested slippage tolerance percentage, and metadata including the DexScreener source URL, computation model description, and timestamp.","failureModes":["Invalid or unrecognized pool address — API may return an error or empty reserves","Pool not found on DexScreener for the given chain — returns error or null data","Amount set to zero or negative — undefined behavior or error response","Slippage tolerance outside 0-50% range — may return validation error","Chain name not supported by DexScreener — lookup fails","Non-constant-product pool (e.g. concentrated liquidity, stable swap) — model results will be inaccurate as computation assumes x*y=k"],"whenToPreferThis":"Use this endpoint when you need a fast, theoretical worst-case MEV sandwich risk estimate for a constant-product AMM pool before executing a swap. It is ideal for DeFi agents, trading bots, or wallet UIs that want to warn users about front-running risk and recommend an appropriate slippage setting. It does not require mempool access or real-time bot competition data, so it gives a conservative upper-bound estimate rather than a prediction. Prefer this over general DeFi analytics when you specifically need sandwich attack profit calculations tied to current pool reserves from DexScreener.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:39:50.390Z","isFirstParty":false,"canonicalSlug":"mev-sandwich-risk-analyzer-7b263294"}