bsm.guru
local-first hyperliquid perp screener
local-only by default (wallet + trading routes are localhost-gated)

Spot weird perps. Quantify it. Trade it.

bsm.guru is a local-first screener that uses Black-Scholes-Merton-inspired lognormal assumptions as a baseline to quantify how unusual a perp move is vs realized volatility. The UI ranks Hyperliquid markets, suggests a small set of positions, and can optionally auto-enter/auto-exit based on your thresholds.

What it is

A volatility-normalized perp dashboard + trading helper for Hyperliquid. It syncs live mids and candles, computes realized volatility, and turns the last 24h move into a simple "how many sigmas was that?" score.

No options venue is integrated. Perps only.

What it is not

Not a hosted SaaS, not financial advice, and not a guarantee of edge. The "BSM" here is a baseline model (lognormal + constant vol) used to measure surprise, not to claim the market is "wrong."

You control the wallet keys. You control the risk.

Quick start (local)

The app is designed to run on a machine you control. Wallet keystores live on disk and trading routes are restricted to localhost by default.

Run:
./run.sh
Quality gates:
pnpm lint
pnpm test
pnpm build

Typical flow

1) Create a wallet in the app (stored on disk). 2) Fund the wallet on Arbitrum with USDC. 3) Deposit USDC into Hyperliquid from the wallet page. 4) Use the dashboard to enter positions (or enable auto-enter/auto-exit with conservative thresholds).

Data sync

The app periodically pulls Hyperliquid market data and candles, and stores derived metrics in a local SQLite database. This powers fast UI refreshes and consistent calculations.

Install / clone

If you want to run the tool from source, clone the repo and use the included runner script.

Clone + run:
git clone https://github.com/pierce403/bsm.guru.git
cd bsm.guru
./run.sh

If you prefer, you can also run the usual Next.js commands (pnpm dev), but ./run.sh handles the local sync loop.

Theory (the short version)

Black-Scholes-Merton assumes a lognormal price process with constant volatility. Crypto is not constant-vol and not perfectly lognormal - but the model still gives a convenient unit: "sigmas."

Why this is useful

Markets move around. A 3% move is boring for some assets and extreme for others. If you normalize moves by realized volatility, you can compare "how unusual" different markets are on the same scale, then decide whether to fade the move, follow momentum, or avoid it.

Metrics (what you see in the UI)

These are computed locally from Hyperliquid candles and market context. They are intentionally simple, inspectable, and fast.

Metric Meaning How it is computed
Realized σ Annualized realized volatility estimated from recent log-returns. Take log returns from candle closes, compute sample stdev per period, then annualize by sqrt(yearSeconds / periodSeconds).
Sigma move (24h) How many "sigmas" the last 24h move represents. log(mid / prevDayPx) / (sigma * sqrt(1/365)). Positive is up, negative is down.
Tail p (24h) Two-sided normal tail probability for that sigma move (smaller = rarer). 2 * (1 - Phi(|sigmaMove|)), where Phi is the standard normal CDF.
Position health A "still good?" score based on how the market's current sigma move compares to what you entered on. It can go down even if PnL is up. The app tracks entry context and recomputes the current sigma move. Health is tied to the persistence of the original signal, not just profit.

Automation (auto-enter / auto-exit)

Auto trading is deliberately constrained: the app exits first, then enters up to the cap.

Guardrails

By default, the app keeps a maximum of 5 concurrent positions and requires your thresholds to be met at refresh time. Use conservative settings first and verify behavior with small notionals.

What triggers actions

After each refresh cycle, auto-exit evaluates open positions against your exit threshold. Auto-enter looks at the current ranking and enters the best eligible position(s) until the cap is reached.

Safety, limitations, and logs

This tool touches real money if you enable trading. Treat it like a small trading system, not a dashboard toy.

Important: bsm.guru is designed to run in a local, secure environment. Do not expose the wallet APIs or trading APIs to the public internet.

Limitations

The sigma metrics assume normality of log returns and a stable realized vol estimate. Crypto frequently violates both assumptions (fat tails, regime shifts, jumps). Use these metrics as context, not certainty.

Audit trail

The app writes human-readable logs under ./logs/ (trade, wallet, analysis, errors). Private keys are not logged. Every trade action aims to leave a proof link via Hypurrscan / Dexly for external verification.

Contributing

Contributions are welcome. If you have ideas for better signals, safer execution, or clearer UX, please jump in.

Good starter contributions

Improve signal definitions, add risk controls (cooldowns, max daily trades), add better observability (dashboards, structured logs), and expand Playwright coverage for wallet and trading flows.

How to contribute

Open an issue describing the change, then submit a PR. Please keep commits small, run the quality gates, and include a short note on how you tested.

Before opening a PR:
pnpm lint
pnpm test
pnpm build
pnpm playwright test