← Back to all posts

engineering

Paper Trading Bot: Research Stack for Hyperliquid Perps

A case study in separating research, simulation, analytics, dashboarding, and live-risk controls in a Hyperliquid trading system.

27 Apr 20264 min read
  • #python
  • #trading
  • #hyperliquid
  • #react

Problem

Trading experiments become hard to trust when research, execution, analytics, and live-risk controls blur together. A strategy script can answer "does this signal fire?" but it usually does not answer the more operational questions: what state did the bot write, how did it behave across sessions, what does the dashboard show, and where is the line between paper simulation and real orders?

Paper Trading Bot grew out of that problem. It is a Python-first Hyperliquid perps research stack that keeps simulation, backtesting, analytics, dashboarding, and live execution boundaries visible instead of hiding them inside one opaque runner.

Paper Trading Bot runtime boundaries

Constraints

The first constraint was safety. The original idea was paper trading, but the current repo now includes live Hyperliquid execution paths. That makes mode separation more important than feature count.

The second constraint was inspectability. Paper mode needed local config and local runtime artifacts so experiments could be audited without depending on a hidden service.

The third constraint was breadth. The system is not one strategy. The latest wiki ingest recorded thirteen strategy implementations, adaptive controls, persistent analytics, Telegram hooks, Supabase-backed config/sync surfaces, and a separate React dashboard.

Build

The backend is organized around operational responsibilities:

  • src/core/, src/bot/, and src/data/ cover broker behavior, bot orchestration, Hyperliquid data access, and runtime persistence.
  • src/strategies/ holds the strategy catalog: momentum, mean reversion, RSI, breakout, EMA and MACD crossover, ATR trailing, VWAP reversion, scalping, Ichimoku, support/resistance bounce, funding arbitrage, and order flow.
  • src/indicators/, src/analytics/, and src/adaptive/ provide signals, reporting, regime detection, performance tracking, and automatic strategy scaling or disable behavior.
  • src/sync/ and src/notifications/ cover Supabase sync/config paths and Telegram notifications.
  • frontend/ is a separate React/Vite dashboard with local API-backed reads for paper workflows and Supabase-capable paths for remote/live workflows.

The key decision is explicit mode separation:

  • Paper mode reads YAML bot config, uses PaperBroker, and writes local session/status/analytics files under data/.
  • Live mode uses LiveBroker, separate live status/session files, Supabase-backed config loading, and explicit emergency-stop/account/position controls.
  • Dashboard mode reads from local API-backed data for paper workflows and can use Supabase-capable paths for remote/live workflows.

That makes the system easier to reason about. A command can validate, dry-run, backtest, report analytics, serve the dashboard, or operate live surfaces, but the risky path is not treated as a casual toggle.

Result

The result is closer to a small trading platform than a folder of strategy scripts:

  • Multi-bot paper trading with isolated portfolios.
  • Backtesting and historical-data management.
  • Session, status, candle, and analytics persistence.
  • Adaptive strategy controls and performance tracking.
  • React dashboard surfaces for monitoring.
  • Explicit live execution commands and emergency controls.

The public-readiness work is partly done. The latest wiki ingest recorded a clean main branch, recent README and hardening commits, and ignore rules that exclude env files, generated DB/log files, caches, and the vendored Hyperliquid SDK.

There is still validation debt. Repo-root pytest collection was noisy in the ingest environment because it hit local import collection failures and vendored SDK tests. So the current honest status is: the product surface is real, but the default validation entrypoint needs cleanup before the repo can claim a clean one-command test path.

Lesson

The main lesson is boundary management. Trading software has natural pressure to blur research, simulation, execution, and observability because they all orbit the same market data and bot state.

This project is useful because it keeps those boundaries visible. Paper mode stays local and inspectable. Live mode is explicit and higher risk. Analytics and dashboarding are first-class surfaces rather than afterthoughts. The old paper-only spec is treated as historical context, not current truth.

That is the engineering story: not just building trading strategies, but designing the operating system around them.

Related posts

Continue with articles that overlap in category or shared tags.