# HALOWERK defiwerk MEV Risk Assessment

> HALOWERK defiwerk MEV Risk Assessment is a paid API for AI agents from defi.netzhandwerker.de, paid per call via x402, $0.006/call, status unknown (last checked 2026-09-13).

Assesses MEV (sandwich attack) risk for a token swap on EVM chains, scanning historical pool events and slippage to return a risk score.

## Facts

- Endpoint: POST https://defi.netzhandwerker.de/mev/risk
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/halowerk-defiwerk-mev-risk-assessment-ac418ba6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xVM4f6jT4szsd_Wj5fC8E

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 halowerk-defiwerk-mev-risk-assessment-ac418ba6 -d '<json body>'
```

Example prompt: Before I swap 500 USDC for WETH on Base with 50 bps slippage, can you check the MEV sandwich attack risk for that trade using the defiwerk MEV risk endpoint — scan the pool history too?

## When to prefer this

Choose this endpoint when you need on-chain MEV sandwich attack risk quantification for a specific EVM swap before execution, especially when historical pool data matters. It supports Base, Ethereum, Arbitrum, Optimism, and Polygon and accepts precise token addresses and amounts. Prefer this over generic slippage calculators when you want sandwich-attack-specific risk intelligence including historical frequency analysis. It is priced per-call via x402/USDC making it suitable for agentic, automated trading workflows.

## Known failure modes

- Invalid token address format (must be 0x hex, 40 chars) returns a validation error
- Unsupported chain value outside the allowed enum returns an error
- amount_in not provided as a valid decimal string causes rejection
- Payment not completed via x402/USDC returns 402 Payment Required
- Pool has insufficient historical data when scan_history is true may return limited results
- Network timeouts when scanning large pools with many historical events
- Invalid pool address in 'route' field returns validation error

## How this service works

HALOWERK defiwerk — bezahlte Endpunkte nach x402. Preise in USDC auf Base Mainnet.

## Output

Returns a structured MEV risk assessment for the specified token swap, including a risk score or rating indicating sandwich attack likelihood, optionally augmented with historical sandwich event data from past Swap events in the relevant pool, along with relevant pool details and risk factors.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "enum": [
    "base",
    "ethereum",
    "arbitrum",
    "optimism",
    "polygon"
   ],
   "type": "string"
  },
  "route": {
   "type": "string",
   "pattern": "^0x[a-fA-F0-9]{40}$",
   "description": "Optional pool address to assess instead of the automatically chosen one."
  },
  "token_in": {
   "type": "string",
   "pattern": "^0x[a-fA-F0-9]{40}$"
  },
  "amount_in": {
   "type": "string",
   "pattern": "^[0-9]+(\\.[0-9]+)?$",
   "description": "Input amount in whole token units as a decimal string."
  },
  "token_out": {
   "type": "string",
   "pattern": "^0x[a-fA-F0-9]{40}$"
  },
  "scan_history": {
   "type": "boolean",
   "default": true,
   "description": "Scan past Swap events for actual sandwiches. Costs time; switch off for a faster answer."
  },
  "slippage_bps": {
   "type": "integer",
   "default": 50,
   "maximum": 5000,
   "minimum": 1
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/halowerk-defiwerk-mev-risk-assessment-ac418ba6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi.netzhandwerker.de](https://www.zero.xyz/host/defi.netzhandwerker.de/llms.txt)
