# Constant-Product Swap Output Estimate — Single Calculation

> Constant-Product Swap Output Estimate — Single Calculation is a paid API for AI agents from market.datapackvibe.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-12-01).

Calculates the estimated output token amount for a constant-product AMM swap given input tokens, reserves, and fee percentage.

## Facts

- Endpoint: POST https://market.datapackvibe.com/x402/assistant-bx-token-cp-output-calculate?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/constant-product-swap-output-estimate-single-calculation-db0edf4f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AUWZPw2gSvuYHvLoEv-c3

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 constant-product-swap-output-estimate-single-calculation-db0edf4f -d '<json body>'
```

Example prompt: Calculate how many output tokens I'd get if I swap 100 input tokens, with an input reserve of 10000, output reserve of 20000, and a 0.3% fee using the constant-product formula.

## When to prefer this

Choose this endpoint when you need a fast, deterministic constant-product AMM swap output estimate for a single set of parameters without requiring live on-chain data, real-time price feeds, or trade execution. Ideal for pre-trade analysis, slippage estimation, educational tools, or building DeFi calculators where x*y=k formula accuracy is sufficient.

## Known failure modes

- Input tokens or reserves set to zero or negative values — schema enforces exclusiveMinimum > 0
- Fee percentage outside 0–100 range — schema validation error
- Missing required fields (input_reserve, output_reserve, input_tokens, fee_percent) — request rejected
- Extremely large values near the maximum (1e16) may produce numerical precision edge cases

## How this service works

Constant-product swap output estimate — Single calculation: Single calculation for Constant-product swap output estimate. Supplied token observations only. Deterministic calculation or caller-threshold verdict, not a live scan, safety proof or trade recommendation. Specialised preset in a shared 50-profile, 20-operation engine. 0.01 USDC includes one bounded single calculation report.

## Output

Returns a deterministic numeric estimate of the output token amount produced by a constant-product (x*y=k) AMM swap, given the specified input amount, pool reserves, and fee percentage. The result is a bounded single-calculation report, not a live quote or safety recommendation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "values": {
   "type": "object",
   "default": {
    "fee_percent": 0.3,
    "input_tokens": 100,
    "input_reserve": 10000,
    "output_reserve": 20000
   },
   "required": [
    "input_reserve",
    "output_reserve",
    "input_tokens",
    "fee_percent"
   ],
   "properties": {
    "fee_percent": {
     "type": "number",
     "default": 0.3,
     "maximum": 100,
     "minimum": 0
    },
    "input_tokens": {
     "type": "number",
     "default": 100,
     "maximum": 10000000000000000,
     "minimum": 0,
     "exclusiveMinimum": 0
    },
    "input_reserve": {
     "type": "number",
     "default": 10000,
     "maximum": 10000000000000000,
     "minimum": 0,
     "exclusiveMinimum": 0
    },
    "output_reserve": {
     "type": "number",
     "default": 20000,
     "maximum": 10000000000000000,
     "minimum": 0,
     "exclusiveMinimum": 0
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/constant-product-swap-output-estimate-single-calculation-db0edf4f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market.datapackvibe.com](https://www.zero.xyz/host/market.datapackvibe.com/llms.txt)
