Automated copy trading bot for Hyperliquid DEX with real-time monitoring and smart position sizing
Hyperliquid Copy Trader
Automated copy trading bot for Hyperliquid DEX. Copies trades from any wallet in real-time with automatic position sizing.
Features
- Real-time trade copying via WebSocket
- Automatic position sizing based on account balance ratio
- Integer leverage with asset-specific limits
- Market and limit order support
- Copy existing positions on startup
- Simulated trading mode for testing
- Telegram notifications (optional)
Quick Start
Docker (Recommended)
docker-compose up -d
Manual Installation
- Install Python 3.12+
- Install dependencies:
pip install -r requirements.txt
- Configure .env file with your settings
- Run the bot:
python src/main.py
Configuration
Edit the .env file:
# Hyperliquid API
HYPERLIQUIDAPIURL=https://api.hyperliquid.xyz
Your Hyperliquid credentials (leave empty for simulation)
HYPERLIQUIDWALLETADDRESS=
HYPERLIQUIDPRIVATEKEY=
Target to copy (wallet or vault)
TARGETWALLETADDRESS=0x...
Trading mode
SIMULATED_TRADING=true
SIMULATEDACCOUNTBALANCE=10000.0
Copy settings
COPYOPENPOSITIONS=true
COPYEXISTINGORDERS=true
AUTOADJUSTSIZE=true
USELIMITORDERS=false
LEVERAGE_ADJUSTMENT=1.0
MAXOPENTRADES=x
MAXOPENORDERS=x
MAXACCOUNTEQUITY=x
Asset Filters
BLOCKED_ASSETS=BTC,ETH # Comma-separated list (e.g., BTC,ETH,SOL)
Telegram (optional)
TELEGRAMBOTTOKEN=
TELEGRAMCHATID=
Database
DATABASE_URL=sqlite:///./data/trading.db
Logging
LOG_LEVEL=INFO
LOG_FILE=./logs/trading.log
Notes:
TARGETWALLETADDRESSaccepts either a wallet address or a vault address.xmeans unlimited; set an integer to capMAXOPENTRADES,MAXOPENORDERS, orMAXACCOUNTEQUITY.- Hyperliquid enforces a $10 minimum notional per order. If your account is much smaller than the target, small fills will be skipped when the proportional size falls below $10. Increase balance or reduce the ratio gap to copy more trades.
Leverage Adjustment
The LEVERAGE_ADJUSTMENT setting controls risk:
- 0.5 = Use 50% of target's leverage (safer)
- 1.0 = Match target's leverage exactly
- 2.0 = Use 200% of target's leverage (more aggressive)
Blocked Assets
The BLOCKED_ASSETS setting lets you exclude specific assets from copying:
BLOCKED_ASSETS=BTC,ETH,SOL
When the target wallet trades these assets, the bot will:
- Log a warning message
- Skip copying the trade
- Continue monitoring other assets normally
- Avoiding high-volatility assets
- Excluding assets you're manually trading
- Managing risk by limiting exposure to certain markets
Position Sizing
Position sizes are automatically calculated based on the ratio of your account balance to the target wallet balance.
Example:
- Target wallet: $100,000
- Your account: $10,000
- Ratio: 1:10
- Target opens 1 BTC position = You open 0.1 BTC position
Docker Commands
Windows
Use the batch files in the windows/ folder:
cd windows
start.bat # Start the bot
logs.bat # View logs
stop.bat # Stop the bot
Linux/Mac
Use the shell scripts in the linux/ folder:
cd linux
chmod +x *.sh # Make executable (first time only)
./start.sh # Start the bot
./logs.sh # View logs
./stop.sh # Stop the bot
Manual Docker Commands
Start bot:
docker-compose up -d
View logs:
docker-compose logs -f
Stop bot:
docker-compose down
Rebuild after code changes:
docker-compose up -d --build
Telegram Bot
To enable Telegram notifications:
- Create bot with @BotFather on Telegram
- Get your bot token
- Send a message to your bot
- Get your chat ID from: https://api.telegram.org/bot
<TOKEN>/getUpdates - Add both values to .env file
- /status - Bot status and balance
- /positions - Current positions
- /pnl - Profit and loss report
- /pause - Pause copying
- /resume - Resume copying
Disclaimer
Trading cryptocurrencies involves substantial risk of loss. This software is provided as-is without any warranties. Use at your own risk. The author is not responsible for any financial losses.
Support
Discord: maskiplays
Donations
If you find this bot useful, donations are appreciated:
Arbitrum USDC: 0x2987F53372c02D1a4C67241aA1840C1E83c480fF Dont look at PNL :(