{"uid":"cap_PRdNzw9v8QVol8k8xDLlv","slug":"chainhilt-twap-order-preview-hyperliquid-perp-spot-ee5a7fe5","name":"ChainHilt TWAP Order Preview (Hyperliquid Perp/Spot)","description":"Discover, pay for, and execute the on-chain actions your agent needs. No API keys. Compatible with x402. Your wallet stays local.","url":"https://chainhilt.ai/api/v1/perp/hyperliquid/twap/place/preview?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"nonce":{"type":"integer","minimum":0,"description":"Action nonce in milliseconds since the epoch; defaults to the current time."},"action":{"type":"object","required":["type","twap"],"properties":{"twap":{"type":"object","required":["a","b","s","r","m","t"],"properties":{"a":{"type":"integer","maximum":99999,"minimum":0,"description":"Asset ID from /perp/hyperliquid/asset-id; builder-deployed perps (100000+) are not supported."},"b":{"type":"boolean","description":"true to buy, false to sell."},"m":{"type":"integer","maximum":10080,"minimum":5,"description":"Duration in minutes, from 5 to 10,080 (7 days)."},"r":{"type":"boolean","description":"true for reduce-only."},"s":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Total size as a decimal string."},"t":{"type":"boolean","description":"true to randomize slice timing."}},"description":"TWAP parameters in Hyperliquid wire order.","additionalProperties":false},"type":{"type":"string","const":"twapOrder","description":"Always \"twapOrder\"."}},"description":"TWAP order action.","additionalProperties":false},"expiresAfter":{"type":"integer","minimum":0,"description":"Millisecond timestamp after which Hyperliquid rejects the action. Signed with the action."},"vaultAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Vault or subaccount to act for; omit to act for the signer. Signed with the action."},"accountAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Signing account's address, returned as response metadata; not part of the signed action."}}},"responseSchema":{"type":"json","example":{"response":{"errors":[],"actions":[{"data":{"nonce":1710000000000,"action":{"twap":{"a":0,"b":true,"m":30,"r":false,"s":"0.01","t":true},"type":"twapOrder"},"typedData":{"types":{"Agent":[{"name":"source","type":"string"},{"name":"connectionId","type":"bytes32"}],"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}]},"domain":{"name":"Exchange","chainId":1337,"version":"1","verifyingContract":"0x0000000000000000000000000000000000000000"},"message":{"source":"a","connectionId":"0x39c45888f5aa540c7605aac5a1a4316347ba09f9948095174ff50dc1069e980c"},"primaryType":"Agent"}},"type":"signature","chainId":42161,"protocol":"hyperliquid","submitPath":"/perp/hyperliquid/twap/place/execute"}],"warnings":[]}}},"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_cly3FOfWFGnsBJqs-8GpA","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":"Prepares a TWAP (Time-Weighted Average Price) order for Hyperliquid perpetual or spot markets, returning EIP-712 typed data for L1 signing before submission.","exampleAgentPrompt":"Prepare a TWAP buy order on Hyperliquid for asset ID 0, size 0.5, duration 30 minutes, with randomize enabled and reduce-only off, using my account 0xAbC1234567890abcdef1234567890abcdef123456 — I'll sign and submit it myself.","exampleUseCases":[{"title":"Gradual ETH perp accumulation via TWAP","prompt":"Set up a TWAP buy order on Hyperliquid for the ETH perpetual (asset 1), total size 2.0, spread over 60 minutes, with randomize on and reduce-only off, for account 0xAbC1234567890abcdef1234567890abcdef123456 — give me the signing data."},{"title":"Reduce-only TWAP exit for a losing position","prompt":"I need to close out part of my Hyperliquid perp position gradually — prepare a reduce-only TWAP sell order for asset 2, size 1.5, duration 120 minutes, no randomize, for my account 0xDef9876543210fedcba9876543210fedcba987654."},{"title":"Spot market TWAP order over two hours","prompt":"Prepare a TWAP order on Hyperliquid spot for asset 5, buying 50 tokens, spread over 120 minutes with randomize enabled, using my unified account 0x1111aaaa2222bbbb3333cccc4444dddd5555eeee — I want the typed data to sign."}],"resultDescription":"Returns an action payload containing the original TWAP order parameters, an EIP-712 typed data object (domain, types, message, primaryType) for L1 signing, a nonce, the Arbitrum chain ID (42161), protocol identifier 'hyperliquid', and a submitPath (/perp/hyperliquid/twap/place/execute) to use after signing. Also includes any warnings or errors from the exchange.","failureModes":["Estimated total order value below $100 for perps or 100 quote tokens for spot — rejected with validation error","Asset ID out of range (0–99999) or not supported on Hyperliquid — returns error","Duration outside 5–10080 minutes range — schema validation failure","Builder-deployed perp assets not supported — returns unsupported asset error","Invalid Ethereum address format for accountAddress or vaultAddress — schema validation failure","Size string not matching numeric pattern — schema validation failure","Account abstraction mode mismatch when treating spot and perp as unified — may return warning or error"],"whenToPreferThis":"Use this endpoint when you need to execute a large trade gradually on Hyperliquid using TWAP execution to minimize market impact, and you require EIP-712 L1 signing (e.g., from a hardware wallet or smart contract wallet) rather than API-key-based signing. Prefer this over a market or limit order when order size is large relative to liquidity or when price impact must be managed over time. This is the right choice for agents operating on Hyperliquid perpetuals or spot markets with direct L1 wallet control.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-16T18:32:43.758Z","isFirstParty":false,"canonicalSlug":"chainhilt-twap-order-preview-hyperliquid-perp-spot-ee5a7fe5"}