# QuantOracle DEX Slippage Calculator

> QuantOracle DEX Slippage Calculator is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Calculates DEX trade slippage, price impact, output amount, and effective price for an AMM swap given pool reserves, trade size, fee, and direction

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/crypto/dex-slippage
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-quantoracle-dev-fc72c808
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DwCX_uOB5egN_2beNimzD

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 api-quantoracle-dev-fc72c808 -d '<json body>'
```

Example prompt: I'm about to swap 10,000 units of token A for token B on a DEX pool with 5,000,000 units of token A and 2,000 units of token B reserves, a 30 bps fee, trading in the a_to_b direction — what will the slippage, price impact, and output amount be?

## When to prefer this

Use this endpoint when you need fast, precise AMM slippage and price impact calculations for DEX trades without connecting to an on-chain node. Ideal for pre-trade simulation, order routing, portfolio rebalancing logic, or any workflow that needs to estimate DEX execution quality programmatically. Prefer over on-chain calls when latency, cost, or infrastructure complexity matters.

## Known failure modes

- Invalid trade direction (must be 'a_to_b' or 'b_to_a')
- Zero or negative reserve values causing division by zero
- Trade amount larger than available pool reserves
- Negative or out-of-range fee_bps value
- Missing required fields returns validation error
- Payment failure or insufficient USDC balance (x402 protocol)

## How this service works

QuantOracle: crypto/dex-slippage

## Output

Returns slippage in basis points, price impact percentage, output amount of the received token, effective execution price, spot price, fee amount charged, and minimum output amount under 1% slippage tolerance. Also includes computation latency in milliseconds.

## Example request

```json
{
 "fee": 0.003,
 "direction": "a_to_b",
 "reserve_a": 5000000,
 "reserve_b": 2000000,
 "trade_amount": 10000
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "fee_bps": {
   "type": "integer",
   "title": "Fee Bps",
   "default": 30,
   "description": "DEX fee in basis points (e.g. 30 = 0.3%)"
  },
  "reserve_a": {
   "type": "number",
   "title": "Reserve A",
   "description": "Pool reserve of token A",
   "exclusiveMinimum": 0
  },
  "reserve_b": {
   "type": "number",
   "title": "Reserve B",
   "description": "Pool reserve of token B",
   "exclusiveMinimum": 0
  },
  "trade_amount": {
   "type": "number",
   "title": "Trade Amount",
   "description": "Amount of input token to swap",
   "exclusiveMinimum": 0
  },
  "trade_direction": {
   "enum": [
    "a_to_b",
    "b_to_a"
   ],
   "type": "string",
   "title": "Trade Direction",
   "default": "a_to_b",
   "description": "Swap direction"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-fc72c808/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.quantoracle.dev](https://www.zero.xyz/host/api.quantoracle.dev/llms.txt)
