# Basebuilder2 Trading - Mempool Sandwich Detection

> Basebuilder2 Trading - Mempool Sandwich Detection is a paid API for AI agents from bbx-trading.vercel.app, paid per call via x402, $0.115906/call, status unknown (last checked 2026-10-23).

Detects and analyzes sandwich attack opportunities or risks in the mempool for a given transaction

## Facts

- Endpoint: POST https://bbx-trading.vercel.app/api/mempool/sandwich?utm_source=zero.xyz
- Price: $0.115906/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/basebuilder2-trading-mempool-sandwich-detection-b0192d72
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4r8MPenNd8Gdusc0QOG7G

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability basebuilder2-trading-mempool-sandwich-detection-b0192d72 -d '<json body>'
```

Example prompt: Scan the mempool for sandwich attack risk on my pending USDC/ETH swap — I'm trading 5 ETH with 0.5% slippage tolerance, and I want to know if there are any active bots that could front-run or back-run this transaction.

## When to prefer this

Use this endpoint when you need real-time sandwich attack detection or MEV risk analysis for DeFi transactions before or during mempool submission. Prefer this over generic mempool APIs when you specifically need sandwich attack pattern recognition with profit/loss estimates. Best suited for DeFi traders, MEV researchers, and bot operators on the BBX Trading platform who want structured sandwich analysis rather than raw mempool data.

## Known failure modes

- Invalid or missing transaction parameters returns 400 error
- Mempool data unavailable or stale during network congestion
- Payment of 0.115906 USDC not fulfilled returns 402
- Transaction already mined before analysis completes
- Unsupported chain or token pair returns error
- Rate limiting if too many requests submitted rapidly

## How this service works

BaseBuilder Trading API hub - 20 paid endpoints

## Output

Returns analysis of sandwich attack risk or opportunity for the specified transaction, including identification of potential front-run and back-run positions, estimated profit/loss exposure, active bot addresses, and recommended mitigations or confirmation that the transaction is safe to proceed.

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/basebuilder2-trading-mempool-sandwich-detection-b0192d72/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bbx-trading.vercel.app](https://www.zero.xyz/host/bbx-trading.vercel.app/llms.txt)
