Skip to content

Repository files navigation

hl-tui

Hyperliquid charts + an interactive trade planner, in your terminal.

Live candlesticks for any Hyperliquid market — standard crypto perps and builder-dex equities (NVDA, MU, …) — with positions, fills, and resting TP/SL overlaid. Draw a trade plan by dragging Entry / TP / SL handles with the mouse, watch the R:R and dollar risk update live, and (optionally) place it through an executor service you control. The signing key never touches this app.

┌─ chart (candles + overlays) ───────────────┐ ┌─ side ──────────────┐
│  1,145 ·······════════════════════ TP 1141 │ │ MU 5m  +1.8%        │
│        █▟▖                                  │ │ mark 1031.85        │
│  1,038 ─███▆▄──────────────◄ENTRY 1038►──── │ │ PLAN LONG  R:R 2.0  │
│        ·····██▙▄▖··················· POS    │ │ entry 1031.85       │
│    985 ·······════════════════════ SL  985 │ │ tp 1052  +$0.41     │
│  vol   ▂▃▁▅█▆▂▁▃▄▂▁▁▂▅▃▁▂▁▃▆▄▂▁▁▂▃▁▂▄▁▂▃▁▂ │ │ sl 1021  -$0.21     │
└────────────────────────────────────────────┘ │ [ARM ○]  PLACE      │
                                                └─────────────────────┘

Why

  • Zero-config view mode. pip install, type a ticker, get charts. No keys, no account, no API token — reads hit Hyperliquid's public API directly.
  • Spectate any address. hl-tui --address 0x… overlays that account's entries, buy/sell fills, TP/SL, live risk, and full trade history. Watch a whale's book, or your own.
  • Plan with your hands. Drag the amber Entry, mint TP, coral SL handles on the chart. Direction is inferred (TP above entry = long); R:R, dollar risk/reward, and position size recompute on every drag.
  • Keys stay out of the TUI. Order placement is an HTTP intent to your own executor service (tiny contract, documented) — or simply never configured, and the app is strictly read-only.

Install

pipx install hl-tui          # or: uv tool install hl-tui / pip install hl-tui
hl-tui BTC

From source:

git clone https://github.com/psychedelanon/hl-tui
cd hl-tui
pip install -e .
hl-tui NVDA --tf 4h

Requires Python 3.10+ and a terminal with mouse support (Windows Terminal, iTerm2, kitty, WezTerm, Alacritty, …).

Use

hl-tui                       # open on your watchlist
hl-tui MU --tf 15m           # open MU on the 15-minute chart
hl-tui --grid                # straight into the multi-chart grid
hl-tui --address 0xABC...    # overlay any account (spectator mode)
hl-tui --testnet             # hyperliquid testnet

Controls

key action
/ then type search the whole ticker universe (live matches); Enter adds + opens
1–6 or buttons timeframe 5M / 15M / 1H / 4H / 1D / 1W
mouse hover crosshair: OHLC, % change, volume of the candle under the cursor
N draw a new plan around the mark price
mouse drag move the Entry / TP / SL handle
D flip the plan long ⇄ short
C clear the plan
G multi-chart watchlist grid (click a pane to open it)
B portfolio: positions, P&L, strategy stats, trade history
L / X load / remove the highlighted watchlist ticker
I reopen the latest ⚡ catalyst
R refresh now (auto-refreshes every 6 s)
ARM switch enable live placement (off = view-only, always safe)
P flat: place the plan · in a position: update TP/SL to the handles
W close the open position (two-press confirm; armed only)
Q quit

When you hold a position, the app enters manage mode: the handles seed to your live TP/SL — drag them and press P to move your stops, or W to flatten.

The grid

G opens a Cryptowatch-style wall of live mini-charts — every ✓-enabled watchlist ticker with candles, your entry line, fill dots, and a border tinted by your position (mint long / coral short). 1–6 set the timeframe for all panes, C cycles column density, [/] page through big watchlists, and a book bar keeps live uPnL / realized-today / equity totals on top. Account data is fetched once and shared; candle loads are staggered to stay under API rate limits.

Portfolio (B)

Equity and per-pool free margin, open positions with live distance-to-SL/TP, a strategy panel (win rate, expectancy, profit factor, concentration warnings), and recent trade history with realized P&L — all from public data.

Catalyst inbox ⚡

Push a ticker at the TUI and it surfaces within seconds — toast, watchlist, chart open — so you go from headline to a sized plan in one motion:

python -m hl_tui.catalyst MRVL "guidance blowout — +18% o/n"

Remote feeds (scanners, bots) can push through your executor's /catalysts relay — see docs/EXECUTOR.md.

Configuration

Everything is optional. Set env vars, or copy .env.example to .env and use the bin/ launchers which auto-load it.

variable what it does
HL_ADDRESS account overlaid on charts / grid / portfolio (any address)
HL_EXECUTOR_URL / HL_EXECUTOR_TOKEN your order executor (contract); unset = view-only
HL_API_URL API endpoint (default mainnet; --testnet overrides)
HL_DEX builder dex merged into the universe (default xyz, the equities dex)
HL_TUI_HOME state dir for watchlist + catalyst inbox (default ~/.hl-tui)
HL_STATS_SINCE UTC date (2026-01-01) the portfolio strategy stats start from
HL_RAIL_MAX_POS / HL_RAIL_MAX_LEV / HL_RAIL_MAX_HEAT risk-panel warning rails (default 3 / 10 / 25)

Placing real orders

  1. Run an executor — any HTTP service implementing the three-endpoint contract with the official Hyperliquid SDK. Use an agent wallet so the key can trade but never withdraw.
  2. Set HL_EXECUTOR_URL + HL_EXECUTOR_TOKEN.
  3. In the TUI: draw a plan, set size, flip ARM, press P.

The ARM switch is the gate: while it's off (the default, every launch) nothing can be placed, updated, or closed.

Claude Code plugin

/plugin marketplace add psychedelanon/hl-tui
/plugin install hl-tui

Then /hl-tui:chart MRVL or /hl-tui:grid to launch from a Claude session.

Development

pip install -e . ruff
ruff check .
python tests/test_chart.py && python tests/test_state.py   # offline, no network
python smoke.py BTC                                         # live-API render check

hl_tui/chart.py is a dependency-light candlestick renderer (rich Text rows + a price↔row geometry for mouse mapping) that's easy to reuse in other projects.

Disclaimer

This is a tool, not advice. Perps are leveraged instruments; you can lose more than you planned. Nothing here places an order unless you run an executor, configure it, arm the switch, and press the key.

License

MIT

About

Hyperliquid charts + drag-handle trade planner in your terminal

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages