# ChainHilt Polymarket Quote

> ChainHilt Polymarket Quote is a paid API for AI agents from chainhilt.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-17).

Returns a deterministic, order-book-walked price quote for buying or selling shares on a Polymarket prediction market, including estimated venue fees, without reserving any position.

## Facts

- Endpoint: POST https://chainhilt.ai/api/v1/predict/polymarket/quotes?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainhilt-polymarket-quote-fb9440b3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XfGAd_VJlhrC8JZK0Ffj6

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 chainhilt-polymarket-quote-fb9440b3 -d '<json body>'
```

Example prompt: What's the current buy quote for 50 shares of the 'Yes' outcome on Polymarket market abc123 using outcome token xyz789 — tell me the total collateral cost and estimated fee, with a max price of 0.72 per share.

## When to prefer this

Use this endpoint when you need a deterministic, order-book-accurate price quote for a Polymarket trade before committing to execution. Prefer it over generic market data endpoints when you need slippage-aware pricing (book walk), Polymarket-specific taker fee estimation, and support for both share-denominated and collateral-denominated sizing. Ideal for pre-trade validation, position sizing, and max-price feasibility checks without side effects.

## Known failure modes

- 400 Bad Request: invalid input parameters (malformed amount, bad pattern for marketId, maxPrice out of 0-1 range)
- 422 Unprocessable Entity: untradable market, mismatched outcomeTokenId for given marketId, or order book too thin to fill the requested amount
- 502 Bad Gateway: Polymarket venue is unreachable or returning errors
- maxPrice constraint not satisfiable causes rejection rather than partial fill
- null estimatedVenueFee when the market uses a fee type the API cannot price

## How this service works

Deterministic prediction-market quote from the live order book: integer micro-unit book walk (buys round principal up, sells round proceeds down). `estimatedVenueFee` is Polymarket's own taker fee at the average price (shares × rate × p × (1 − p), from the market's live fee schedule; null when the venue reports a fee type this API cannot price). Informational only — nothing is reserved. Errors: 400 invalid input, 422 untradable market, wrong token or thin book, 502 venue failure.

## Output

Returns a deterministic order-book-walked quote including: the average fill price per share, total cost in micro-units (collateral for buys or shares for sells rounded per side), estimated Polymarket taker fee (estimatedVenueFee, null if unpriced fee type), and depth consumed from the live order book. Nothing is reserved or executed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "side": {
   "enum": [
    "buy",
    "sell"
   ],
   "type": "string",
   "description": "buy walks the asks, sell walks the bids."
  },
  "amount": {
   "type": "string",
   "pattern": "^[0-9]+(\\.[0-9]{1,6})?$",
   "description": "Shares or pUSD per `amountType`, up to 6 decimals."
  },
  "marketId": {
   "type": "string",
   "pattern": "^[A-Za-z0-9_-]{1,128}$",
   "description": "Polymarket market id from markets/search."
  },
  "maxPrice": {
   "type": "string",
   "pattern": "^0\\.[0-9]{1,6}$",
   "description": "Worst acceptable price per share (0-1): a ceiling for buys, a floor for sells."
  },
  "amountType": {
   "enum": [
    "shares",
    "collateral"
   ],
   "type": "string",
   "description": "Whether `amount` counts shares or pUSD (spent on a buy, received on a sell)."
  },
  "outcomeTokenId": {
   "type": "string",
   "minLength": 1,
   "description": "The outcome's `tokenId` from the market's `outcomes`; must belong to `marketId`."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "quote": {
   "side": "buy",
   "marketId": "512329",
   "validUntil": "2026-01-01T00:00:30.000Z",
   "worstPrice": "0.44",
   "averagePrice": "0.4312",
   "outcomeTokenId": "111",
   "priceImpactBps": 12,
   "estimatedShares": "10",
   "estimatedVenueFee": {
    "asset": "pUSD",
    "amount": "0.098107"
   },
   "estimatedPrincipal": {
    "asset": "pUSD",
    "amount": "4.312"
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainhilt-polymarket-quote-fb9440b3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chainhilt.ai](https://www.zero.xyz/host/chainhilt.ai/llms.txt)
