# CurveCall Buy Quote

> CurveCall Buy Quote is a paid API for AI agents from curvecall.onrender.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Computes the output token amount, average price, fee, and updated reserves for a bonding-curve buy trade given virtual reserves and input amount.

## Facts

- Endpoint: GET https://curvecall.onrender.com/v1/quote/buy?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/curvecall-buy-quote-e35c7fc3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NZIe6-Rl2lhHgpo_6-9VU

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 curvecall-buy-quote-e35c7fc3
```

Example prompt: Using a bonding curve with 30 quote-asset reserves and 1,072,521 token reserves, how many tokens would I get if I buy with 1 unit of the quote asset, assuming a 100 basis-point fee?

## When to prefer this

Use this endpoint when you need fast, pay-per-call bonding-curve buy-side math without running your own AMM simulation — ideal for AI agents that need real-time trade quotes, slippage estimates, or post-trade reserve projections on constant-product curves before executing or recommending a trade.

## Known failure modes

- Missing required fields (amount_in, quote_reserves, or token_reserves) returns a 4xx validation error
- Zero or negative reserve values may cause division-by-zero or invalid math errors
- amount_in larger than available liquidity may return zero or nonsensical output_out
- Payment not sent or incorrect x402 payment header returns 402 Payment Required
- Service temporarily unavailable on Render cold-start returns 5xx

## How this service works

Pay-per-call market math and token intel for AI agents, via x402.

## Output

Returns the number of tokens received (amount_out), the fee charged, the average price paid per token, the new token spot price after the trade, and the updated virtual quote and token reserves reflecting the post-trade state.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "queryParams": {
     "fee_bps": {
      "type": "number",
      "default": 100,
      "required": false,
      "description": "Curve fee in basis points"
     },
     "amount_in": {
      "type": "number",
      "required": true,
      "description": "Amount to trade"
     },
     "quote_reserves": {
      "type": "number",
      "required": true,
      "description": "Virtual quote-asset reserves (x)"
     },
     "token_reserves": {
      "type": "number",
      "required": true,
      "description": "Virtual token reserves (y)"
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "example": {
     "fee": 0.01,
     "side": "buy",
     "amount_in": 1,
     "amount_out": 34521.9,
     "price_after": 0.0000299,
     "average_price": 0.000029,
     "new_quote_reserves": 31,
     "new_token_reserves": 1038000
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/curvecall-buy-quote-e35c7fc3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from curvecall.onrender.com](https://www.zero.xyz/host/curvecall.onrender.com/llms.txt)
