# ChainHilt Hyperliquid Trade Preview

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

Preview a Hyperliquid perpetual or spot trade with notional value, margin impact, slippage, liquidation estimate, exchange fees, and builder fee before execution.

## Facts

- Endpoint: POST https://chainhilt.ai/api/v1/perp/hyperliquid/trade/preview?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainhilt-hyperliquid-trade-preview-14f0121a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0A6ODNAwTFlrg3Z7V57Ke

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-hyperliquid-trade-preview-14f0121a -d '<json body>'
```

Example prompt: Before I place the order, preview a buy of 0.5 ETH on Hyperliquid for my wallet 0xAbCd1234...5678, with a limit price of 3500, 20 basis points slippage, and show me the notional, fees, and liquidation estimate.

## When to prefer this

Use this endpoint when an agent or user needs to simulate a Hyperliquid perpetual or spot trade before committing to execution — especially to surface fee costs, margin impact, slippage, and liquidation risk. Prefer this over generic quote endpoints when Hyperliquid-specific constructs like builder fees, unified account balance treatment, or L1 margin math are required.

## Known failure modes

- Invalid wallet address format returns validation error
- Unknown or delisted coin symbol returns not-found error
- Size of zero or negative returns schema validation error
- Limit price of zero may cause computation errors
- Taker or builder fee bps out of allowed range returns validation error
- Network or Hyperliquid API unavailability causes 5xx errors
- Unified account mode may return different margin calculations than expected

## How this service works

Preview a Hyperliquid trade with notional, margin impact, slippage, liquidation estimate, exchange fees, and builder fee. Errors: 400 invalid input, 502 provider failure. Treat spot and perp as one balance only when the account abstraction mode is "unifiedAccount".

## Output

Returns a preview object containing the notional value of the trade, estimated total exchange fee, builder fee, and (depending on parameters) margin impact, slippage, and liquidation price estimate. Optionally includes raw venue-level data if includeRaw is true.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "coin": {
   "type": "string",
   "maxLength": 32,
   "minLength": 1,
   "description": "Market symbol, e.g. \"ETH\"."
  },
  "side": {
   "enum": [
    "buy",
    "sell"
   ],
   "type": "string",
   "description": "\"buy\" or \"sell\"."
  },
  "size": {
   "type": "string",
   "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
   "description": "Order size as a decimal string."
  },
  "address": {
   "type": "string",
   "pattern": "^0x[a-fA-F0-9]{40}$",
   "description": "Account to preview the trade for."
  },
  "limitPx": {
   "type": "string",
   "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
   "description": "Reference price as a decimal string; defaults to the mid, then the best book price."
  },
  "includeRaw": {
   "type": "boolean",
   "description": "true to include the raw Hyperliquid payloads in the response."
  },
  "slippageBps": {
   "type": "integer",
   "maximum": 10000,
   "minimum": 0,
   "description": "Slippage in basis points applied to the reference price; defaults to 50."
  },
  "takerFeeBps": {
   "type": "number",
   "maximum": 100,
   "minimum": 0,
   "description": "Taker fee in basis points for the fee estimate; defaults to 4.5."
  },
  "builderFeeBps": {
   "type": "number",
   "maximum": 10,
   "minimum": 0,
   "description": "Accepted but ignored: the estimate uses the API's configured builder fee."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "preview": {
   "notional": "350.00",
   "builderFee": "0.0035",
   "estimatedFee": "0.1575"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainhilt-hyperliquid-trade-preview-14f0121a/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)
