Skip to main content
This guide will walk you through the essential steps to start using the HyperETH Trading API with Hyperliquid.

1. Create Hyperliquid Master Account

First, you need to create a Hyperliquid master account which will serve as your primary trading account.

Prerequisites

  • Get a master account
    • Visit Hyperliquid to login via Privy, or
    • Download Metamask or other wallet extensionson to create a master account
  • Obtain USDC on the Arbitrum network for trading

Account Creation Steps

  1. Get USDC: You’ll need USDC on the Arbitrum network to trade on Hyperliquid. You can buy or transfer USDC to your wallet.
  2. Connect to Hyperliquid:
    • Visit app.hyperliquid.xyz
    • Connect your master account, if you choose to use privy in hyperliquid, then you don’t need to connect to your wallet extension
    • Deposit your USDC to start trading
For detailed account setup instructions, refer to the official Hyperliquid onboarding guide.

2. Create Agent Wallet

Agent wallets (also known as API wallets) allow your master account to authorize API access for programmatic trading without withdrawal permissions.

Creating an Agent Wallet

  1. Access API Page: Visit app.hyperliquid.xyz/API
  2. Generate Agent Wallet:
    • Click on “Generate” to create a new agent wallet
    • Name your API key for easy identification
    • Save the generated private key securely - you’ll need this for API calls
  3. Important Notes:
    • Each trading process should use a separate agent wallet for better nonce management
    • Agent wallets can only sign transactions, not withdraw funds
    • Multiple subaccounts benefit from separate agent wallets for parallel operations
Store your agent wallet private key securely. Anyone with access to this key can trade on your behalf (but cannot withdraw funds).

3. Approve Agent Wallet

After creating your agent wallet, you need to approve it for trading operations.

Approval Process

  1. Navigate to API Settings: In the Hyperliquid interface, go to your API settings
  2. Authorize Agent Wallet: Find your newly created agent wallet and click “Authorize”
  3. Confirm Authorization: Complete the authorization process to enable trading permissions

Verification

  • Verify the agent wallet appears in your authorized API wallets list
  • Test basic API connectivity using the agent wallet credentials
For detailed information about nonces and API wallet management, see the official API documentation.

4. Using Agent Wallet for Trading

Once your agent wallet is approved, you can start making API calls to execute trades.

SDK Options

Official Hyperliquid Python SDK

pip install hyperliquid-python-sdk

Community JavaScript/TypeScript SDK

npm install hyperliquid-ts

Basic Trading Example

Here’s a simple example using the Python SDK:
import eth_account
from eth_account.signers.local import LocalAccount

from hyperliquid.exchange import Exchange
from hyperliquid.info import Info

# Initialize with your agent wallet private key
account: LocalAccount = eth_account.Account.from_key("your_agent_wallet_private_key")
info = Info(base_url="https://api.hypereth.io")
exchange = Exchange(account, base_url="https://api.hypereth.io")

# Place a market order
order_result = exchange.market_open(
    coin="BTC",
    is_buy=True,
    sz=0.1,  # Order size
    px=None  # Market order (no price limit)
)

print(f"Order result: {order_result}")

Available APIs

The HyperETH Trading API provides access to:
  • REST API: For order placement, account queries, and trading operations
  • WebSocket API: For real-time market data and order updates
  • Advanced Features: TWAP orders, scale orders, and RFQ handling

Next Steps

  1. Explore API Reference: Check out our REST API and WebSocket API documentation
  2. Advanced Trading: Learn about advanced order types
  3. Integration Support: Review our FAQ section for common integration questions

Testnet Environment

For testing and development:

Testnet Setup

Testnet Configuration

Update your SDK configuration to use testnet endpoints:
from hyperliquid.utils import constants

# Use testnet URL
info = Info(constants.TESTNET_API_URL)
Always test your trading strategies on testnet before deploying to mainnet to avoid potential losses.