# SignalHarness DeFi Constant Product AMM Quote

> SignalHarness DeFi Constant Product AMM Quote is a paid API for AI agents from signalharness.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Computes a constant-product AMM (x*y=k) price quote given caller-supplied swap parameters, returning the expected output amount and any warnings.

## Facts

- Endpoint: POST https://signalharness.ai/api/agent/services/defi_constant_product_quote/invoke
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/signalharness-defi-constant-product-amm-quote-9fe56b04
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BIJhP7YYrUNILmhaWy-aQ

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 signalharness-defi-constant-product-amm-quote-9fe56b04 -d '<json body>'
```

Example prompt: Can you calculate a constant product AMM quote for swapping 500 USDC for ETH in a pool with 1,000,000 USDC and 400 ETH reserve — I need the expected output and any slippage warnings before I execute the trade.

## When to prefer this

Choose this endpoint when you need a fast, deterministic constant-product (x*y=k) AMM price quote computation without executing an on-chain transaction. It is ideal for pre-trade simulation, slippage estimation, and arbitrage analysis on any token pair where you supply the pool reserves. Prefer it over on-chain RPC calls when you want a hosted, auditable computation with a verifiable receipt on Base.

## Known failure modes

- Malformed amm_quote_request JSON string causes a parse error or validation failure
- Pool reserve values of zero or near-zero may produce division-by-zero or nonsensical quotes with warnings
- Extremely large swap amounts relative to pool size may produce warnings about excessive price impact
- Payment failure (insufficient USDC balance or x402 protocol error) prevents execution
- Missing required fields in the quote request body result in an error response

## How this service works

Explore 330 pay-per-call x402 API services and 27 agent-native digital products, with Base USDC pricing, secure Polar checkout, and free discovery.

## Output

Returns a JSON object containing the computed AMM quote (expected output token amount), a list of warnings (e.g. high slippage, insufficient liquidity), the service ID, a receipt with payment details, network info (Base/eip155:8453), execution timing metadata, and a SHA-256 result hash for verification.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "amm_quote_request": {
   "type": "string",
   "maxLength": 65536,
   "minLength": 2
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "replay": false,
  "result": {
   "warnings": [
    "Quote ignores routing, MEV, state changes, and token transfer fees."
   ],
   "amm_quote": "{\"amount_out\":\"19.743160687941225977\",\"effective_amount_in\":\"9.97\",\"execution_price\":\"1.974316068794122597\",\"invariant_model\":\"constant_product\",\"price_impact_percent\":\"1.284196560293\",\"spot_price\":\"2\"}",
   "service_id": "defi_constant_product_quote",
   "evidence_scope": "caller_supplied_data"
  },
  "status": "succeeded",
  "receipt": {
   "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
   "usage": [],
   "status": "succeeded",
   "network": "eip155:8453",
   "artifacts": [],
   "endedAtMs": 0,
   "latencyMs": 0,
   "paymentId": "example-payment",
   "receiptId": "example-receipt",
   "requestId": "example-request",
   "serviceId": "defi_constant_product_quote",
   "executionId": "example-execution",
   "startedAtMs": 0,
   "amountAtomic": "10000",
   "resultSha256": "d1a78a0d4930acab76da52d0b9e24363dfa1c252833e800052a18ee8c9d2abfb",
   "serviceVersion": "1.0.0",
   "settlementReference": "0x0000000000000000000000000000000000000000000000000000000000000000"
  },
  "artifacts": [],
  "requestId": "example-request",
  "executionId": "example-execution"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/signalharness-defi-constant-product-amm-quote-9fe56b04/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from signalharness.ai](https://www.zero.xyz/host/signalharness.ai/llms.txt)
