Skip to main content
Run phantom --help or phantom <command> --help for inline documentation.

Authentication

phantom login
Authenticate with Phantom via browser (Google, Apple, or Phantom extension). Use this to log in for the first time, switch accounts, or refresh an expired session.

Wallet

phantom wallet status      # Check session status (no API call)
phantom wallet addresses   # Get all wallet addresses (Solana, EVM, Bitcoin, Sui)
phantom wallet balances    # Get token balances with USD prices across all chains
phantom wallet rebalance   # Rebalance portfolio to a target allocation

Tokens & Swaps

phantom buy        # Swap tokens on Solana, EVM, or cross-chain
phantom transfer   # Transfer native tokens or SPL/ERC-20 tokens
phantom simulate   # Simulate a transaction and preview asset changes
phantom pay        # Pay for API access using tokens

phantom buy

Swap tokens on Solana, across EVM chains, or between chains (including Hyperliquid):
# Swap SOL to USDC on Solana
phantom buy --sellTokenIsNative --buyTokenMint EPjFWdd5... --amount 0.1 --amountUnit ui --execute

# Bridge USDC from Solana to Base
phantom buy --sellTokenMint EPjFWdd5... --buyChainId eip155:8453 --buyTokenIsNative \
  --amount 10 --amountUnit ui --execute

# Deposit to Hyperliquid (bridge SOL into HL spot)
phantom buy --sellTokenIsNative --buyChainId hypercore:mainnet \
  --buyTokenMint 0x00000000000000000000000000000000 --amount 0.05 --amountUnit ui --execute
Omit --execute to get a quote preview only.

Solana

phantom solana send   # Sign and broadcast a base64-encoded Solana transaction
phantom solana sign   # Sign a UTF-8 message (returns base58 signature)

EVM

phantom evm send         # Sign and broadcast an EVM transaction
phantom evm sign         # Sign an EVM personal message (EIP-191)
phantom evm sign-typed   # Sign EVM typed data (EIP-712)
phantom evm allowance    # Get ERC-20 token allowance for a spender address

Perpetuals (Hyperliquid)

Full perpetuals documentation: PERPS guide.
phantom perps markets      # List available perpetual markets with prices
phantom perps account      # Get account balance, available margin, and withdrawable amount
phantom perps positions    # Get all open positions
phantom perps orders       # Get all open orders
phantom perps history      # Get recent trade history

phantom perps open         # Open a long or short position (market or limit)
phantom perps close        # Close an open position
phantom perps cancel       # Cancel an open order
phantom perps leverage     # Update leverage for a market

phantom perps deposit      # Bridge tokens from external chain into Hyperliquid spot
phantom perps transfer     # Move USDC from Hyperliquid spot into perps account
phantom perps withdraw     # Bridge USDC from perps account to an external chain

Perps workflow

Fund and trade:
# 1. Bridge SOL into Hyperliquid spot
phantom perps deposit --sourceChainId solana:mainnet --amount 0.1 --sellTokenIsNative --execute

# 2. Move USDC from spot into perps account
phantom perps transfer --amountUsdc 8

# 3. Open a leveraged long position
phantom perps open --market BTC --direction long --sizeUsd 50 --leverage 5 --orderType market
Exit and withdraw:
# 1. Close the position
phantom perps close --market BTC

# 2. Bridge USDC back to Solana
phantom perps withdraw --amountUsdc 8 --destinationChainId solana:mainnet

Global flags

FlagDescription
--walletIdOverride the wallet ID (defaults to authenticated wallet)
--derivationIndexAccount derivation index (default: 0)
--helpShow help for the current command
--versionShow CLI version
--mcpStart the CLI as an MCP stdio server