# Hyperliquid MCP documentation Version: 1.9.0 Network: mainnet Transport: Streamable HTTP MCP: https://tendle.ai/connectors/hyperliquid/mcp Docs: https://tendle.ai/connectors/hyperliquid/mcp/docs Metadata: https://tendle.ai/connectors/hyperliquid/manifest.json Supports default perps, builder/HIP-3 perps and spot. Financial tools can move real funds on mainnet. ## Connection and wallet setup Tool names below use the hyperliquid_ prefix. Read the configured network at the top of this document; it is server-wide, not a tool input. Refresh tools/list after updates. Initialization, tools/list, get_docs and generate_wallet are public. Other tools need Authorization: Bearer from secure client credentials. Accept a 64-hex private key (optional 0x) or valid 12/24-word English BIP-39 phrase. Normalize phrase whitespace to single spaces before putting it in the header. Seed credentials do not select an account automatically. Call list_wallet_accounts (no secrets in arguments), show the returned public addresses, and ask the user to choose. Copy the chosen {index,address} into walletAccount on every other authenticated tool call, including reads. The server validates the pair against the current phrase. The agent/client remembers the user's choice; the server stores no selection. If the choice is lost, ambiguous, or mismatches new credentials, ask again; never default to index 0 or pick the richest account. Explicit existing user choice can be reused. Discovery defaults to 10 addresses; follow nextIndex only as needed. These include unused addresses, not all used/funded wallets; no balances are fetched. It covers m/44'/60'/0'/0/index with no extra passphrase, not other wallet derivation conventions. Other paths/passphrases require importing that account's private key instead. Private-key credentials identify one account: discovery returns it; omit walletAccount. Selection uses ordinary tool arguments; do not ask the user to paste secrets in chat or modify authentication headers to switch accounts. Confirm get_account.userAddress before funding. userAddress and account/vault overrides do not select a derived signer. These checks verify credential/account consistency, not proof of human consent; the agent must obtain the user's selection and separate authorization for actions. Invalid supplied credentials are rejected even on public calls. generate_wallet returns address, privateKey and a 12-word seedPhrase for the same account; save both secrets securely without echoing them in chat/logs. Tool callers can see both. It does not fund/register the wallet; retries create new wallets. Never put keys in URLs or tool arguments. userAddress selects a read subject, not a signing account. Account/vault header overrides require existing exchange authorization; owner-only tools reject overrides. ## Fresh evidence Always query fresh balances, positions, orders, fills, prices, markets and settlement. Refresh relevant reads before authorized writes and verify results afterward. Failed reads and null values mean unavailable, not zero; never fill gaps from memory. All timestamps are Unix milliseconds. Prices/amounts are decimal strings; quantities are token units unless a field explicitly says otherwise. Tools do not authorize actions: follow the user's scope. Never invent a rejection cause or recommend a state-changing fix as necessary without evidence. Report the exchange's actual error. ## Find the exact market list_markets searches symbols, UI display names, deployment names and upstream keywords by case-insensitive substring. Company-name aliases come from Hyperliquid's perpConciseAnnotations/tokenConciseAnnotations, not an inferred alias list. Use search="anthropic" or search="openai"; use category="preipo" for upstream pre-IPO classifications. Available categories are returned for the selected scope before search/category filters. Null category means unclassified, not ineligible. Upstream labels/keywords can be incomplete: no match does not prove no exposure exists. Failed annotation reads return errors, not empty results. Search is not typo-tolerant. limit=20 is a page size; follow nextOffset. dex restricts to perps; omit it to search all deployments and spot. Delisted markets are hidden by default; includeDelisted=true can explain an old listing. Market counts and categories are live, never fixed. Copy marketId into market_details and orders: perp:BTC is default perps; perp:xyz:SP500 is a market on builder deployment xyz; spot:@1 is a spot identifier (example only). SP500 is a market, xyz is the deployment; neither is another wallet. Default perps, builder (HIP-3) perps and spot are supported by order tools. Similar names/prices do not establish the same underlying asset. supportedByOrderTools is connector capability, not account eligibility; tradingEnabled=null means unknown. ## Balances and capacity get_account returns positions for one dex plus balanceLocations: spot balances/holds and unique perp deployment entries. Each spot row has availableAfterMaintenance (exchange-reported, null if missing), held (exchange hold), total (includes held), and unheld (total minus held). Lead with availableAfterMaintenance when describing available funds; never present total as spending power. Do not infer the cause of a hold. unheld is arithmetic, not guaranteed trading/withdrawal capacity, and must not replace missing maintenance availability. Zero perp totals in shared mode do not mean unfunded perps or prove that nothing moved. A selected builder also includes default-perp balances, but not its positions. Query each relevant dex before declaring the whole account flat. These are Hyperliquid balances, not Arbitrum ETH/USDC holdings. accountMode=disabled means Standard with separate balances; unifiedAccount shares each collateral asset across spot and compatible cross-margin perps. It does not convert USDC into another collateral token. portfolioMargin is a distinct mode. Raw default/dexAbstraction are treated as unverified by this server, not as Standard. Respect balanceLocations.interpretation; never sum reported perp totals with shared spot balances. Account abstraction is separate from a position's cross/isolated mode. market_details(includeAccount=true) returns perp accountTrading: availableToTrade in collateral units, maxTradeSzs in base units, sideOrder=[buy,sell], current leverage. Use these fresh estimates, not total equity, to assess a specific trade. Zero does not establish its cause. Spot needs the appropriate base/quote balance and holds; this server does not return spot trading capacity. Portfolio history is not cash. ## Funding and mode changes transfer_collateral moves funds within the owner's wallet: source/destination are "spot", "" (default perps), or exact builder dex such as "xyz". tokenIndex comes from market_details.collateral.index and must match every involved perp deployment. Example shape: {"source":"","destination":"xyz","tokenIndex":0,"amount":"2"}; verify the token and amount, never copy example values as authorization. This funds builder collateral in Standard mode without changing mode. It is not an external deposit, withdrawal, token swap or trade. Shared modes return not_applicable and submitted=false. Before/after reads cover the selected locations and do not prove transaction-specific settlement. Re-read ledger/balances and target-market capacity. set_account_mode(mode=unified|standard) is an explicitly authorized account-wide change; never use it as an incidental trade prerequisite. Targets map to API unifiedAccount|disabled. already_configured means no write; verification reports observed mode. A rejection does not prove an open position caused it. Do not close positions or promise a reversible round trip without evidence and authorization. Read balances/positions/capacity again after changing mode; do not assume balances return to earlier locations. Portfolio-margin transitions are not exposed. Owner keys without account/vault overrides are required for both tools and bridges. ## Trade and verify place_orders, modify_orders and cancel_orders take orders arrays even for one item. size is base quantity, not dollars or margin; leverage does not multiply the size input. market orders use bounded-slippage IOC limits and can fill partly or not at all. limit/trigger orders require price; triggerPrice is a separate activation price. place_bracket_order creates linked entry plus reduce-only LIMIT TP/SL exits; reaching a trigger does not guarantee a fill. Spot has no leverage, triggers or reduce-only. Use market_details precision and margin tiers; maxLeverage is a ceiling, not the account setting. Do not infer all listed markets are affordable or apply a blanket spot minimum: the exchange enforces spot notional rules. Fees and holds affect funds. update_leverage sets leverage and cross/isolated mode, not exposure. close_position uses reduce-only IOC; verify fills and remaining position. Closing does not reset leverage configuration. update_isolated_margin adjusts existing isolated collateral. cancel_all_orders covers one perp dex; schedule_cancel cancels orders, not positions. ## Outcomes and recovery Read data.status and per-item response.data.statuses, not only MCP isError. A batch can partly succeed even when isError=true. ok is an exchange acknowledgement; resting means open, filled reports execution, and error means that item was rejected. submitted is not settlement or a verified setting. unknown may have executed: never repeat a write to poll. Reconcile orders with returned clientOrderIds, get_order_status, get_orders and get_user_fills; client IDs do not make retries idempotent. unknownOid and bounded-history absence are not proof of nonexecution. get_orders open is scoped to one perp dex; history and other history tools are API-bounded, not complete archives. Readback failures do not undo accepted writes; balance observations are not receipts. deposit sends USDC from Arbitrum via the legacy bridge (minimum 5 USDC, ETH gas). It checks funds internally but there is no standalone Arbitrum balance/receipt tool. confirmed refers to the Arbitrum receipt, not Hyperliquid credit; preserve transactionHash. withdraw submits a bridge withdrawal with a fee; arrivalConfirmed=false means arrival has not been verified. get_ledger_updates is Hyperliquid evidence, not an Arbitrum receipt. Use an external chain read for settlement when needed; never repeat either bridge call to check status. The legacy deposit bridge is deprecated; CCTP is not implemented by this server. list_vaults discovers addresses; vault_details inspects one vault. Historical APR is not a forecast; neither tool transfers vault funds. ## Common workflows Connect: read get_docs → store credentials securely → list_wallet_accounts → ask the user to choose → get_account. Private keys already select one wallet. Trade: list_markets → market_details(includeAccount=true) → inspect fresh balances/orders → obtain action authorization → place_orders → verify order status, fills and remaining position. Bridge: confirm network, amount and authorization → deposit or withdraw once → reconcile returned status with fresh ledger/chain reads. Never resubmit to poll. Examples (tool arguments only; credentials stay in secure headers): list_markets: {"search":"anthropic"} list_wallet_accounts: {"startIndex":0,"limit":10} market_details: {"marketId":"perp:BTC","includeAccount":true} With seed credentials, add the user's chosen walletAccount to market/account/trading calls. Example queries do not authorize writes. ## Tool reference Tool names below are exact. Inputs are JSON objects. Required arrays and conditional rules in each schema define required fields; additionalProperties=false rejects unknown inputs. Defaults describe server behavior, not client authorization. Amounts and sizes use the units stated in descriptions. Common optional schema field: walletAccount. Required at runtime with seed credentials on every authenticated tool except list_wallet_accounts; omit with private keys. It is shown once here to avoid repeating it in every tool schema: ```json { "type": "object", "properties": { "index": { "type": "integer", "minimum": 0, "maximum": 2147483647 }, "address": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 } }, "required": [ "index", "address" ], "additionalProperties": false, "description": "Required with seed-phrase credentials: copy the user's chosen index/address from list_wallet_accounts. Omit with private-key credentials. Selects signer, not userAddress or account/vault overrides; never silently choose account zero." } ``` ### Setup and wallets #### hyperliquid_get_docs Public. Read-only. Read the complete plain-text documentation: setup, wallet selection, workflows, errors, limitations and current tool schemas. Same text as /connectors/hyperliquid/mcp/docs. Public; no credentials required. Input schema: ```json { "type": "object", "properties": {}, "required": [], "additionalProperties": false } ``` #### hyperliquid_generate_wallet Public. Creates a new wallet. Generate an EVM wallet. Returns address/privateKey/seedPhrase (12 English BIP-39 words, first Ethereum account, no extra passphrase); server never stores them. The caller can see both secrets. Save securely, never echo keys into chat/logs. Each retry creates a different wallet. Public; does not fund or register it. Input schema: ```json { "type": "object", "properties": {}, "required": [], "additionalProperties": false } ``` #### hyperliquid_list_wallet_accounts Authenticated. Read-only. Discover signing addresses from secure credentials. Seed phrase: paginated Ethereum addresses, including unused ones; ask the user to select, then pass walletAccount={index,address} on other authenticated tools. Private key: one address, omit walletAccount. Returns no secrets or balances, changes no selection, does not enumerate all paths or Hyperliquid subaccounts. Input schema: ```json { "type": "object", "properties": { "startIndex": { "type": "integer", "minimum": 0, "maximum": 2147483647, "default": 0 }, "limit": { "type": "integer", "minimum": 1, "maximum": 10, "default": 10 } }, "required": [], "additionalProperties": false } ``` ### Account reads #### hyperliquid_get_account Authenticated. Read-only. Read raw accountMode, positions for one dex and per-token availableAfterMaintenance, held, total and unheld balances. Lead with availableAfterMaintenance (null if unavailable), never total as spending power. unheld is total minus held, not guaranteed trade/withdrawal capacity. balanceLocations contains unique default/selected perp balances with separate/shared/unverified interpretation. Raw default is unverified, not confirmed Standard. Shared perp totals are not additional funds. No Arbitrum balances; use market_details(includeAccount=true) for perp capacity. Optional include adds account metadata. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 }, "dex": { "type": "string", "maxLength": 64, "description": "Exact perp deployment; empty string selects default perps." }, "include": { "type": "array", "items": { "type": "string", "enum": [ "role", "fees", "subAccounts", "agents", "multiSigSigners", "referrals", "rateLimit" ] }, "minItems": 1, "maxItems": 7, "uniqueItems": true } }, "required": [], "additionalProperties": false } ``` #### hyperliquid_get_orders Authenticated. Read-only. Read open orders on one perp deployment, or API-bounded historical orders. History is account-wide: dex is not accepted with view=history. Absence in history does not prove an order never existed. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 }, "view": { "type": "string", "enum": [ "open", "history" ] }, "dex": { "type": "string", "maxLength": 64, "description": "Exact perp deployment; empty string selects default perps." } }, "required": [ "view" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "view": { "const": "history" } } }, "then": { "not": { "required": [ "dex" ] } } } ] } ``` #### hyperliquid_get_order_status Authenticated. Read-only. Look up one order by exchange oid or client cloid. Use for uncertain submission reconciliation. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 }, "oid": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "cloid": { "type": "string", "pattern": "^0x[0-9a-fA-F]{32}$", "minLength": 34, "maxLength": 34 } }, "required": [], "additionalProperties": false, "oneOf": [ { "required": [ "oid" ], "not": { "required": [ "cloid" ] } }, { "required": [ "cloid" ], "not": { "required": [ "oid" ] } } ] } ``` #### hyperliquid_get_user_fills Authenticated. Read-only. Read recent, time-bounded, or TWAP slice fills. Explicit mode required. API-bounded response, not guaranteed complete history. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 }, "startTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." }, "endTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." }, "mode": { "type": "string", "enum": [ "recent", "time", "twap" ] }, "aggregateByTime": { "type": "boolean" } }, "required": [ "mode" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "mode": { "const": "time" } } }, "then": { "required": [ "startTime" ] }, "else": { "not": { "anyOf": [ { "required": [ "startTime" ] }, { "required": [ "endTime" ] }, { "required": [ "aggregateByTime" ] } ] } } } ] } ``` #### hyperliquid_get_user_funding Authenticated. Read-only. Read account funding payments in a time range. API-bounded history. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 }, "startTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." }, "endTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." } }, "required": [ "startTime" ], "additionalProperties": false } ``` #### hyperliquid_get_ledger_updates Authenticated. Read-only. Read Hyperliquid non-funding ledger history. API-bounded; not Arbitrum receipt or final bridge-settlement verification. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 }, "startTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." }, "endTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." } }, "required": [ "startTime" ], "additionalProperties": false } ``` #### hyperliquid_get_portfolio Authenticated. Read-only. Read historical performance, optionally including user vault equities. Not spendable balances. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 }, "includeVaultEquities": { "type": "boolean" } }, "required": [], "additionalProperties": false } ``` ### Market and vault reads #### hyperliquid_list_markets Authenticated. Read-only. Search default perps, builder perps and spot. Default limit=20 is a PAGE SIZE, not total markets. Inspect total/nextOffset, or search directly. Search matches symbols, UI display names and upstream keywords, not semantic guesses. Filter category (e.g. preipo); response categories lists available upstream labels. Missing labels remain unknown. Copy exact marketId to other tools. Supplying dex restricts to perps. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "search": { "type": "string", "maxLength": 200 }, "category": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^\\S+$", "description": "Exact upstream category, case-insensitive; e.g. preipo, stocks, indices. See response categories. Unclassified markets are excluded when filtering." }, "marketType": { "type": "string", "enum": [ "all", "perp", "spot" ] }, "dex": { "type": "string", "maxLength": 64, "description": "Exact perp deployment; empty string selects default perps." }, "includeDelisted": { "type": "boolean" }, "limit": { "type": "integer", "minimum": 1, "maximum": 100 }, "offset": { "type": "integer", "minimum": 0, "maximum": 1000000 } }, "required": [], "additionalProperties": false } ``` #### hyperliquid_market_details Authenticated. Read-only. Get exact-market UI display name, keywords/category, prices, collateral or base/quote tokens, precision, leverage ceilings/tiers and listing status. includeAccount=true adds fresh perpetual available-to-trade amounts, maximum sizes and current leverage for the request account (or userAddress). tradingEnabled=null means unknown; listing is not trading permission. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "includeAccount": { "type": "boolean" }, "userAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 } }, "required": [ "marketId" ], "additionalProperties": false, "allOf": [ { "if": { "required": [ "userAddress" ] }, "then": { "required": [ "includeAccount" ], "properties": { "includeAccount": { "const": true } } } } ] } ``` #### hyperliquid_get_order_book Authenticated. Read-only. Read the current order book for an exact default-perp, builder-perp or spot market. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 } }, "required": [ "marketId" ], "additionalProperties": false } ``` #### hyperliquid_get_historical_funding Authenticated. Read-only. Read API-bounded funding history for an exact perpetual market. Spot is rejected. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "startTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." }, "endTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." } }, "required": [ "marketId", "startTime" ], "additionalProperties": false } ``` #### hyperliquid_get_candles Authenticated. Read-only. Read API-bounded OHLCV candles for an exact market. Times are Unix milliseconds. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "interval": { "type": "string", "enum": [ "1m", "5m", "15m", "1h", "4h", "1d" ] }, "startTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." }, "endTime": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Unix timestamp in milliseconds." } }, "required": [ "marketId", "interval", "startTime" ], "additionalProperties": false } ``` #### hyperliquid_list_vaults Authenticated. Read-only. Search vault directory summaries by name, address or leader. TVL descending, excludes closed vaults by default. Snapshots can change between pages. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "search": { "type": "string", "maxLength": 200 }, "limit": { "type": "integer", "minimum": 1, "maximum": 100 }, "offset": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "includeClosed": { "type": "boolean" } }, "required": [], "additionalProperties": false } ``` #### hyperliquid_vault_details Authenticated. Read-only. Read detailed information for one known vault address. Use list_vaults to discover addresses. Does not move funds. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "vaultAddress": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 } }, "required": [ "vaultAddress" ], "additionalProperties": false } ``` ### Trading #### hyperliquid_place_orders Authenticated. Changes funds, orders or account settings. Submit 1–50 orders using exact marketId. All items are validated before one submission; individual results can differ. Default/builder perps and spot supported; spot has no triggers/reduce-only. Returned client IDs enable reconciliation after unknown outcomes; never blindly retry. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "orders": { "type": "array", "items": { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "type": { "type": "string", "enum": [ "market", "limit", "trigger" ] }, "isBuy": { "type": "boolean" }, "size": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34, "description": "Base-token quantity, not dollars or margin; leverage does not multiply this input." }, "price": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "timeInForce": { "type": "string", "enum": [ "Gtc", "Ioc", "Alo" ] }, "reduceOnly": { "type": "boolean" }, "slippage": { "type": "number", "exclusiveMinimum": 0, "maximum": 0.1, "default": 0.05 }, "triggerPrice": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "triggerKind": { "type": "string", "enum": [ "tp", "sl" ] }, "triggerIsMarket": { "type": "boolean" }, "cloid": { "type": "string", "pattern": "^0x[0-9a-fA-F]{32}$", "minLength": 34, "maxLength": 34 } }, "required": [ "marketId", "type", "isBuy", "size" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "type": { "const": "market" } } }, "then": { "not": { "anyOf": [ { "required": [ "price" ] }, { "required": [ "timeInForce" ] }, { "required": [ "triggerPrice" ] }, { "required": [ "triggerKind" ] }, { "required": [ "triggerIsMarket" ] } ] } } }, { "if": { "properties": { "type": { "const": "limit" } } }, "then": { "required": [ "price" ], "not": { "anyOf": [ { "required": [ "slippage" ] }, { "required": [ "triggerPrice" ] }, { "required": [ "triggerKind" ] }, { "required": [ "triggerIsMarket" ] } ] } } }, { "if": { "properties": { "type": { "const": "trigger" } } }, "then": { "required": [ "price", "triggerPrice", "triggerKind", "triggerIsMarket" ], "not": { "anyOf": [ { "required": [ "slippage" ] }, { "required": [ "timeInForce" ] } ] } } } ] }, "minItems": 1, "maxItems": 50 } }, "required": [ "orders" ], "additionalProperties": false } ``` #### hyperliquid_modify_orders Authenticated. Changes funds, orders or account settings. Modify 1–50 orders by oid or cloid and exact marketId. Requires an explicit limit or trigger order definition. Inspect every result; not atomic. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "orders": { "type": "array", "items": { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "type": { "type": "string", "enum": [ "limit", "trigger" ] }, "isBuy": { "type": "boolean" }, "size": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34, "description": "Base-token quantity, not dollars or margin; leverage does not multiply this input." }, "price": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "timeInForce": { "type": "string", "enum": [ "Gtc", "Ioc", "Alo" ] }, "reduceOnly": { "type": "boolean" }, "slippage": { "type": "number", "exclusiveMinimum": 0, "maximum": 0.1, "default": 0.05 }, "triggerPrice": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "triggerKind": { "type": "string", "enum": [ "tp", "sl" ] }, "triggerIsMarket": { "type": "boolean" }, "oid": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "cloid": { "type": "string", "pattern": "^0x[0-9a-fA-F]{32}$", "minLength": 34, "maxLength": 34 } }, "required": [ "marketId", "type", "isBuy", "size" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "type": { "const": "market" } } }, "then": { "not": { "anyOf": [ { "required": [ "price" ] }, { "required": [ "timeInForce" ] }, { "required": [ "triggerPrice" ] }, { "required": [ "triggerKind" ] }, { "required": [ "triggerIsMarket" ] } ] } } }, { "if": { "properties": { "type": { "const": "limit" } } }, "then": { "required": [ "price" ], "not": { "anyOf": [ { "required": [ "slippage" ] }, { "required": [ "triggerPrice" ] }, { "required": [ "triggerKind" ] }, { "required": [ "triggerIsMarket" ] } ] } } }, { "if": { "properties": { "type": { "const": "trigger" } } }, "then": { "required": [ "price", "triggerPrice", "triggerKind", "triggerIsMarket" ], "not": { "anyOf": [ { "required": [ "slippage" ] }, { "required": [ "timeInForce" ] } ] } } }, { "oneOf": [ { "required": [ "oid" ], "not": { "required": [ "cloid" ] } }, { "required": [ "cloid" ], "not": { "required": [ "oid" ] } } ] } ] }, "minItems": 1, "maxItems": 50 } }, "required": [ "orders" ], "additionalProperties": false } ``` #### hyperliquid_cancel_orders Authenticated. Changes funds, orders or account settings. Cancel 1–50 specific orders by oid or cloid and exact marketId. Use one identifier type per batch. Inspect each result. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "orders": { "type": "array", "items": { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "oid": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "cloid": { "type": "string", "pattern": "^0x[0-9a-fA-F]{32}$", "minLength": 34, "maxLength": 34 } }, "required": [ "marketId" ], "additionalProperties": false, "oneOf": [ { "required": [ "oid" ], "not": { "required": [ "cloid" ] } }, { "required": [ "cloid" ], "not": { "required": [ "oid" ] } } ] }, "minItems": 1, "maxItems": 50 } }, "required": [ "orders" ], "additionalProperties": false } ``` #### hyperliquid_cancel_all_orders Authenticated. Changes funds, orders or account settings. Cancel open perpetual orders on the selected deployment for the authenticated trading account. Explicit dex required; empty string means default perps. Does not close positions or cancel spot orders. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "dex": { "type": "string", "maxLength": 64, "description": "Exact perp deployment; empty string selects default perps." } }, "required": [ "dex" ], "additionalProperties": false } ``` #### hyperliquid_place_bracket_order Authenticated. Changes funds, orders or account settings. Submit linked perpetual entry, take-profit and stop-loss orders. Entry is a market or limit order; exit triggers are reduce-only limit orders. All three can have different outcomes; not atomic. No spot brackets. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "entry": { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "type": { "type": "string", "enum": [ "market", "limit", "trigger" ] }, "isBuy": { "type": "boolean" }, "size": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34, "description": "Base-token quantity, not dollars or margin; leverage does not multiply this input." }, "price": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "timeInForce": { "type": "string", "enum": [ "Gtc", "Ioc", "Alo" ] }, "reduceOnly": { "type": "boolean" }, "slippage": { "type": "number", "exclusiveMinimum": 0, "maximum": 0.1, "default": 0.05 }, "triggerPrice": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "triggerKind": { "type": "string", "enum": [ "tp", "sl" ] }, "triggerIsMarket": { "type": "boolean" }, "cloid": { "type": "string", "pattern": "^0x[0-9a-fA-F]{32}$", "minLength": 34, "maxLength": 34 } }, "required": [ "marketId", "type", "isBuy", "size" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "type": { "const": "market" } } }, "then": { "not": { "anyOf": [ { "required": [ "price" ] }, { "required": [ "timeInForce" ] }, { "required": [ "triggerPrice" ] }, { "required": [ "triggerKind" ] }, { "required": [ "triggerIsMarket" ] } ] } } }, { "if": { "properties": { "type": { "const": "limit" } } }, "then": { "required": [ "price" ], "not": { "anyOf": [ { "required": [ "slippage" ] }, { "required": [ "triggerPrice" ] }, { "required": [ "triggerKind" ] }, { "required": [ "triggerIsMarket" ] } ] } } }, { "if": { "properties": { "type": { "const": "trigger" } } }, "then": { "required": [ "price", "triggerPrice", "triggerKind", "triggerIsMarket" ], "not": { "anyOf": [ { "required": [ "slippage" ] }, { "required": [ "timeInForce" ] } ] } } } ] }, "takeProfitPrice": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "stopLossPrice": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 } }, "required": [ "entry", "takeProfitPrice", "stopLossPrice" ], "additionalProperties": false } ``` #### hyperliquid_close_position Authenticated. Changes funds, orders or account settings. Close all or part of a perp position using a fresh position lookup and reduce-only IOC. Optional size defaults to full position. Check fills and remaining position; partial fills are possible. Does not reset leverage configuration. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "size": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 }, "slippage": { "type": "number", "exclusiveMinimum": 0, "maximum": 0.1, "default": 0.05 } }, "required": [ "marketId" ], "additionalProperties": false } ``` #### hyperliquid_update_leverage Authenticated. Changes funds, orders or account settings. Set perp leverage and cross/isolated mode. Exchange enforces margin tiers. Verifies current leverage with fresh account-specific market data, even without a position. Failed or mismatched readback never means the accepted action should be blindly retried. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "leverage": { "type": "integer", "minimum": 1, "maximum": 1000 }, "isCross": { "type": "boolean" } }, "required": [ "marketId", "leverage", "isCross" ], "additionalProperties": false } ``` #### hyperliquid_update_isolated_margin Authenticated. Changes funds, orders or account settings. Adjust collateral on an existing isolated position, without changing size. Positive amount adds, negative removes. No deployment transfers. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "marketId": { "type": "string", "pattern": "^(perp|spot):[^\\x00-\\x1f]+(?![\\s\\S])", "maxLength": 256 }, "amount": { "type": "string", "pattern": "^-?[0-9]{1,14}(\\.[0-9]{1,6})?$", "maxLength": 22 } }, "required": [ "marketId", "amount" ], "additionalProperties": false } ``` #### hyperliquid_schedule_cancel Authenticated. Changes funds, orders or account settings. Schedule account-wide cancellation of open orders at Unix milliseconds at least five seconds ahead, or clear with time=null. Does not close positions. Exchange trigger limits apply. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "time": { "type": [ "integer", "null" ], "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "time" ], "additionalProperties": false } ``` ### Collateral and bridges #### hyperliquid_set_account_mode Authenticated. Changes funds, orders or account settings. Explicit account-wide collateral configuration: unified shares compatible collateral; standard separates spot/perp deployment balances. Requires owner key without overrides and user authorization. Reads mode before/after; same target skips submission. Exchange restrictions may reject changes. Portfolio-margin transitions are not exposed. No automatic transfer or trade; verify mode, balances and target-market capacity afterward. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "unified", "standard" ] } }, "required": [ "mode" ], "additionalProperties": false } ``` #### hyperliquid_transfer_collateral Authenticated. Changes funds, orders or account settings. Transfer collateral within the owner's wallet between spot, default perps and builder deployments. source/destination: spot, empty string for default perps, or exact builder dex such as xyz. tokenIndex comes from market_details collateral.index; token must match every involved perp deployment. Explicit positive decimal amount; owner key without overrides only. Shared modes return not_applicable without submission. Reads balances before/after; never changes account mode. Reconcile unknown outcomes without retrying; refresh market capacity after transfer. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "source": { "type": "string", "maxLength": 64, "description": "spot, empty string for default perps, or exact builder deployment." }, "destination": { "type": "string", "maxLength": 64, "description": "spot, empty string for default perps, or exact builder deployment." }, "tokenIndex": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "amount": { "type": "string", "pattern": "^[0-9]{1,15}(\\.[0-9]{1,18})?$", "maxLength": 34 } }, "required": [ "source", "destination", "tokenIndex", "amount" ], "additionalProperties": false } ``` #### hyperliquid_deposit Authenticated. Changes funds, orders or account settings. Sign and submit USDC through the legacy Hyperliquid bridge on the configured Arbitrum network. Minimum 5 USDC; ETH gas required. No account/vault overrides. Non-idempotent: inspect submitted/confirmed/reverted/unknown status; Arbitrum confirmation is not Hyperliquid credit. Never retry to poll. Legacy bridge is deprecated; CCTP preferred. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "amount": { "type": "string", "pattern": "^[0-9]{1,78}(\\.[0-9]{1,6})?$", "maxLength": 85 } }, "required": [ "amount" ], "additionalProperties": false } ``` #### hyperliquid_withdraw Authenticated. Changes funds, orders or account settings. Submit a USDC withdrawal through the legacy bridge to Arbitrum on the server network. Owner key only; no account/vault overrides. Destination defaults to signer. Fee applies. Returns submitted/rejected/unknown, not arrival confirmation. Never retry an unknown outcome without reconciliation. Also accepts the common walletAccount field above. Input schema: ```json { "type": "object", "properties": { "amount": { "type": "string", "pattern": "^[0-9]{1,20}(\\.[0-9]{1,6})?$", "maxLength": 27 }, "destination": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$", "minLength": 42, "maxLength": 42 } }, "required": [ "amount" ], "additionalProperties": false } ```