Build a Hyperliquid Analytics Dashboard: From Zero to Production

May 11, 2026

For active Hyperliquid docs traders and quantitative researchers, a real-time analytics dashboard can make position monitoring, funding-rate tracking, and PnL review much more efficient. This guide walks through how to build a practical Hyperliquid dashboard using open-source tools, from data collection and storage to front-end visualization.

The goal is to create a dashboard that helps you monitor positions, track funding, analyze performance, and act more consistently. It is not a trading signal engine, and it does not predict returns.

Key comparison table

ModuleData SourceRefresh Frequency
Account Balance and Available MarginclearinghouseState10–30 seconds
Current Positions and Unrealized PnLclearinghouseState10–30 seconds
Historical Funding Rate TrendsfundingHistoryHourly
Recent Trade RecordsuserFillsOn demand
Market-wide Funding Rate RankingmetaAndAssetCtxsEvery minute
Order Book Depthl2BookReal-time (WebSocket)

What should a Hyperliquid dashboard include?

A useful Hyperliquid analytics dashboard usually includes several core modules:

  • Account overview: account value, withdrawable margin, margin usage, leverage, and liquidation risk indicators.
  • Open positions: coin, side, size, entry price, mark price, unrealized PnL, and margin usage.
  • Funding rates: current and historical funding rates across markets.
  • PnL analysis: realized and unrealized PnL, position-level contribution, and historical equity changes.
  • Market data: asset metadata, mark prices, order book snapshots, and recent trades.
  • Alerts: funding spikes, margin thresholds, large PnL changes, or abnormal market moves.

The Hyperliquid official documentation lists the available Info Endpoint types and WebSocket subscription options.

A practical open-source stack looks like this:

  • Backend data collection: Python + requests, or aiohttp for async collection.
  • Data storage: SQLite for lightweight local usage, or PostgreSQL + TimescaleDB for time-series data.
  • Dashboard framework: Streamlit for fast Python-native prototypes, or Grafana for more robust monitoring.
  • Real-time updates: Hyperliquid WebSocket API.

For quick validation, Streamlit is usually the fastest option. For production monitoring, team usage, historical storage, and alerting, Grafana + TimescaleDB is more durable.

Data collection layer

Fetch account state

import requests
import time

ENDPOINT = "https://api.hyperliquid.xyz/info"

def fetch_account_state(address: str) -> dict:
    payload = {"type": "clearinghouseState", "user": address}
    r = requests.post(ENDPOINT, json=payload, timeout=10)
    r.raise_for_status()
    return r.json()

def fetch_market_data() -> dict:
    payload = {"type": "metaAndAssetCtxs"}
    r = requests.post(ENDPOINT, json=payload, timeout=10)
    r.raise_for_status()
    return r.json()

The clearinghouseState response is useful for account-level metrics and open positions. metaAndAssetCtxs can be used to retrieve market metadata and current asset context.

Batch collect funding rates

def fetch_all_funding_rates(coins: list, days: int = 1) -> dict:
    end_ms = int(time.time() * 1000)
    start_ms = end_ms - days * 24 * 3600 * 1000
    results = {}

    for coin in coins:
        payload = {
            "type": "fundingHistory",
            "coin": coin,
            "startTime": start_ms,
        }
        r = requests.post(ENDPOINT, json=payload, timeout=10)
        if r.ok:
            results[coin] = r.json()

    return results

You can run this on a schedule and store the results in SQLite or PostgreSQL for historical funding-rate charts.

Subscribe to real-time trades with WebSocket

For real-time order flow, latest trades, or order book views, use Hyperliquid’s WebSocket API:

import asyncio
import websockets
import json

WS_URL = "wss://api.hyperliquid.xyz/ws"

async def subscribe_trades(coin: str):
    async with websockets.connect(WS_URL) as ws:
        sub_msg = {
            "method": "subscribe",
            "subscription": {"type": "trades", "coin": coin},
        }
        await ws.send(json.dumps(sub_msg))

        while True:
            msg = await ws.recv()
            data = json.loads(msg)
            print(data)

asyncio.run(subscribe_trades("BTC"))

For long-running services, add ping/pong handling, reconnect logic, and error logging. WebSocket connections can drop, and a production dashboard should recover automatically.

Build the dashboard UI with Streamlit

Streamlit is a good choice if you want a simple dashboard in pure Python. Below is a minimal example that shows account metrics, positions, and unrealized PnL by market.

import streamlit as st
import pandas as pd
import plotly.express as px

st.set_page_config(page_title="Hyperliquid Dashboard", layout="wide")

ADDRESS = st.sidebar.text_input("Wallet address", value="0x...")

if ADDRESS.startswith("0x"):
    state = fetch_account_state(ADDRESS)
    margin = state.get("marginSummary", {})

    account_value = float(margin.get("accountValue", 0))
    withdrawable = float(margin.get("withdrawable", 0))
    total_raw_usd = float(margin.get("totalRawUsd", 0))
    leverage = total_raw_usd / max(account_value, 1)

    col1, col2, col3 = st.columns(3)
    col1.metric("Account Value (USDC)", f"${account_value:,.2f}")
    col2.metric("Withdrawable Margin", f"${withdrawable:,.2f}")
    col3.metric("Leverage", f"{leverage:.1f}x")

    positions = state.get("assetPositions", [])

    if positions:
        pos_data = []

        for p in positions:
            pos = p.get("position", {})
            size = float(pos.get("szi", 0))

            pos_data.append({
                "Coin": pos.get("coin"),
                "Side": "Long" if size > 0 else "Short",
                "Size": abs(size),
                "Unrealized PnL": float(pos.get("unrealizedPnl", 0)),
                "Entry Price": float(pos.get("entryPx", 0)),
            })

        df = pd.DataFrame(pos_data)
        st.dataframe(df)

        fig = px.bar(
            df,
            x="Coin",
            y="Unrealized PnL",
            color="Side",
            title="Unrealized PnL by Position",
        )
        st.plotly_chart(fig, use_container_width=True)

From here, you can add:

  • Funding-rate charts by coin.
  • Historical account value snapshots.
  • Position-level PnL attribution.
  • Margin alerts.
  • WebSocket-driven recent trades.

Streamlit is especially useful when you want to iterate quickly and keep the full workflow in Python.

Build a production dashboard with Grafana

If you need shared access, alerting, historical storage, or long-term observability, Grafana is usually the better option.

A typical setup:

  1. Start Grafana locally:

    docker run -d -p 3000:3000 grafana/grafana
    
  2. Set up PostgreSQL + TimescaleDB as the time-series database.

  3. Write a scheduled Python collector that stores account, position, funding, and market data every minute.

  4. Connect Grafana to the database.

  5. Create panels with SQL queries.

  6. Configure alerts, for example when funding rates exceed a threshold or margin usage rises above a chosen level.

Grafana is more work upfront, but it is much better for monitoring that needs to run continuously.

OneKey Wallet: the security layer behind your dashboard

Reading a wallet address through a dashboard is generally a read-only operation. But once you use dashboard insights to place trades, private-key security becomes critical.

A OneKey hardware wallet keeps private keys inside a physical secure element, helping reduce the risk of key extraction even if your computer is compromised by malware.

Combined with OneKey Perps, you can move from analysis to execution more safely: monitor Hyperliquid data in your dashboard, then use hardware-backed signing when trading perpetuals. This creates a practical workflow: data analysis + risk awareness + safer execution.

If you actively trade perps, consider downloading OneKey and trying OneKey Perps as part of your trading setup. Keep position sizing conservative, review every transaction before signing, and never treat dashboard metrics as guaranteed trading signals.

FAQ

Q1: Does Hyperliquid provide an official Grafana data source plugin?

No official Grafana plugin is available at the time of writing. You can query the Hyperliquid API through Grafana-compatible JSON API or Infinity-style plugins, or collect data into an intermediate database such as PostgreSQL and query it from Grafana.

Q2: Can WebSocket connections disconnect automatically?

Yes. WebSocket connections may time out or disconnect after long periods of inactivity or network instability. Production collectors should implement heartbeat handling, automatic reconnects, retries, and logging.

Q3: Can a dashboard show another wallet’s account data?

Yes. Hyperliquid account data is publicly readable. If you provide a valid Ethereum address, you can query the related public account state. This also means your own account data is visible to others.

Q4: How can I set funding-rate alerts?

You can add conditional logic in your data collector. For example, if funding exceeds a chosen threshold such as 0.1% per hour, the script can send an alert through Telegram Bot API or email. Grafana also has built-in alerting features if you store the data in a database.

Q5: Is Streamlit or Grafana better for beginners?

Streamlit is easier for Python developers and works well for quick prototypes. Grafana has a steeper learning curve but is stronger for shared dashboards, alerting, historical data, and long-running production monitoring.

Risk notice

This article is a technical tutorial and is not investment, legal, or financial advice. Crypto assets and perpetual contracts are highly volatile and can lead to significant losses. Dashboard data is for reference only and does not predict future returns. Always understand the risks before trading.

Secure Your Crypto Journey with OneKey

View details for Shop OneKeyShop OneKey

Shop OneKey

The world's most advanced hardware wallet.

View details for Download AppDownload App

Download App

Scam alerts. All coins supported.

View details for OneKey SifuOneKey Sifu

OneKey Sifu

Crypto Clarity—One Call Away.