Hyperliquid Copy Trader
Self-hosted Hyperliquid whale tracker & copy trading bot. Real-time positions, PnL analytics, automatic trade mirroring with rating system. Python + Flask.
Install / Use
npx skills add Lindagrey/hyperliquid-copy-traderInstalls into whichever agent you are using.
README
HL Wallet Analyzer
Real-time whale tracking & automatic copy trading for Hyperliquid DEX
A self-hosted, real-time wallet tracker and automatic copy trading engine for Hyperliquid DEX. Track any number of whale wallets simultaneously, analyze their strategies with a mathematical rating system, and mirror their trades on virtual or live capital — from a single browser tab.
Features
Wallet Analytics
- Multi-wallet tracking via persistent WebSocket connections
- Live positions, orders, P&L and ROE updated in real time
- TP/SL trigger orders with badges and trigger prices
- SQLite trade history with pagination, sorting and coin filter
- Cumulative PnL column in history
- "Since tracking" P&L — only trades after the wallet was added
- Coin breakdown: Since Tracking vs All Time tabs
- Activity analysis: hourly and daily trade charts
- Order price analysis: avg distance of limit price from mark at placement
- Multi-wallet dashboard with P&L leaderboard
- CSV export + Win/Loss streaks
Copy Trading Simulation
- Automatic copy engine running on virtual capital — zero real risk
- Proportional sizing: mirrors trader's position as % of their portfolio × your allocation
- Per-wallet allocation sliders (must sum ≤ 100%)
- Universal and per-wallet TP/SL
- Trader rating system (0–100, tiers S/A/B/C/D) with minimum rating filter
- Conflict resolution: opposite signals on same coin → higher-rated trader wins
- Full activity log explaining every action (COPY / SKIP / CLOSE / TP HIT / SL HIT / CONFLICT)
- Live virtual positions table with real-time P&L
- Closed trades history with full stats
- State persisted in
localStoragebetween browser sessions
Hyperliquid Live Trading (hl_trading.py)
- Limit and market orders signed with EIP-712 via
eth_account - Close positions, cancel single or all orders
- TP/SL trigger order placement
- Leverage and isolated margin management
- Full balance, positions, and open orders via the Info API
Extended.exchange Live Trading (extended_trading.py)
- Limit and market orders on a Starknet perpetuals DEX
- Close positions, cancel single or all orders
- Account balance: collateral, equity, available margin
- Positions, open orders, and available markets listing
- Authentication via API Key + Stark signature (SNIP-12)
Stack
| Layer | Tech |
|---|---|
| Backend | Python 3.13, Flask, flask-cors |
| Async / WS | asyncio + websockets (daemon thread) |
| Database | SQLite (WAL mode) |
| Frontend | Vanilla JS, SSE (Server-Sent Events), Chart.js 4 |
| HL API | REST https://api.hyperliquid.xyz/info, WS wss://api.hyperliquid.xyz/ws |
| HL Trading | hyperliquid-python-sdk, eth_account (EIP-712) |
| Extended | x10-python-trading, Starknet (SNIP-12) |
Quick Start
git clone https://github.com/yourname/hl-wallet-analyzer.git
cd hl-wallet-analyzer
pip install -r requirements.txt
python web_app.py --port 5030
Open in browser: http://127.0.0.1:5030
Usage
Analytics
- In the Wallets section, click + Add → enter a
0xaddress - The wallet auto-subscribes to WebSocket — live data streams immediately
- Click Analyze once to load full historical trades from the HL API
- Switching between wallets uses the in-memory cache (no extra API calls)
Copy Trading Simulation
- Go to API Trading → Simulation
- Configure starting balance, allocations per wallet, TP/SL, and minimum rating
- Click ▶ Start — the engine starts copying trades in real time via SSE
Hyperliquid Live Trading
from hl_trading import HLTrader
trader = HLTrader(private_key="0x...", account_address="0x...")
trader.place_limit_order("BTC", is_buy=True, size=0.001, price=60000)
trader.place_tp_sl("BTC", is_buy=False, size=0.001, tp_price=65000, sl_price=58000)
trader.close_position("BTC")
Extended Live Trading
from extended_trading import ExtendedTrader
trader = ExtendedTrader(vault="0x...", private_key="0x...", public_key="0x...", api_key="...")
trader.place_limit_order("BTC-USD", side="BUY", size="0.001", price="60000")
trader.close_position("BTC-USD")
Project Structure
hl_wallet_analyzer/
├── web_app.py # Flask server, DB, WS manager, all API routes
├── hl_analyzer.py # Read-only CLI helper — DO NOT MODIFY
├── hl_trading.py # Hyperliquid trading functions
├── extended_trading.py # Extended.exchange trading functions
├── templates/
│ └── index.html # Single-page app shell
├── static/
│ ├── app.js # All frontend logic (~2350 lines)
│ └── style.css # Styles
└── requirements.txt
Trader Rating System
| Component | Weight | Formula |
|---|---|---|
| Win Rate | 35 pts | wins / total × 35 |
| Profit Factor | 35 pts | min(gross_profit / (gross_loss + fees), 4) / 4 × 35 |
| Experience | 20 pts | min(trade_count, 300) / 300 × 20 |
| Consistency | 10 pts | (1 - max_loss_streak × 2 / max(trade_count, 1)) × 10 |
Tiers: S 80–100 · A 65–79 · B 50–64 · C 35–49 · D 0–34
Notes
- Don't spam the Analyze button — Hyperliquid rate-limits at 429. Wallet switching uses cache
- Simulation runs client-side: it only works while the browser tab is open
- This is a Flask dev server — not for production deployment
hl_trading.pyandextended_trading.pyrequire extra packages:pip install hyperliquid-python-sdk eth_account x10-python-trading- For Extended, obtain Stark keys from Extended.exchange → Settings → API Management
License
MIT
💡 Tips: Finding & Analyzing Whale Wallets
Why Copy Trading Works on Hyperliquid
Hyperliquid is a fully on-chain perpetuals DEX — every trade, position, and fill is publicly visible in real time. Unlike CEXes where order flow is opaque, on Hyperliquid you can:
- See the exact entry and exit price of any wallet
- Watch position sizes and leverage in real time
- Observe TP/SL placement strategies
- Track funding payments and their timing
- Identify whether a trader scales in (DCA) or enters all at once
This makes it one of the few venues where copying a skilled trader is technically feasible with high fidelity.
How to Find Interesting Whale Wallets
1. Hyperliquid Leaderboard
- Go to app.hyperliquid.xyz/leaderboard
- Filter by 30-day PnL or All-time PnL
- Focus on wallets with consistent returns, high trade count, no single "lucky" spike
- Copy the wallet address and paste it into this tool
2. On-chain Explorer
- Use hypurrscan.io to browse recent large fills
- Large-size fills from unknown wallets are worth investigating
- Look for wallets that trade multiple assets — it shows systematic thinking, not gambling
3. Social Signals
- Twitter/X: search for Hyperliquid PnL screenshots — traders often reveal their address
- Telegram alpha groups frequently post HL wallet addresses of known whales
- Cross-reference with the leaderboard to verify performance is real
4. Vault Tracking
- Hyperliquid Vaults are public managed strategies — their deployer address is trackable
- A vault with consistent inflows + high APY usually has a skilled manager behind it
How to Analyze a Wallet with This Tool
Once you have an address:
- Add the wallet → click + Add in the Wallets panel. WebSocket subscribes instantly.
- Analyze → loads full fill history. Look at:
- Win Rate and Profit Factor in the rating badge
- Coin Breakdown → which coins the trader focuses on
- Activity chart → what hours and days they trade (timezone clues)
- Order Price Analysis → how far from mark they place limits (market-making vs directional)
- Trade History → sort by
Net PnL ↓to find their best trades. What coin, what leverage, how long was it held? - Streak data → a long recent win streak may be a hot streak, not a permanent edge. Check streak vs total trade count ratio.
- Since Tracking PnL → the most honest number: P&L since YOU started watching, not cherry-picked history.
Red flags to avoid:
- High all-time PnL but only 1–2 big trades (lucky, not skilled)
- Trades only during a specific bull run period
- High leverage (>20×) on every trade — eventually blows up
- Very few trades (<20) — not enough sample size
Green flags to copy:
- 100+ trades, consistent win rate >55%, profit factor >1.5
- Trades multiple coins, not just one
- Uses moderate leverage (5–15×)
- Regular activity across different market conditions
Simulation-First Workflow (Recommended)
Before copying anyone with real money:
- Add 3–5 wallet candidates to the tracker
- Go to Simulation, set a virtual balance (e.g. $10,000), allocate across wallets
- Run for at least 2 weeks — one trade is not a sample
- Compare: who actually performed during the period YOU were watching?
- Only promote a wallet to live trading after it proves itself in simulation
This protects you from past-performance bias — the leaderboard shows historical results, simulation shows real-time edge.
Related Skills
codebase-memory-mcp
38.1kHigh-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
codebase-memory-mcp
38.1kHigh-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
codebase-memory-mcp
38.1kHigh-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
tabularis
4.0kOpen-source desktop SQL workspace for PostgreSQL, MySQL/MariaDB, SQLite and 15+ more databases like DuckDB, ClickHouse, Redis and Firestore. Built-in MCP server for Claude, Cursor and Devin, SQL notebooks and visual EXPLAIN.
