Skip to main content
The Phantom MCP server includes a dedicated set of tools for perpetuals trading on Hyperliquid through Phantom’s backend. This page focuses only on those perps tools: what they do, how funding flows work, and the order agents should use them in.

Overview

Hyperliquid perps in the MCP server use two balances on Hypercore:
  • Spot account: receives bridged funds and holds transferable tokens
  • Perp account: holds USDC collateral for perpetual positions
The usual funding path is:
  1. external chain -> Hyperliquid spot (perps_deposit)
  2. Hyperliquid spot -> perp account (perps_transfer)
  3. open / manage positions
  4. perp account -> external chain (perps_withdraw)
To withdraw funds from the Hyperliquid spot account (instead of perps), use the perps_withdraw-hl-spot MCP tool or the phantom perps withdraw-hl-spot CLI command.
All perps write operations use the wallet’s EVM signing path on eip155:42161 for Hyperliquid actions. The funding tools are different: they use the Phantom bridge / swap flows where appropriate.

What agents can do with perps

These tools let an agent do more than just place a single trade. An agent can:
  • inspect available perp markets and compare price, funding, open interest, and leverage limits
  • check account value, available balance, and the amount available to trade
  • open long or short positions with configurable leverage
  • choose between market and limit orders
  • watch open positions and active orders over time
  • change leverage or margin mode after a trade is open
  • close part or all of a position when the user asks
  • move funds into and out of the perp account as part of a larger workflow
Typical user requests this enables:
  • “Open a 5x BTC long with $250 of exposure.”
  • “Place a limit ETH short if price comes back to 3,200.”
  • “Show me my open SOL perp and close half of it.”
  • “Move my remaining USDC out of perps and withdraw it back to Base.”
Perps tools can open leveraged positions and submit irreversible actions. Agents should confirm high-impact trades and withdrawals with the user before executing them.

Read-only tools

Funding and withdrawal tools

perps_deposit

Bridges or swaps from an external chain into Hyperliquid. This is the entry point when funds are not already on Hypercore.
Arbitrum (eip155:42161) is rejected as a deposit source. BNB Smart Chain (eip155:56) is unsupported; do not use it as a deposit source. See the supported networks.
Typical use:
  1. user has SOL / ETH / USDC on an external chain
  2. call perps_deposit
  3. funds arrive in Hyperliquid spot as USDC
  4. call perps_transfer to move that USDC into the perp account
Example:
Another example:

perps_transfer

Moves USDC within Hypercore from spot into the perp account. This is an internal Hyperliquid transfer, not a bridge. Parameters:
  • amountUsdc: amount of USDC to move from spot to perps
  • derivationIndex (optional): account derivation index, defaults to 0
Example:

perps_withdraw

Bridges USDC from the Hyperliquid perpetuals account to an external chain. Parameters:
  • amountUsdc: amount of USDC to bridge out
  • destinationChainId: destination chain such as solana:mainnet, eip155:8453, eip155:42161
  • buyToken (optional): CAIP-19 token to receive; defaults to USDC on the destination chain
  • derivationIndex (optional): account derivation index, defaults to 0
Example:

Withdrawing from Hyperliquid spot

If funds are in your Hyperliquid spot account rather than the perps account, call the perps_withdraw-hl-spot MCP tool or the phantom perps withdraw-hl-spot CLI command to bridge them to an external chain. This is useful when you have USDC sitting in spot after a deposit or after moving funds out of perps.
Parameters:
  • --amountUsdc: amount of USDC to bridge out
  • --destinationChainId: destination chain such as solana:mainnet, eip155:8453, eip155:1, eip155:42161, eip155:137
  • --buyToken (optional): CAIP-19 token to receive on the destination chain; defaults to USDC
  • --execute (optional): set to true to sign and broadcast immediately; defaults to returning a quote only
Omit --execute to preview the quote before committing:
Both return a quote unless you pass execute. Use perps_withdraw to withdraw from the perps account directly.

Trading tools

perps_open

Opens a long or short position. Supports:
  • market orders
  • limit orders
  • leverage selection
  • isolated or cross margin
  • reduce-only flag
Parameters:
  • market: market symbol such as BTC, ETH, SOL
  • direction: long or short
  • sizeUsd: notional position size in USD, as a number
  • leverage: leverage multiplier
  • orderType (required): market or limit
  • limitPrice (required for limit orders): target price as a number
  • marginType (optional): isolated (default) or cross
  • reduceOnly (optional): if true, order can only reduce an existing position
  • derivationIndex (optional): account derivation index, defaults to 0
Example (market long):
Example (limit short):

perps_close

Closes a position fully or partially using sizePercent. Parameters:
  • market: market symbol to close
  • sizePercent (optional): percentage of the position to close, defaults to 100
  • derivationIndex (optional): account derivation index, defaults to 0
Example:

perps_cancel

Cancels an open order by orderId. Parameters:
  • market: market symbol
  • orderId: numeric order id from perps_orders
  • derivationIndex (optional): account derivation index, defaults to 0
Example:

perps_leverage

Changes leverage and margin mode for a market. Parameters:
  • market: market symbol
  • leverage: leverage multiplier
  • marginType (required): cross or isolated
  • derivationIndex (optional): account derivation index, defaults to 0
Example:

Funding a perp account

  1. wallet_balances
  2. perps_deposit
  3. perps_transfer
  4. perps_account

Opening and managing a trade

  1. perps_markets
  2. perps_account
  3. perps_open
  4. perps_positions
  5. perps_orders
  6. perps_leverage or perps_cancel as needed

Exiting and withdrawing

  1. perps_close
  2. perps_withdraw (bridges USDC from perps directly to destination chain)
To withdraw USDC from Hyperliquid spot, use the perps_withdraw-hl-spot MCP tool or the phantom perps withdraw-hl-spot CLI command.

Notes for agents

  • If the user asks for their total Hyperliquid exposure, do not rely only on wallet_balances; also call perps_account.
  • If the user asks to move funds off Hyperliquid, check perps_account to see where the USDC is. Call perps_withdraw with a destinationChainId for funds in the perp account. Call perps_withdraw-hl-spot with a destinationChainId for funds in Hyperliquid spot. Each handles the bridge in one step.
  • If the user already has funds in Hyperliquid spot, skip perps_deposit and use perps_transfer directly.

Tool reference

Full MCP tool parameters and examples, including non-perps tools.

MCP setup

Install and configure the Phantom MCP server.