# Hyperliquid > Comprehensive API documentation for Hyperliquid DEX - a decentralized perpetual and spot exchange. ## Overview Hyperliquid provides REST API endpoints for querying market data and executing trades, plus WebSocket connections for real-time data streaming. ## Base URLs - **Mainnet**: `https://api.hyperliquid.xyz` - **Testnet**: `https://api.hyperliquid-testnet.xyz` ## WebSocket URLs - **Mainnet**: `wss://api.hyperliquid.xyz/ws` - **Testnet**: `wss://api.hyperliquid-testnet.xyz/ws` ## Authenticatio MCP endpoint: https://hyperliquid.mcp.junct.dev/mcp Domain: derivatives Auth: none ## Tools ### query_info Query information endpoint — Unified endpoint for querying various types of information. The request body `type` field determines what data is returned. Supports queries for: - Market data (mids, candles, order books) - User data (orders, fills, positions) - Account data (balances, fees, referrals) - Staking data (delegations, rewards) **Parameters:** - `body` (string, required): Request body (string) ### execute_exchange Execute exchange operations — Unified endpoint for all trading and account operations. Requires EIP-712 signature for authentication. Supported operations: - Place, cancel, modify orders - Update leverage and margin - Transfer funds - Manage vaults and staking **Parameters:** - `body` (string, required): Request body (string) ## Usage Connect to this MCP server at `https://hyperliquid.mcp.junct.dev/mcp`. All tools are callable via the MCP protocol. Write operations like `query_info` return data or calldata for agent use.