本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
// ─────────────────────────────────────────────────────────────────────────────
// PURR mNAV — Hyperliquid Strategies Inc. (NASDAQ: PURR)
// Follows the company's published adjusted-NAV methodology:
//
// Value of Digital Assets = HYPE price × HYPE tokens held
// Deferred Tax Liability = max(0, (Value of Digital Assets − tax basis) × tax rate)
// Adjusted NAV = Value of Digital Assets + Cash − DTL + Other adjustments
// Fully Diluted Shares = Common + Preferred (as-converted) + dilutive securities
// (in-the-money warrants, treasury-stock method)
// NAV per FD share = Adjusted NAV / FD shares
// mNAV = share price / NAV per FD share
// mNAV (DTL added back) = share price / ((Adjusted NAV + DTL) / FD shares)
// Price: NASDAQ:PURR in regular NASDAQ hours, PURRDAT perp otherwise
//
// Default inputs (sources):
// HYPE 38.9M, cash $245.3M — company treasury update as of 2026-10-28 (8-K 2026-11-05)
// Common 277,008,716 — 10-Q cover, as of 2026-11-04
// Preferred as-converted 26,587,647 — company filings
// Tax rate 21%; tax basis $1,844.4M at 10/28 — implied by DTL at 21% each quarter end
// (3/31: 689.0−60.5/0.21=401.1; 6/30: 1,904.1−183.5/0.21=1,030.4; 9/30: 3,505.3−355.2/0.21=1,814.0)
// plus ~$30M of October additions. Tax basis is ~$350M below book cost (contributed tokens).
// History snapshots: 10-Q/10-K/8-K figures plus the company's weekly HYPE totals;
// weekly cash, shares and tax basis between filings are interpolated.
// Advisor warrants 3 × 9,131,600 @ $9.375 / $12.50 / $18.75 — 10-Q
// ─────────────────────────────────────────────────────────────────────────────
indicator("PURR mNAV — HSI methodology", shorttitle = "PURR mNAV", overlay = false, precision = 3)
// ═════════ 1 · Price sources ═════════
G_SRC = "1 · Price sources"
i_pxMode = input.string("Hybrid (HSI)", "PURR price", options = ["Hybrid (HSI)", "Chart symbol", "NASDAQ only", "Perp only"], display = display.none, group = G_SRC,
tooltip = "Hybrid (HSI) = same as the company dashboard: NASDAQ:PURR while NASDAQ has a bar, PURRDAT perp outside NASDAQ hours.\nWorks best on a perp chart at 1h or lower, or on a daily chart.")
i_nasdaqSym = input.symbol("NASDAQ:PURR", "NASDAQ symbol", display = display.none, group = G_SRC)
i_perpSym = input.symbol("HIP3XYZ:PURRDATUSDC.P", "PURRDAT perp symbol", display = display.none, group = G_SRC)
i_hypeSym = input.symbol("BYBIT:HYPEUSDT", "HYPE symbol", display = display.none, group = G_SRC,
tooltip = "Use a Hyperliquid HYPE/USDC feed if your TradingView has one; it is closest to the dashboard's token price.")
// ═════════ 2 · Latest treasury (update from filings / weekly dashboard) ═════════
G_TR = "2 · Latest treasury — update weekly"
i_asOf = input.time(timestamp("2026-10-28T00:00:00+00:00"), "Snapshot date", display = display.none, group = G_TR,
tooltip = "Bars on or after this date use the values below. Earlier bars use section 4 history (if any).")
i_hypeM = input.float(38.9, "HYPE tokens held (M)", step = 0.01, display = display.none, group = G_TR)
i_cashM = input.float(245.3, "Cash holdings ($M)", step = 0.1, display = display.none, group = G_TR)
i_otherM = input.float(0.0, "Other adjustments ($M)", step = 0.1, display = display.none, group = G_TR,
tooltip = "Dashboard line 'Other Adjustments'. Use the value from the company's latest adjusted-NAV update.")
i_commonM = input.float(277.009, "Common shares (M)", step = 0.001, display = display.none, group = G_TR)
// ═════════ 3 · Deferred tax liability ═════════
G_TX = "3 · Deferred tax liability"
i_basisM = input.float(1844.4, "HYPE tax basis ($M)", step = 1.0, display = display.none, group = G_TX,
tooltip = "Tax basis of all HYPE held (~$350M below book cost). Add the cost of each new purchase and the value of staking rewards when received. Check: tax basis = HYPE fair value − reported DTL / 21%.")
i_taxRate = input.float(21.0, "Tax rate (%)", step = 0.01, display = display.none, group = G_TX,
tooltip = "21% federal statutory rate; reproduces reported DTL at 3/31, 6/30 and 9/30/26.")
// ═════════ 4 · Fully diluted shares ═════════
G_DIL = "4 · Fully diluted shares"
i_prefM = input.float(26.587647, "Preferred, as-converted (M sh)", step = 0.000001, display = display.none, group = G_DIL,
tooltip = "Always included, as on the company dashboard.")
i_w1n = input.float(9.1316, "Warrant A (M sh)", step = 0.0001, inline = "w1", display = display.none, group = G_DIL)
i_w1k = input.float(9.375, "strike $", step = 0.001, inline = "w1", display = display.none, group = G_DIL)
i_w2n = input.float(9.1316, "Warrant B (M sh)", step = 0.0001, inline = "w2", display = display.none, group = G_DIL)
i_w2k = input.float(12.50, "strike $", step = 0.001, inline = "w2", display = display.none, group = G_DIL)
i_w3n = input.float(9.1316, "Warrant C (M sh)", step = 0.0001, inline = "w3", display = display.none, group = G_DIL)
i_w3k = input.float(18.75, "strike $", step = 0.001, inline = "w3", display = display.none, group = G_DIL)
i_inclRSU = input.bool(false, "Also include unvested RSUs", display = display.none, group = G_DIL,
tooltip = "The dashboard footnote mentions warrants only, so RSUs are off by default.")
i_rsuM = input.float(1.604, "Unvested RSUs (M)", step = 0.001, display = display.none, group = G_DIL)
// ═════════ 5 · History (optional) ═════════
G_HIS = "5 · History snapshots (optional)"
i_hist = input.text_area("2026-03-31,18.826,113.1,124.22,401.1;2026-04-29,20,136,134.622,448;2026-06-30,29.28,149.9,200.55,1030.4;2026-08-23,29.4,132.6,197.838,1038;2026-08-27,30.07,141.6,203.41,1095;2026-09-03,31.82,165,217.962,1243.9;2026-09-10,33.64,189.3,233.096,1398.8;2026-09-17,35.09,208.7,245.154,1522.1;2026-09-24,37.04,234.8,261.37,1688.1;2026-09-30,38.52,254.6,273.677,1814;2026-10-08,38.7,250.2,275.255,1828.4;2026-10-15,38.83,247,276.395,1838.8;2026-10-22,38.85,246.5,276.571,1840.4", "Snapshots", display = display.none, group = G_HIS,
tooltip = "Makes historical mNAV correct instead of applying today's holdings to old bars.\nOldest first, one row per update:\nYYYY-MM-DD,HYPE(M),cash($M),common shares(M),tax basis($M);\nLeave empty to apply the latest snapshot to every bar.")
// ═════════ 6 · Display ═════════
G_DSP = "6 · Display"
i_onlyPurr = input.bool(true, "Only show on PURR charts", display = display.none, group = G_DSP,
tooltip = "Hides the lines and table when the chart symbol does not contain PURR (e.g. when you switch to BTC).")
i_showX = input.bool(true, "Also plot mNAV with DTL added back", display = display.none, group = G_DSP)
i_m1 = input.float(1.0, "Multiple 1", step = 0.1, inline = "m", display = display.none, group = G_DSP)
i_m2 = input.float(1.5, "2", step = 0.1, inline = "m", display = display.none, group = G_DSP)
i_m3 = input.float(2.0, "3", step = 0.1, inline = "m", display = display.none, group = G_DSP)
i_showTbl = input.bool(true, "Show table", display = display.none, group = G_DSP)
i_tblPos = input.string("Top right", "Table position", options = ["Top right", "Top left", "Bottom right", "Bottom left"], display = display.none, group = G_DSP)
i_bands = input.bool(false, "Draw implied-price lines on main chart", display = display.none, group = G_DSP,
tooltip = "Only meaningful when the main chart is PURR.")
// ═════════ Prices ═════════
float nasdaqPx = request.security(i_nasdaqSym, timeframe.period, close, gaps = barmerge.gaps_on, ignore_invalid_symbol = true)
float nasdaqFill = fixnan(nasdaqPx)
float perpPx = request.security(i_perpSym, timeframe.period, close, ignore_invalid_symbol = true)
float hypePx = request.security(i_hypeSym, timeframe.period, close, ignore_invalid_symbol = true)
float purrPx = na
string pxSrc = ""
switch i_pxMode
"Chart symbol" =>
purrPx := close
pxSrc := "chart"
"NASDAQ only" =>
purrPx := nasdaqFill
pxSrc := "NASDAQ"
"Perp only" =>
purrPx := perpPx
pxSrc := "perp"
=>
bool useNas = not na(nasdaqPx) or na(perpPx)
purrPx := useNas ? nasdaqFill : perpPx
pxSrc := useNas ? "NASDAQ" : "perp"
// ═════════ Parse history snapshots (once) ═════════
var hTs = array.new<int>()
var hHype = array.new<float>()
var hCash = array.new<float>()
var hSh = array.new<float>()
var hBasis = array.new<float>()
if barstate.isfirst and str.length(i_hist) > 0
rows = str.split(str.replace_all(str.replace_all(i_hist, " ", ""), "\n", ""), ";")
for r in rows
f = str.split(r, ",")
if array.size(f) >= 5
d = str.split(array.get(f, 0), "-")
if array.size(d) == 3
float y = str.tonumber(array.get(d, 0))
float mo = str.tonumber(array.get(d, 1))
float dd = str.tonumber(array.get(d, 2))
float hq = str.tonumber(array.get(f, 1))
float cq = str.tonumber(array.get(f, 2))
float sq = str.tonumber(array.get(f, 3))
float bq = str.tonumber(array.get(f, 4))
if not na(y) and not na(mo) and not na(dd) and not na(hq) and not na(cq) and not na(sq) and not na(bq)
array.push(hTs, timestamp("UTC", int(y), int(mo), int(dd), 0, 0, 0))
array.push(hHype, hq)
array.push(hCash, cq)
array.push(hSh, sq)
array.push(hBasis, bq)
var int hIdx = -1
while hIdx + 1 < array.size(hTs) and array.get(hTs, hIdx + 1) <= time
hIdx += 1
// ═════════ Treasury values for this bar ═════════
float hypeQ = na
float cashUsd = na
float commonSh = na
float basisUsd = na
bool fromHist = false
if array.size(hTs) == 0 or time >= i_asOf
hypeQ := i_hypeM * 1e6
cashUsd := i_cashM * 1e6
commonSh := i_commonM * 1e6
basisUsd := i_basisM * 1e6
else if hIdx >= 0
hypeQ := array.get(hHype, hIdx) * 1e6
cashUsd := array.get(hCash, hIdx) * 1e6
commonSh := array.get(hSh, hIdx) * 1e6
basisUsd := array.get(hBasis, hIdx) * 1e6
fromHist := true
// ═════════ Adjusted NAV ═════════
float hypeVal = hypeQ * hypePx
float dtl = math.max((hypeVal - basisUsd) * i_taxRate / 100.0, 0.0)
float otherUsd = i_otherM * 1e6
float adjNav = hypeVal + cashUsd - dtl + otherUsd
// ═════════ Fully diluted shares (treasury-stock method) ═════════
f_tsm(float px, float nM, float k) =>
px > k and nM > 0 and k > 0 ? nM * 1e6 * (1.0 - k / px) : 0.0
float dilutive = na(purrPx) ? na : f_tsm(purrPx, i_w1n, i_w1k) + f_tsm(purrPx, i_w2n, i_w2k) + f_tsm(purrPx, i_w3n, i_w3k) + (i_inclRSU ? i_rsuM * 1e6 : 0.0)
float prefSh = i_prefM * 1e6
float fdShares = commonSh + prefSh + dilutive
// ═════════ Ratios ═════════
float navPS = adjNav > 0 and fdShares > 0 ? adjNav / fdShares : na
float navPSx = fdShares > 0 ? (adjNav + dtl) / fdShares : na
float mnav = navPS > 0 ? purrPx / navPS : na
float mnavX = navPSx > 0 ? purrPx / navPSx : na
float premium = (mnav - 1.0) * 100.0
float fdMcap = purrPx * fdShares
float hypePS = fdShares > 0 ? hypeQ / fdShares : na
// ═════════ Plots ═════════
bool active = not i_onlyPurr or str.contains(str.upper(syminfo.tickerid), "PURR")
float mnavP = active ? mnav : na
float mnavXP = active ? mnavX : na
float navPSP = active ? navPS : na
color cUp = #26a69a
color cDn = #ef5350
plot(mnavP, "mNAV", color = mnav >= 1 ? cUp : cDn, linewidth = 2)
plot(i_showX ? mnavXP : na, "mNAV (DTL added back)", color = color.new(color.gray, 30), linewidth = 1, style = plot.style_line)
hline(i_m1, "Multiple 1", color = color.new(color.gray, 20), linestyle = hline.style_solid)
hline(i_m2, "Multiple 2", color = color.new(color.gray, 50), linestyle = hline.style_dotted)
hline(i_m3, "Multiple 3", color = color.new(color.gray, 50), linestyle = hline.style_dotted)
plot(i_bands ? navPSP * i_m1 : na, "Implied price @ m1", color = color.new(color.orange, 0), linewidth = 2, force_overlay = true)
plot(i_bands ? navPSP * i_m2 : na, "Implied price @ m2", color = color.new(color.orange, 40), force_overlay = true)
plot(i_bands ? navPSP * i_m3 : na, "Implied price @ m3", color = color.new(color.orange, 65), force_overlay = true)
plot(navPS, "NAV / FD share", display = display.data_window)
plot(dtl / 1e6, "DTL ($M)", display = display.data_window)
plot(purrPx, "PURR price used", display = display.data_window)
plot(hypePx, "HYPE price", display = display.data_window)
// ═════════ Alerts ═════════
alertcondition(ta.crossunder(mnav, 1.0), "mNAV below 1.0x", "PURR mNAV crossed below 1.0x (trading under adjusted NAV)")
alertcondition(ta.crossover(mnav, 1.0), "mNAV above 1.0x", "PURR mNAV crossed back above 1.0x")
// ═════════ Table ═════════
f_pos(string s) =>
switch s
"Top left" => position.top_left
"Bottom right" => position.bottom_right
"Bottom left" => position.bottom_left
=> position.top_right
f_usd(float x) => na(x) ? "–" : "$" + str.tostring(x, "#,##0.00")
f_mm(float x) => na(x) ? "–" : (x < 0 ? "(" + str.tostring(-x / 1e6, "#,##0.0") + ")" : str.tostring(x / 1e6, "#,##0.0"))
f_row(table t, int r, string k, string v, color vc) =>
table.cell(t, 0, r, k, text_color = color.silver, text_halign = text.align_left, text_size = size.small)
table.cell(t, 1, r, v, text_color = vc, text_halign = text.align_right, text_size = size.small)
var table tbl = table.new(f_pos(i_tblPos), 2, 18, bgcolor = color.new(#131722, 10), frame_color = color.new(color.gray, 60), frame_width = 1, border_width = 0)
if barstate.islast and not active
table.clear(tbl, 0, 0, 1, 17)
if barstate.islast and i_showTbl and active
color mc = mnav >= 1 ? cUp : cDn
f_row(tbl, 0, "PURR mNAV", "HSI method", color.white)
f_row(tbl, 1, "mNAV", na(mnav) ? "–" : str.tostring(mnav, "0.000") + "×", mc)
f_row(tbl, 2, "mNAV (DTL added back)", na(mnavX) ? "–" : str.tostring(mnavX, "0.000") + "×", color.gray)
f_row(tbl, 3, "Premium / discount", na(premium) ? "–" : (premium >= 0 ? "+" : "") + str.tostring(premium, "0.0") + "%", mc)
f_row(tbl, 4, "PURR price (" + pxSrc + ")", na(purrPx) ? "n/a — check symbol" : f_usd(purrPx), na(purrPx) ? cDn : color.white)
f_row(tbl, 5, "HYPE price", na(hypePx) ? "n/a — check symbol" : f_usd(hypePx), na(hypePx) ? cDn : color.white)
f_row(tbl, 6, "Digital assets ($M)", f_mm(hypeVal), color.white)
f_row(tbl, 7, "Cash holdings ($M)", f_mm(cashUsd), color.white)
f_row(tbl, 8, "Deferred tax liability ($M)", f_mm(-dtl), color.white)
f_row(tbl, 9, "Other adjustments ($M)", f_mm(otherUsd), color.white)
f_row(tbl, 10, "Adjusted NAV ($M)", f_mm(adjNav), color.white)
f_row(tbl, 11, "FD shares (M)", na(fdShares) ? "–" : str.tostring(fdShares / 1e6, "#,##0.0"), color.white)
f_row(tbl, 12, "NAV / FD share", f_usd(navPS), color.white)
f_row(tbl, 13, " … DTL added back", f_usd(navPSx), color.gray)
f_row(tbl, 14, str.tostring(i_m1, "0.0#") + "× implied", f_usd(navPS * i_m1), color.orange)
f_row(tbl, 15, str.tostring(i_m2, "0.0#") + "× implied", f_usd(navPS * i_m2), color.orange)
f_row(tbl, 16, str.tostring(i_m3, "0.0#") + "× implied", f_usd(navPS * i_m3), color.orange)
f_row(tbl, 17, "Treasury as of", fromHist ? "history snapshot" : str.format_time(i_asOf, "yyyy-MM-dd", "UTC"), color.gray)