# AMM Invariant Monitor

> AMM Invariant Monitor is a paid API for AI agents from mev.halowerk.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-23).

Analyzes caller-supplied evidence to detect AMM invariant deviations, reserve mismatches, and unexplained deltas, returning a confidence-weighted classification with explicit thresholds.

## Facts

- Endpoint: POST https://mev.halowerk.com/v1/amm-invariant-monitor?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/amm-invariant-monitor-381d2fd5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_48zBN1QcGlitmi6tpYlzI

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 amm-invariant-monitor-381d2fd5 -d '<json body>'
```

Example prompt: Check this AMM pool address 0xABC123...def for invariant violations — I have an invariant deviation of 2.3%, a reserve mismatch of 0.8%, and 4 unexplained deltas observed at 2024-06-15T14:32:00Z from my Uniswap subgraph query.

## When to prefer this

Use this endpoint when you have caller-supplied AMM metric observations and need a fast, explainable invariant-health classification without requiring direct chain access — especially useful for MEV alerting pipelines, pre-trade risk checks, or audit workflows where you already have reserve and delta data extracted from subgraphs, RPC nodes, or block explorers.

## Known failure modes

- Missing required evidence items cause reduced confidence or rejection in strict mode
- Malformed ISO-8601 timestamps result in evidence being ignored or errored
- Supplying no evidence or an empty array returns a validation error
- Strict mode enabled with incomplete metrics returns a rejection response
- Unrecognized metric names are rejected by schema validation

## How this service works

AMM Invariant Monitor analyses only the evidence supplied by the caller. It does not claim to query a chain, identify a legal status or replace an independent audit. Missing signals lower confidence and are listed explicitly; every classification includes the exact thresholds used.

## Output

Returns a classification of the AMM pool's invariant health with confidence score, the exact thresholds applied, a list of any missing signals that lowered confidence, and the assessed values for invariant_deviation_pct, reserve_mismatch_pct, and unexplained_delta_count based on the newest-timestamped evidence supplied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "strict": {
   "type": "boolean",
   "default": false,
   "description": "Reject unless all documented metrics are supplied."
  },
  "context": {
   "type": "object",
   "description": "Optional non-secret labels returned unchanged for correlation.",
   "maxProperties": 20,
   "additionalProperties": {
    "type": [
     "string",
     "number",
     "boolean",
     "null"
    ]
   }
  },
  "subject": {
   "type": "string",
   "maxLength": 256,
   "minLength": 1,
   "description": "Address, transaction, protocol, asset, proposal or other subject being assessed."
  },
  "evidence": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "metric",
     "value"
    ],
    "properties": {
     "note": {
      "type": "string",
      "maxLength": 500
     },
     "value": {
      "type": [
       "number",
       "boolean"
      ]
     },
     "metric": {
      "enum": [
       "invariant_deviation_pct",
       "reserve_mismatch_pct",
       "unexplained_delta_count"
      ],
      "type": "string"
     },
     "source": {
      "type": "string",
      "maxLength": 300,
      "minLength": 1,
      "description": "Evidence source or query identifier."
     },
     "timestamp": {
      "type": "string",
      "maxLength": 40,
      "minLength": 10,
      "description": "ISO-8601 observation time."
     }
    },
    "additionalProperties": false
   },
   "maxItems": 50,
   "minItems": 1,
   "description": "Caller-supplied observations. Repeated metrics form a time series; the newest timestamp is assessed."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/amm-invariant-monitor-381d2fd5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mev.halowerk.com](https://www.zero.xyz/host/mev.halowerk.com/llms.txt)
