MM Flow

mmScript · Reference

mmScript reference + templates

mmScript is mmflow's screening DSL — a safe expression language for defining cross-coin screens as code. Compiles in-browser to a (coin → boolean) predicate evaluated against the live HL universe + cross-venue archives. No eval, no Function() — a hand-rolled lexer + parser + interpreter so we control safety.

Open editor Browse FlowScriptsSandboxed · no globals24 scalar variables · 5 indexed

Operators

evaluator returns a number; nonzero finite = true

OperatorMeaningExample
ANDBoolean conjunctionrsi > 70 AND funding > 0.0001
ORBoolean disjunctionvol_24h_usd > 1e7 OR oi_usd > 5e6
NOTBoolean negationNOT (oi_z > 2)
> >= < <=Numeric comparisonchange_24h > 0.05
= !=Equalityrsi != 0
+ - * /Arithmetic(funding['hl'] - funding['bin']) * 1e4
( )Grouping(rsi > 70 OR rsi < 30) AND vol_24h_usd > 1e7
[ ]Indexed access (venue/asset)funding['hl']

Scalar variables

current value for the row's coin

NameTypeDescription
fundingnumberFunding rate per period (HL = 1h). Decimal, e.g. 0.0001 = 1bp.
funding_znumberZ-score of current funding vs trailing 30d distribution (from /api/funding-rank).
funding_maxnumber30d max funding rate seen for this coin (HL).
funding_minnumber30d min funding rate seen for this coin (HL).
oinumberOpen interest in contract units (HL).
oi_usdnumberOpen interest in USD (HL · oi × markPrice).
oi_znumberZ-score of current OI vs 30d distribution.
oi_24h_changenumberOI change over 24h, decimal (0.10 = +10%).
vol_24hnumber24h volume in coin units (HL).
vol_24h_usdnumber24h volume in USD (HL).
premiumnumberSpot vs perp basis (HL, decimal).
premium_znumberZ-score of basis vs 30d distribution.
pricenumberMark price (HL).
change_24hnumber24h price change, decimal.
rsinumber14-period RSI on 1h candles, 0–100.
macdnumberMACD line (1h candles).
iv_atmnumberATM implied vol for the nearest weekly expiry (Deribit). Percent.
iv_skewnumber25Δ put − 25Δ call IV, percent (sign = bias).
gex_totalnumberTotal dealer gamma exposure for the coin (USD per 1% spot move).
gex_wall_distnumberDistance from spot to nearest gamma wall, fractional.
whale_notional_24hnumberSum of HL whale-tape notional ($ ≥ 50k prints) over last 24h.
liq_notional_24hnumberTotal liquidations on the coin over last 24h, USD (OKX archive).
leverage_avgnumberAverage leverage of HL traders on this coin.
crowdednessnumberComposite crowdedness score (oi_z + funding_z + premium_z).

Indexed variables

key is a string literal in brackets

FormValid keysDescription
funding[venue]hl, bin, byb, okx, lighter, asterFunding rate per period at the named venue.
oi[venue]hl, bin, byb, okxOpen interest in USD at the named venue.
vol[venue]hl, bin, byb, okx24h volume in USD at the named venue.
iv_atm[asset]btc, eth, sol, xrpATM IV for the given Deribit underlying (per asset, not per coin).
premium[venue]hl, bin, byb, okxSpot vs perp basis at the named venue, decimal.

Template gallery

click → load into editor

Extreme funding (any venue)

Funding above 10bp/8h on any venue (long-squeeze candidate)

funding['hl'] > 0.0001 OR funding['bin'] > 0.0001 OR funding['byb'] > 0.0001 OR funding['okx'] > 0.0001

Negative funding (squeeze candidates)

Funding below -10bp/8h on HL (short-squeeze candidate)

funding['hl'] < -0.0001

Squeeze setup

Negative funding + OI expanding + volume confirming

funding['hl'] < -0.00005 AND oi_24h_change > 0.10 AND vol_24h_usd > 5e6

Crowded long detector

Funding rich + premium positive + OI bursting

funding['hl'] > 0.0001 AND premium['hl'] > 0.001 AND oi_z > 2

Crowded short detector

Funding flipped negative + premium discount + OI rising

funding['hl'] < -0.00005 AND premium['hl'] < -0.001 AND oi_z > 1

Funding-OI divergence

Funding extreme but OI not following — possible exhaustion

(funding['hl'] > 0.0002 OR funding['hl'] < -0.0002) AND oi_24h_change < 0.05

Cross-venue funding arb

Funding spread > 5bp between HL and Binance

funding['hl'] - funding['bin'] > 0.00005 OR funding['bin'] - funding['hl'] > 0.00005

Liquid only

24h volume > $10M and OI > $5M USD

vol_24h_usd > 1e7 AND oi_usd > 5e6

RSI overbought + crowded long

RSI > 70 + extreme funding (reversal candidate)

rsi > 70 AND funding['hl'] > 0.0001

Whale-driven move

Whale notional > $10M + 24h change > 5%

whale_notional_24h > 1e7 AND change_24h > 0.05

Safety model

  • No eval, new Function, or setTimeout. Hand-rolled lexer/parser/interpreter only.
  • Identifiers resolved against a fixed allow-list; unknown names return NaN rather than throwing — script always compiles.
  • No loops, recursion, or function definitions — every script terminates in linear time per coin.
  • Sandboxed: no access to globalThis, DOM, or browser APIs.