A command-line interface for trading on the Hyperliquid protocol.
pip install hyperliquid-cli
Before using the CLI, you need to set up your configuration. Create a .env
file in your home directory with the following:
HYPERLIQUID_PRIVATE_KEY=your_private_key
HYPERLIQUID_ACCOUNT_ADDRESS=your_account_address
The CLI provides several commands for trading:
# Get market information
hyperliquid market info ETH-PERP
# Place a market order
hyperliquid trade market-buy ETH-PERP 0.1
hyperliquid trade market-sell ETH-PERP 0.1
# Place a limit order
hyperliquid trade limit-buy ETH-PERP 0.1 1800.0
hyperliquid trade limit-sell ETH-PERP 0.1 1900.0
# Get positions
hyperliquid positions
# Get open orders
hyperliquid orders
# Cancel an order
hyperliquid cancel ETH-PERP order_id
# Close a position
hyperliquid close ETH-PERP position_id
# Start the API server
hyperliquid serve
To set up the development environment:
- Clone the repository
- Install dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
MIT License