{"uid":"cap_0A6ODNAwTFlrg3Z7V57Ke","slug":"chainhilt-hyperliquid-trade-preview-14f0121a","name":"ChainHilt Hyperliquid Trade Preview","description":"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\".","url":"https://chainhilt.ai/api/v1/perp/hyperliquid/trade/preview?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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."}}},"responseSchema":{"type":"json","example":{"preview":{"notional":"350.00","builderFee":"0.0035","estimatedFee":"0.1575"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8O1vy25PodbkDtSt7bUDk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Preview a Hyperliquid perpetual or spot trade with notional value, margin impact, slippage, liquidation estimate, exchange fees, and builder fee before execution.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Pre-trade fee estimation for perp","prompt":"I want to short 100 SOL-PERP on Hyperliquid from my wallet 0xDeAdBeEf...1234 at a limit price of 150 with 10 bps slippage — can you preview the trade and show me the estimated fees, notional value, and margin impact before I sign anything?"},{"title":"Liquidation risk check before leverage trade","prompt":"Before I go long on BTC perp with 0.02 BTC at a limit of 68000 on Hyperliquid from wallet 0xAaBb...9900, preview the trade and tell me the liquidation estimate and margin impact so I can decide if the leverage is too risky."},{"title":"Builder fee comparison for large order","prompt":"I'm about to place a sell of 5000 USDC worth of ARB-PERP on Hyperliquid from 0x1122...3344 at limit price 1.20 — preview it with 5 bps builder fee and 15 bps taker fee so I can see exactly what the builder and exchange fees will be."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-16T18:38:08.654Z","isFirstParty":false,"canonicalSlug":"chainhilt-hyperliquid-trade-preview-14f0121a"}