Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.13 KB

File metadata and controls

62 lines (41 loc) · 1.13 KB

Hyperliquid CLI

A command-line interface for trading on the Hyperliquid protocol.

Installation

pip install hyperliquid-cli

Configuration

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

Usage

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

Development

To set up the development environment:

  1. Clone the repository
  2. Install dependencies: pip install -e ".[dev]"
  3. Run tests: pytest

License

MIT License