# LogicNodes Swap Price Impact Calculator

> LogicNodes Swap Price Impact Calculator is a paid API for AI agents from logicnodes.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-29).

Calculates the price impact percentage of a token swap given input amount and liquidity pool reserves, accounting for swap fees.

## Facts

- Endpoint: POST https://logicnodes.io/paid/v1/tools/swap_price_impact?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/logicnodes-swap-price-impact-calculator-87021bbc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QlCrIIsXSPMqSWC8lUud1

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 logicnodes-swap-price-impact-calculator-87021bbc -d '<json body>'
```

Example prompt: What's the price impact if I swap 500 tokens into a pool with 100,000 tokens on the input side and 80,000 on the output side, with a 30 basis point fee?

## When to prefer this

Choose this endpoint when you need a precise, deterministic on-chain AMM price impact calculation for EVM-compatible constant-product pools before executing or simulating a swap. Prefer this over manual calculation when accuracy is critical for trade safety or arbitrage viability checks. Ideal for DeFi agents that need to validate trade sizes programmatically without connecting to a live RPC node.

## Known failure modes

- Invalid or zero reserve values causing division errors
- amountIn exceeding available liquidity
- feeBps outside 0-10000 range
- Missing required fields returning validation error
- Extremely large amountIn relative to reserves producing >100% impact edge cases

## How this service works

Exact answers for AI agents: 40+ tools for EVM chains and Aptos, gas on 14 chains, never a guess. Free tier; pay per call in USDC (x402) on 13 networks.

## Output

Returns a JSON object indicating success (ok: true) and the computed price impact result for the swap, representing how much the trade shifts the effective price relative to the pool's current spot price given the input amount, reserves, and fee.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "feeBps": {
   "type": "integer",
   "maximum": 10000,
   "minimum": 0
  },
  "amountIn": {
   "type": "string"
  },
  "reserveIn": {
   "type": "string"
  },
  "reserveOut": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "swap_price_impact"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/logicnodes-swap-price-impact-calculator-87021bbc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from logicnodes.io](https://www.zero.xyz/host/logicnodes.io/llms.txt)
