A comprehensive dashboard for viewing and analyzing trader performance data from HyperLiquid's ClickHouse database.
- Top Traders by PnL: View traders sorted by profit/loss in descending order
- Period Filtering: Filter data by 1 day, 7 days, 30 days, or all time
- Search Functionality: Search for specific traders by wallet address
- Real-time Data: Live data from ClickHouse database
- Performance Metrics: PnL, volume, trade count, win rate, average trade size
- Recent Orders: Latest trading orders with detailed information
- Recent Fills: Latest order fills and executions
- Interactive Charts: Visual representation of trader performance
- Responsive Design: Works on desktop, tablet, and mobile devices
- Beautiful Interface: Modern gradient design with smooth animations
- Intuitive Navigation: Easy-to-use interface with clear data presentation
The dashboard integrates with the following ClickHouse tables:
dm_perpetual_wallets_by_period: Main trader statistics and PnL datadm_perpetual_orders: Trader order history and detailsraw_node_fills_by_block: Order fill and execution datamv_wallet_stats: Additional trader metrics and statistics
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Configure environment variables: Create a
.envfile in the backend directory with your ClickHouse credentials:CLICKHOUSE_HOST=localhost CLICKHOUSE_PORT=8123 CLICKHOUSE_DATABASE=hyperliquid CLICKHOUSE_USERNAME=default CLICKHOUSE_PASSWORD=
-
Start the backend server:
npm run start:dev
The backend will run on
http://localhost:3000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the frontend:
npm start
The frontend will open in your browser at
http://localhost:8080
GET /traders- Get all traders sorted by PnLGET /traders?period=7d- Get traders for specific period (1d, 7d, 30d, ALL)GET /traders/search?q=wallet&period=ALL- Search traders by wallet addressGET /traders/:wallet- Get detailed information for a specific trader
GET /api/clickhouse/tables- Get available database tablesGET /api/clickhouse/tables/:table- Get data from specific tableGET /api/clickhouse/tables/:table/schema- Get table schemaPOST /api/clickhouse/query- Execute custom SQL queries
- Open the dashboard in your browser
- Use the period selector to filter by time range
- View traders sorted by PnL (highest to lowest)
- Click on any trader card to view detailed information
- Use the search box to find specific traders
- Enter wallet address (full or partial)
- Results update in real-time as you type
- Combine search with period filtering
- Click on a trader card to open the details modal
- View comprehensive performance metrics
- Examine recent orders and fills
- Analyze trading patterns and success rates
interface TraderStats {
wallet: string; // Trader wallet address
pnl: number; // Profit/Loss amount
total_volume: number; // Total trading volume
total_trades: number; // Number of trades
win_rate: number; // Percentage of profitable trades
avg_trade_size: number; // Average trade size
period: string; // Time period (1d, 7d, 30d, ALL)
}interface TraderDetail {
wallet: string; // Trader wallet address
stats: TraderStats[]; // Performance statistics
orders: any[]; // Recent orders
fills: any[]; // Recent fills
}- Modify the SQL queries in
backend/src/trader.service.ts - Update the TypeScript interfaces
- Add new UI components in the frontend
- Edit
frontend/styles.cssfor visual modifications - Update
frontend/index.htmlfor structural changes - Modify
frontend/script.jsfor functional enhancements
- Update ClickHouse queries in the service files
- Add new table integrations as needed
- Modify data transformation logic
Backend won't start:
- Check ClickHouse connection settings in
.env - Ensure ClickHouse server is running
- Verify database and table permissions
Frontend can't connect to backend:
- Confirm backend is running on port 3000
- Check CORS settings if needed
- Verify API endpoint URLs
No data displayed:
- Check database connection
- Verify table names and structure
- Review ClickHouse query syntax
- Use appropriate period filters to limit data
- Implement pagination for large datasets
- Add database indexes for frequently queried columns
- Cache frequently accessed data
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the ISC License.
For issues and questions:
- Check the troubleshooting section
- Review the API documentation
- Examine the code examples
- Create an issue in the repository