{"uid":"cap_JDtL7115XQPoajdOJQ34l","slug":"x402-sandwich-mev-risk-scorer-for-swaps-c9312eda","name":"x402 Sandwich/MEV Risk Scorer for Swaps","description":"Sandwich / MEV risk score for a planned swap, from price impact and trade size, with concrete mitigations (private RPC, tighter slippage, order splitting). Send { chain, tokenIn, tokenOut, amountIn }. Trade without getting sandwiched.","url":"https://x402-services-production.up.railway.app/api/exec/sandwich","method":"POST","headers":{},"bodySchema":{"type":"object","required":["amountIn","tokenIn","tokenOut"],"properties":{"chain":{"type":"string","description":"Chain, default base"},"tokenIn":{"type":"string","description":"0x token to sell"},"amountIn":{"type":"string","description":"Amount in smallest units"},"tokenOut":{"type":"string","description":"0x token to buy"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_sMHcvia28RRKDYbu2Dx7e","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Scores the MEV/sandwich attack risk for a planned token swap based on price impact and trade size, and returns concrete mitigations like private RPC usage, slippage tightening, and order splitting.","exampleAgentPrompt":"Before I swap 50000000000000000000 USDC for WETH on Base, can you check the sandwich/MEV risk score — tokenIn is 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, tokenOut is 0x4200000000000000000000000000000000000006 — and tell me what mitigations I should apply?","exampleUseCases":[{"title":"Check front-run risk before swap","prompt":"I'm about to swap 10 ETH worth of tokens into a small-cap memecoin on Base — can you run a sandwich attack risk check for me first? tokenIn is 0x4200000000000000000000000000000000000006, tokenOut is 0x532f27101965dd16442E59d40670FaF5eBB142E4, amountIn is 10000000000000000000. Tell me the risk score and what I should do to protect myself."},{"title":"Decide whether to split large order","prompt":"I want to swap 500,000 USDC into WETH on Base but I'm worried it's too big and I'll get sandwiched. Can you assess the MEV risk for that trade — tokenIn 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, tokenOut 0x4200000000000000000000000000000000000006, amountIn 500000000000 — and let me know if I should split it up or tighten my slippage instead?"},{"title":"Evaluate private RPC necessity for trade","prompt":"Before I execute this swap on Base, I want to know if it's worth routing through a private RPC like Flashbots Protect. It's a 25 ETH swap from WETH to USDC — tokenIn 0x4200000000000000000000000000000000000006, tokenOut 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, amountIn 25000000000000000000. What's the sandwich risk score and do the mitigations actually recommend private RPC here?"}],"resultDescription":"A MEV/sandwich risk score for the planned swap derived from price impact and trade size, along with specific actionable mitigations such as using a private RPC endpoint, tightening slippage tolerance, or splitting the order into smaller trades to reduce exposure.","failureModes":["Missing required fields (tokenIn, tokenOut, amountIn) returns a 400 validation error","Invalid or unrecognized token address returns an error or low-confidence score","Unsupported chain returns an error or defaults to Base","Payment not included or insufficient USDC causes a 402 Payment Required response","Network timeout or upstream data unavailability results in a 5xx error"],"whenToPreferThis":"Use this endpoint when an agent or user is about to execute a DEX swap and wants to quantify MEV/sandwich risk before committing to the trade. It is especially valuable for larger trades on Base or other EVM chains where price impact is significant. Prefer this over generic slippage calculators when you also need actionable mitigation advice (private RPC, order splitting) rather than just a price estimate.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:53:53.855Z","isFirstParty":false}