# DEX Depth & Slippage Calculator

> DEX Depth & Slippage Calculator is a paid API for AI agents from api.fadeandco.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-29).

Calculates estimated output, price impact, and minimum output for a token swap on a single DEX pair using constant-product (x*y=k) math with reserves fetched from DexScreener.

## Facts

- Endpoint: GET https://api.fadeandco.workers.dev/api/agent-intel/dex-depth-slippage-calculator?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dex-depth-slippage-calculator-77e5ae2d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CGfEwlUutMuSOZPo6BobT

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 dex-depth-slippage-calculator-77e5ae2d
```

Example prompt: Using the constant-product slippage calculator, estimate how much USDC I'd get selling 1000 AERO on the Aerodrome pool at 0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d on Base, with a 0.3% fee and 0.5% slippage tolerance.

## When to prefer this

Choose this endpoint when you need a quick, inexpensive off-chain estimate of swap output, price impact, and minimum received for a constant-product AMM pair on EVM chains (Base, Ethereum, Arbitrum, etc.) without connecting to an RPC node. It is ideal for pre-trade analysis, bot trade sizing, and slippage checks on Uniswap V2-style and Aerodrome volatile pools. Avoid it for exact quotes on concentrated-liquidity (V3/V4) pools or Raydium, where the x*y=k model is only an approximation.

## Known failure modes

- Pair address not found on DexScreener — returns error or empty reserves
- Concentrated-liquidity (V3/V4) pools return only an approximation, not exact output
- Raydium pools are explicitly not supported
- Invalid chain name causes lookup failure
- Amount of zero or negative triggers validation error
- Slippage or fee out of allowed range (0–50% / 0–5%) rejected

## How this service works

Estimated output, price impact and minimum output for a swap in one DEX pair, using the pair's reserves from DexScreener and a constant-product (x*y=k) model with a fee. Exact for constant-product pools (for example Aerodrome volatile pools, Uniswap V2 style); for concentrated-liquidity pools (labelled v3 or v4) it is only an approximation. Raydium is not covered.

## Output

Returns a JSON object with: DEX name, pair address, chain, trade side, AMM model description, fee percentage, slippage tolerance, amount in, spot output (no fee/impact), estimated output after fee and price impact, price impact percentage, minimum output at the specified slippage, base and quote token symbols, pool reserves, data source URL, and timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "pair",
      "amount"
     ],
     "properties": {
      "pair": {
       "type": "string",
       "description": "Pair (pool) address"
      },
      "side": {
       "type": "string",
       "description": "sell = you give the base token; buy = you give the quote token (default sell)"
      },
      "chain": {
       "type": "string",
       "description": "DexScreener chain name, e.g. base, ethereum, arbitrum (default base)"
      },
      "amount": {
       "type": "string",
       "description": "Amount you give, in that token's units (positive number)"
      },
      "feePct": {
       "type": "string",
       "description": "Pool fee in percent, 0 to 5 (default 0.3)"
      },
      "slippagePct": {
       "type": "string",
       "description": "Your tolerance in percent, 0 to 50 (default 0.5)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "dex": "aerodrome",
  "pair": "0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d",
  "side": "sell",
  "chain": "base",
  "model": "constant-product x*y=k (exact for V2-style pools)",
  "feePct": 0.3,
  "source": "https://api.dexscreener.com/latest/dex/pairs/base/0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d",
  "spotOut": 784.33261888,
  "amountIn": 1000,
  "reserves": {
   "base": 7324900,
   "quote": 5745158
  },
  "checkedAt": "2026-10-23T09:35:18.273Z",
  "baseSymbol": "AERO",
  "quoteSymbol": "USDC",
  "slippagePct": 0.5,
  "estimatedOut": 781.87319942,
  "priceImpactPct": 0.3136,
  "minOutAtSlippage": 777.96383342
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/dex-depth-slippage-calculator-77e5ae2d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fadeandco.workers.dev](https://www.zero.xyz/host/api.fadeandco.workers.dev/llms.txt)
