A tool that tracks a Hyperliquid account's BTC position and pending orders, then scales them proportionally based on your position size. Available as both a Telegram bot and CLI.
- Telegram Bot with automatic position change notifications
- Real-time BTC price tracking
- Position monitoring (direction, size, entry price, P&L)
- Proportional order scaling based on your position size
- User position storage with comparison to tracked account
- Background polling with change detection
- Create a bot with @BotFather and get your token
- Set environment variables:
TELEGRAM_BOT_TOKEN=your_bot_token_here
HYPERLIQUID_ADDRESS=0x... # Optional, defaults to weishen's address- Run the bot:
make bot| Command | Description |
|---|---|
/start, /menu |
Show main menu with options |
/price |
Get current BTC price |
/weishen |
View tracked account's position and orders |
/me |
View your position with scaled orders |
/set SIZE ENTRY |
Set your position (e.g., /set 0.05 92000) |
Send a number directly to get scaled orders:
0.05- Scale for long 0.05 BTC-0.05- Scale for short 0.05 BTC
The bot automatically polls the tracked account every 10 minutes and sends notifications when:
- Position direction changes
- Position size changes
- Entry price changes
- Orders are added, removed, or modified
make run
# or
python -m cli.mainThe CLI prompts for:
- Position direction (long/short)
- Your BTC position size
pip install -r requirements.txt
# or
make install| Variable | Description | Default |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Telegram bot token | Required for bot |
HYPERLIQUID_ADDRESS |
Account address to track | weishen's address |
DATA_DIR |
Directory for data files | . (current dir) |
hyperliquid-order-scale/
├── bot/
│ └── main.py # Telegram bot
├── cli/
│ └── main.py # CLI interface
├── core/
│ ├── engine.py # Shared business logic
│ └── storage.py # User state persistence
├── tests/
│ ├── test_engine.py # Core logic tests
│ └── test_bot.py # Bot tests
├── requirements.txt
└── Makefile
make test-
Set environment variables in Railway dashboard:
TELEGRAM_BOT_TOKENDATA_DIR=/data(for persistent storage)
-
Deploy - the bot starts automatically via
make bot
MIT License - see LICENSE file.