hyperliquid_prepare
hyperliquid_prepareBuilds a Hyperliquid perps action for the wallet to sign itself: market or limit order (long or short, by size or USD notional, reduce-only, post-only), cancel, leverage change, or the one-time builder-fee approval. Returns the exact action, its nonce and the EIP-712 typed data for eth_signTypedData_v4, rounded to the market's tick and lot rules, with a plain summary. When the wallet has not yet approved the builder fee, the approval comes back first. Non-custodial. Price: $0.002 USDC per call (x402).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"address": "<address>"
},
"name": "hyperliquid_prepare"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| oid | No | Order id to cancel (cancel) | |
| tif | No | Gtc (default), Ioc or Alo for limit orders | |
| usd | No | Order notional in USD, converted at mid (order) | |
| coin | No | Perp, e.g. BTC, ETH, SOL (order, cancel, update_leverage) | |
| side | No | buy/long or sell/short (order) | |
| size | No | Order size in coin units (order; or use usd) | |
| type | No | order (default), cancel, update_leverage or approve_builder | |
| cross | No | true for cross margin, false for isolated (update_leverage) | |
| price | No | Limit price; omit for a market order (order) | |
| address | Yes | 0x wallet that will sign | |
| leverage | No | New leverage, integer (update_leverage) | |
| post_only | No | true for a maker-only limit order (order) | |
| reduce_only | No | true to only reduce an existing position (order) | |
| max_fee_rate | No | Approval cap such as "0.05%" (approve_builder) | |
| slippage_bps | No | Max slippage for market orders in basis points, 1-2000 (default 100) |