Hyperliquid AI Trading Agent is an advanced, AI-powered trading bot that harnesses the intelligence of state-of-the-art large language models (LLMs) to analyze live market data from TAAPI, execute real-time trades, and maximize results on the Hyperliquid decentralized exchange. Designed for reliability, flexibility, and security, this agent continually tracks selected cryptocurrency assets, leverages leading technical indicators, and manages buy, sell, or hold decisions through robust automated strategies. Stop-loss and take-profit mechanisms are built-in, ensuring dynamic risk management throughout every session.
Explore the Full Architecture Documentation for subsystem details, data flow diagrams, and key design principles.
- src/main.py: Launches the application, handles user input, and manages the main trading loop.
- src/agent/decision_maker.py: Implements LLM-based trading decision logic via OpenRouter and TAAPI indicators.
- src/indicators/taapi_client.py: Interfaces with TAAPI to retrieve essential technical indicators.
- src/trading/hyperliquid_api.py: Directly interacts with the Hyperliquid DEX to execute trades.
- src/config_loader.py: Responsible for parsing and centralizing configuration from the
.envfile.
Configure your environment swiftly:
Create your .env file (reference .env.example), with the following keys:
TAAPI_API_KEYHYPERLIQUID_PRIVATE_KEY(orLIGHTER_PRIVATE_KEY)OPENROUTER_API_KEYLLM_MODEL- Optional:
OPENROUTER_BASE_URL(default:https://openrouter.ai/api/v1) - Optional:
OPENROUTER_REFERER,OPENROUTER_APP_TITLE
- TAAPI_API_KEY: Sign up at TAAPI.io and obtain your API key via the dashboard.
- HYPERLIQUID_PRIVATE_KEY: Generate an Ethereum-compatible private key, e.g., using MetaMask or the
eth_accountlibrary. Keep this key confidential. - OPENROUTER_API_KEY: Create your account at OpenRouter.ai and generate an API key in your settings.
- LLM_MODEL: Specify a model such as
"x-ai/grok-4". See the OpenRouter documentation for supported models.
Launch the agent with:
poetry run python src/main.py --assets BTC ETH --interval 1hWhen running, the agent exposes these minimal API endpoints:
- GET
/diary?limit=200: Returns recent trading diary entries in JSON format. - GET
/logs?path=llm_requests.log&limit=2000: Streams recent log file entries.
Bind the host/port by setting these variables in your environment:
API_HOST(default:0.0.0.0)API_PORTorAPP_PORT(default:3000)
Build and run with ease:
docker build --platform linux/amd64 -t trading-agent .
docker run --rm -p 3000:3000 --env-file .env trading-agent
# Access the agent: curl http://localhost:3000/diaryThe agent leverages dynamic tool calls to access any TAAPI indicator (including EMA, RSI, and more) on demand. See the TAAPI Indicator Reference and this EMA Example to learn more.
Run the trading agent securely on EigenCloud within a Trusted Execution Environment (TEE) and enjoy secure, decentralized key management.
- Allowlisted Ethereum account on Sepolia testnet (EigenCloud Onboarding).
- Docker installed on your machine.
- Access to Sepolia ETH for deployments.
For macOS/Linux:
curl -fsSL https://eigenx-scripts.s3.us-east-1.amazonaws.com/install-eigenx.sh | bashFor Windows:
curl -fsSL https://eigenx-scripts.s3.us-east-1.amazonaws.com/install-eigenx.ps1 | powershell -docker login
eigenx auth login # Or: eigenx auth generate --storecp .env.example .env
# Edit .env: Set ASSETS, INTERVAL, and all API keys.
eigenx app deployeigenx app info --watch
eigenx app logs --watchAfter code or configuration changes:
eigenx app upgrade <app-name>For a full CLI reference, consult the EigenX Documentation.
For technical inquiries, support, or to connect with the developer community, reach out via Telegram:
Telegram
