# Price Impact Calculator

> Price Impact Calculator is a paid API for AI agents from 402.com.tr, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-16).

Computes the exact x*y=k constant-product price impact percentage for a given USD trade size on a token's deepest Base pool, and returns the largest sizes under 1% and 3% impact thresholds.

## Facts

- Endpoint: GET https://402.com.tr/api/x402/price-impact?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/price-impact-calculator-c098d57f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WgeLSGPbFZOFaksIJiyQc

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 price-impact-calculator-c098d57f
```

Example prompt: Before I swap $8,000 into the token at 0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed on Base, can you calculate the price impact so I know if it's safe to proceed?

## When to prefer this

Use this endpoint when you need a quick, conservative pre-trade price impact estimate for a token on Base using constant-product AMM math, especially to determine safe trade sizes under 1% or 3% impact thresholds. It is better than a live quote for understanding structural liquidity limits without executing a swap. Prefer this over on-chain quote endpoints when you want a size-threshold analysis (e.g. 'how big can I trade safely') rather than just a single-price quote.

## Known failure modes

- Invalid or unrecognized token contract address returns an error or empty result
- Token with no Base liquidity pool found returns no data
- Extremely small pools may produce 100% impact estimates that are technically correct but impractical
- Network or RPC issues fetching pool data may cause timeouts
- Size parameter missing or non-numeric causes a bad request error

## How this service works

A quote shows today's price; it does NOT tell you a $5k buy into a $20k pool pays ~20% more. This takes the token's deepest Base pool, treats it as constant-product (Uniswap-V2 / Aerodrome volatile) and computes the exact x*y=k price impact for your USD size. Conservative — concentrated-liquidity pools usually do better. Also returns the largest size under 1% and 3% impact. Pass address= and size= (USD). An estimate; confirm with swap-route. Not financial advice.

## Output

Returns the estimated price impact percentage for the requested USD trade size modeled as a constant-product AMM (x*y=k), along with the maximum trade sizes that stay below 1% and 3% impact thresholds. The response is conservative relative to concentrated-liquidity pools and is labeled as an estimate.

## 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"
    },
    "pathParams": {
     "type": "object"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address",
      "size"
     ],
     "properties": {
      "side": {
       "type": "string",
       "description": "buy or sell (default buy)"
      },
      "size": {
       "type": "string",
       "description": "Trade size in USD"
      },
      "address": {
       "type": "string",
       "description": "Token contract address"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/price-impact-calculator-c098d57f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402.com.tr](https://www.zero.xyz/host/402.com.tr/llms.txt)
