# AMM Price Impact (bps)

> AMM Price Impact (bps) is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Computes the price impact in basis points for a swap against AMM reserves using deterministic constant-product math, returning mid-price vs execution price comparison.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/amm-price-impact-bps
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/amm-price-impact-bps-9e75d849
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iWx7sbOMmcmAUV5YqfyiD

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-price-impact-bps-9e75d849 -d '<json body>'
```

Example prompt: Before I execute this swap, can you calculate the AMM price impact in basis points? I'm swapping 5000 units in, the pool has 1000000 units reserve_in and 800000 units reserve_out, with a 30 bps fee.

## When to prefer this

Choose this endpoint when you need a fast, deterministic, offline-style calculation of AMM price impact using the constant-product (x*y=k) formula before submitting a trade. It requires no RPC calls, no live market data, no API keys, and no external dependencies — making it ideal for pre-trade guardrails, simulation loops, backtesting pipelines, or any context where you already have pool reserve data and need a reliable impact estimate in basis points.

## Known failure modes

- Missing required fields (amount_in, reserve_in, reserve_out) returns a validation error
- Zero reserve values cause division-by-zero errors
- Extremely large amount_in relative to reserves may produce >100% impact values that must be interpreted carefully
- Invalid types (non-integer inputs) result in schema validation failures
- Payment failure via x402 protocol prevents endpoint access

## How this service works

AMM price impact in bps for a swap input against reserves. Call when pre-trade impact checks for pool size vs order size. Returns impact bps and mid vs execution as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.

## Output

Returns a deterministic JSON object containing the price impact in basis points, the mid price derived from pool reserves, and the execution price after applying the constant-product formula and fee, computed entirely from the supplied inputs with no external data calls.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "fee_bps": {
   "type": "integer",
   "description": "Input field: fee bps."
  },
  "amount_in": {
   "type": "integer",
   "description": "Input field: amount in."
  },
  "reserve_in": {
   "type": "integer",
   "description": "Input field: reserve in."
  },
  "reserve_out": {
   "type": "integer",
   "description": "Input field: reserve out."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": "delx/util-amm-price-impact-bps/v1",
  "amount_in": 50,
  "amount_out": 47.48297375815593,
  "impact_bps": 530.0902708124378
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/amm-price-impact-bps-9e75d849/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
