/* global React */ const { useState, useMemo } = React; // ===== Token data ===== const AXES = { PO: { name: "Physiological Optimization", color: "var(--axis-po)" }, NM: { name: "Neurocognitive Mastery", color: "var(--axis-nm)" }, ER: { name: "Emotional Resilience", color: "var(--axis-er)" }, SC: { name: "Spiritual Coherence", color: "var(--axis-sc)" }, RS: { name: "Relational & Social", color: "var(--axis-rs)" }, ES: { name: "Environmental Symbiosis", color: "var(--axis-es)" }, TA: { name: "Technological Augmentation", color: "var(--axis-ta)" }, PV: { name: "Purposeful Vitality", color: "var(--axis-pv)" }, }; const TOKENS = []; const fmtUsd = (n) => "$" + n.toLocaleString(undefined, { minimumFractionDigits: 4, maximumFractionDigits: 4 }); const fmtVol = (n) => "$" + (n >= 1e6 ? (n/1e6).toFixed(2) + "M" : (n/1e3).toFixed(1) + "K"); const fmtNum = (n, d=4) => n.toLocaleString(undefined, { minimumFractionDigits: d, maximumFractionDigits: d }); // ========================================================= // Sparkline (no animation, deterministic per symbol) // ========================================================= function Sparkline({ symbol, up, w=80, h=22 }) { // deterministic pseudo-random walk const points = useMemo(() => { let seed = 0; for (let i = 0; i < symbol.length; i++) seed = (seed * 31 + symbol.charCodeAt(i)) >>> 0; const rng = () => { seed = (seed * 1664525 + 1013904223) >>> 0; return (seed / 4294967295); }; const N = 24; let v = 0.5; const pts = []; for (let i = 0; i < N; i++) { v += (rng() - 0.5) * 0.18; v = Math.max(0.05, Math.min(0.95, v)); pts.push(v); } if (up) pts.sort((a,b) => a - b); else pts.sort((a,b) => b - a); // re-shuffle slightly so it's not monotonic return pts.map((p, i) => p * 0.7 + 0.15 + (rng()-0.5)*0.05); }, [symbol, up]); const path = points.map((p, i) => { const x = (i / (points.length - 1)) * w; const y = h - p * h; return (i === 0 ? "M" : "L") + x.toFixed(1) + "," + y.toFixed(1); }).join(" "); const stroke = up ? "var(--hcx-bid)" : "var(--hcx-ask)"; return ( ); } // ========================================================= // Token glyph (sym + axis color) // ========================================================= function TokenGlyph({ axis, sym, size }) { const color = AXES[axis]?.color || "var(--accent-guardian)"; const style = { background: `radial-gradient(circle at 30% 30%, ${color}, color-mix(in oklab, ${color} 40%, #000))`, width: size || undefined, height: size || undefined, }; // 2-3 char glyph const label = sym.slice(0, sym.length === 3 ? 3 : 2); return
{label}
; } function AxisPill({ axis }) { const color = AXES[axis]?.color || "var(--fg-2)"; return ( {axis} ); } // ========================================================= // Top chrome // ========================================================= function StatusStrip() { const HCRTicker = window.KitChrome && window.KitChrome.HCRTicker; return (
"Integrity in all we do™" — Conceptual Healthcare Corporation
{HCRTicker && } · Health Commodity Exchange™ · The Markets, for Health · HIPAA · BAA-ready · IRS 1099-B Ready · 21B HCR Hard Cap
); } function Nav({ tab, setTab }) { const tabs = []; return ( ); } function Tape() { const items = TOKENS.slice(0, 8); return (
LIVE {items.map(t => ( {t.sym}/HCC {fmtNum(t.price)} = 0 ? "up" : "down")}> {t.ch >= 0 ? "+" : ""}{t.ch.toFixed(2)}% ))}
); } // ========================================================= // MARKETS VIEW // ========================================================= function HeroBanner() { return (
Era 0 · Genesis Pricing

Get Healthy.
Get Wealthy.

A health-native commodity exchange. HCR mints when your body earns; HCC mints when your data earns. Both 21B hard cap, both float, both governed by the Master Equation. Trade the part of you that matters most — and quote everything in HCC.

I'm a trader → List Your Chain
{[ { p: "exchange.volume24h" }, { p: "exchange.activePairs" }, { p: "exchange.hcrPrice" }, { p: "exchange.hccPrice" }, ].map(({ p }) => { const m = window.CHBrand.metric(p); const valColor = m.accent === "guardian" ? "var(--accent-guardian)" : m.accent === "halo" ? "var(--accent-halo)" : undefined; const subClass = "sub" + (m.tone === "up" ? " up" : m.tone === "down" ? " down" : ""); return (
{m.label}
{m.value}
{m.sub}
); })}
Reconciled {window.CHBrand.metrics.asOfLabel} · How we measure →
); } function MarketsTable() { const [filter, setFilter] = useState("All"); const [starred, setStarred] = useState(new Set(["HCR", "HCC"])); const filters = []; const rows = useMemo(() => { return TOKENS.filter(t => { if (filter === " Gainers") return t.ch > 0; if (filter === "Losers") return t.ch < 0; if (filter === "New") return t.isNew; if (filter === "★ Starred") return starred.has(t.sym); return true; }); }, [filter, starred]); const toggleStar = (sym) => { const next = new Set(starred); next.has(sym) ? next.delete(sym) : next.add(sym); setStarred(next); }; return (
{filters.map(f => ( ))}
{rows.length} tokens
{rows.map(t => ( ))}
# Token Axis Price (HCC) 24h Change Volume 24h Range Trend
toggleStar(t.sym)}> {starred.has(t.sym) ? "★" : "☆"} {t.rank} window.__hcxOpenDetail && window.__hcxOpenDetail(t.sym)} style={{ cursor: "pointer" }}>
{t.sym} {t.isNew && NEW} {t.sym === "HCC" && QUOTE} {t.kind === "community" && COMMUNITY CHAIN} {t.kind === "applicant" && APPLIED} {t.name}
⚕{fmtNum(t.price)} = 0 ? "up" : "down")}> {Math.abs(t.ch).toFixed(2)}% {fmtVol(t.vol)} {fmtNum(t.lo)} – {fmtNum(t.hi)} = 0} />
); } // ========================================================= // EARNINGS CALCULATOR // ========================================================= function EarningsCard() { const [activity, setActivity] = useState("10K Steps"); const [days, setDays] = useState(30); const activities = []; const a = activities.find(x => x.id === activity); const earned = a ? a.rate * days : 0; const usd = earned * 0.1042; return (
Health Earnings Calculator

What's your health worth?

Pick an activity, set a duration, see what your habits would mint at current Era 0 pricing.

{activities.map(x => (
setActivity(x.id)}> {x.ic} {x.id}
))}
{[7, 30, 90, 180, 365].map(d => ( ))}
HCR Earned
{fmtNum(earned, 4)}HCR
≈ HCC Value
{fmtNum(earned, 4)}
≈ USD Equivalent
${usd.toFixed(2)} at $0.1042 / HCR
Trade HCR / HCC →
); } // ========================================================= // 8 AXES GRID // ========================================================= function AxesGrid() { const axes = []; return (
{axes.map(a => { const color = AXES[a.code].color; return (
{a.code}
{a.name}
{a.count} {a.count === 1 ? "token" : "tokens"}
); })}
); } // ========================================================= // LIST-YOUR-CHAIN CTA // ========================================================= function ListCta() { return (
Now Listing · Community Chains

List your community health chain on HC.exchange

The doc names three live community chains today — MHC (Mental Health, NM axis), DMC (Diabetes Management, PO), FTC (Fitness, PO). Each is a 1B-cap chain trading USD-only. Listing fee is fixed in commodity terms: 500 HCC. Acquisition price for the originating clinic: 10,000 HCC. Listing application requires CH Score ≥ 70 on the applicant’s primary axis.

✓ HIPAA-Compliant ✓ IRS 1099-B Reporting ✓ Real-Time Matching ✓ 10 Business Day Review ✓ CH Score gated
Apply to List →
); } // ========================================================= // TRADE VIEW // ========================================================= function TradeView() { const [side, setSide] = useState("buy"); const [orderType, setOrderType] = useState("Limit"); // Order book const asks = []; const bids = []; return (
{/* Pair header */}
HCR / HCC
Health Coin Reward · Physical Output axis
⚕0.1042 ▲ 4.21%
24h High⚕0.1058
24h Low⚕0.0992
24h Volume12.84M HCR
Funding+0.012%
ContractCH Chain · IRC §1221
{/* Pairs list */}
Pairs vs HCC
{TOKENS.filter(t => t.sym !== "HCC").map(t => (
{t.sym}/HCC {fmtVol(t.vol)}
⚕{fmtNum(t.price)} = 0 ? "hcx-change up" : "hcx-change down")}> {Math.abs(t.ch).toFixed(2)}%
))}
{/* Chart */}
HCR/HCC {["1m", "5m", "15m", "1h", "4h", "1D"].map((tf, i) => ( {tf} ))} Indicators Drawing Settings
{/* Order book */}
Order Book 0.0001 grouping
Price (HCC) Size (HCR) Total
{asks.map((r, i) => (
{fmtNum(r.p)} {r.sz.toLocaleString()} {(r.p * r.sz).toFixed(2)}
))}
⚕0.1042 spread 0.0003 (0.29%)
{bids.map((r, i) => (
{fmtNum(r.p)} {r.sz.toLocaleString()} {(r.p * r.sz).toFixed(2)}
))}
{/* Order entry */}
Place Order {[{ k: "Limit", adv: false }, { k: "Market", adv: false }, { k: "Stop-Loss", adv: true }, { k: "OCO", adv: true }].map(({ k, adv }) => ( setOrderType(k)} title={adv ? "Advanced order \u00b7 unlocks at CH Score \u2265 60" : ""} style={{ cursor: "pointer", color: orderType === k ? "var(--accent-guardian)" : (adv ? "var(--fg-3)" : "var(--fg-2)"), fontSize: 10, letterSpacing: "0.04em", display: "inline-flex", alignItems: "center", gap: 4, }}>{k}{adv && 🔒CH≥60} ))}
{(orderType === "Stop-Loss" || orderType === "OCO") && (
CH SCORE GATE · advanced order types unlock at CH Score ≥ 60. Your current score: 72. Unlocked.
)}
Available 1,240.00 HCC
HCC
HCR
{["25%", "50%", "75%", "MAX"].map(p => )}
HCC
Fee (Era 0 · 0.10%)0.2605 HCC
1099-B reportableYes
Health axisPO · Physical Output
{/* Recent trades */}
Recent Trades Live
Price Size Time
{[ { p: 0.1042, sz: 124, t: "14:32:08", up: true }, { p: 0.1041, sz: 480, t: "14:32:01", up: false }, { p: 0.1042, sz: 88, t: "14:31:56", up: true }, { p: 0.1042, sz: 1240, t: "14:31:49", up: true }, { p: 0.1041, sz: 60, t: "14:31:42", up: false }, { p: 0.1043, sz: 320, t: "14:31:30", up: true }, { p: 0.1042, sz: 808, t: "14:31:18", up: true }, { p: 0.1041, sz: 144, t: "14:31:04", up: false }, { p: 0.1040, sz: 96, t: "14:30:52", up: false }, { p: 0.1042, sz: 240, t: "14:30:41", up: true }, { p: 0.1043, sz: 720, t: "14:30:30", up: true }, { p: 0.1042, sz: 312, t: "14:30:19", up: true }, ].map((tr, i) => (
{fmtNum(tr.p)} {tr.sz.toLocaleString()} {tr.t}
))}
); } // Candle chart SVG (deterministic) function ChartSVG() { const W = 1000, H = 460; const N = 64; const candles = useMemo(() => { let seed = 1234; const rng = () => { seed = (seed * 1664525 + 1013904223) >>> 0; return seed / 4294967295; }; let v = 0.40; const out = []; for (let i = 0; i < N; i++) { const o = v; v += (rng() - 0.45) * 0.04; v = Math.max(0.1, Math.min(0.9, v)); const c = v; const hi = Math.max(o, c) + rng() * 0.025; const lo = Math.min(o, c) - rng() * 0.025; out.push({ o, c, hi, lo }); } return out; }, []); const padTop = 30, padBottom = 30; const yMin = 0.05, yMax = 0.95; const yScale = (v) => padTop + (1 - (v - yMin) / (yMax - yMin)) * (H - padTop - padBottom); const cw = W / N; const bodyW = cw * 0.6; // Build line for current price const lastClose = candles[candles.length - 1].c; const liveY = yScale(lastClose); return ( {/* y-axis price labels */} {[0.85, 0.65, 0.45, 0.25].map((v, i) => ( ⚕{(v * 0.12 + 0.04).toFixed(4)} ))} {/* candles */} {candles.map((k, i) => { const x = i * cw + cw / 2; const up = k.c >= k.o; const color = up ? "var(--hcx-bid)" : "var(--hcx-ask)"; const yOpen = yScale(k.o), yClose = yScale(k.c); const top = Math.min(yOpen, yClose), bot = Math.max(yOpen, yClose); return ( ); })} {/* live price line */} ⚕{(lastClose * 0.12 + 0.04).toFixed(4)} ); } // ========================================================= // PORTFOLIO VIEW // ========================================================= function PortfolioView() { const holdings = []; const total = 3179.61; return (
Portfolio

Health Net Worth

Total Portfolio Value
${total.toLocaleString(undefined, { minimumFractionDigits: 2 })}
▲ $124.40 (4.07%) today · ▲ $812.20 (34.3%) all-time
Earned (Health Activity)
$1,940.18
61% of holdings · 18,422 verified actions
2026 Realized · 1099-B
$412.80
Download 1099-B →
{/* Holdings table */}

Holdings

{holdings.map(h => ( ))}
Token Axis Quantity Value Allocation
{h.sym} {TOKENS.find(t => t.sym === h.sym)?.name}
{h.qty.toLocaleString(undefined, { minimumFractionDigits: 2 })} ${h.value.toFixed(2)}
{h.alloc.toFixed(1)}%
{/* Allocation by axis */}

Allocation by Axis

{[ { code: "PO", pct: 43.2 }, { code: "PV", pct: 40.2 }, { code: "NM", pct: 6.9 }, { code: "RS", pct: 5.7 }, { code: "TA", pct: 4.0 }, ].map(a => (
{a.code} {AXES[a.code].name} {a.pct.toFixed(1)}%
))}
); } function AxisDonut() { const data = []; const r = 70, cx = 110, cy = 110; const C = 2 * Math.PI * r; let acc = 0; return ( {data.map((d) => { const len = (d.pct / 100) * C; const dash = `${len} ${C}`; const offset = -acc; acc += len; return ( ); })} $3,179 7 TOKENS ); } // ========================================================= // FOOTER // ========================================================= function Footer({ setTab }) { const nav = (tab) => (e) => { e.preventDefault(); window.scrollTo(0, 0); setTab && setTab(tab); }; return ( ); } // ========================================================= // APP // ========================================================= function App() { const [tab, setTab] = useState("Markets"); const [detailToken, setDetailToken] = useState(null); const [, setTick] = useState(0); // triggers re-render when live prices arrive // Live price updates from exchange API — 30s polling React.useEffect(() => { const update = async () => { try { const res = await fetch('/api/v1/market/tickers'); if (!res.ok) return; const data = await res.json(); const map = {}; if (Array.isArray(data)) { data.forEach(item => { const sym = String(item.symbol || item.sym || item.ticker || '').split('/')[0].toUpperCase(); if (sym) map[sym] = item; }); } else if (data && typeof data === 'object') { Object.entries(data).forEach(([sym, item]) => { map[sym.split('/')[0].toUpperCase()] = item; }); } let changed = false; TOKENS.forEach((t, i) => { const live = map[t.sym]; if (!live) return; const p = parseFloat(live.last_price ?? live.price ?? live.close ?? live.last ?? NaN); const ch = parseFloat(live.price_change_pct ?? live.change_pct_24h ?? live.change_24h ?? live.change ?? NaN); const vol = parseFloat(live.volume_24h ?? live.volume ?? NaN); const hi = parseFloat(live.high_24h ?? live.high ?? NaN); const lo = parseFloat(live.low_24h ?? live.low ?? NaN); if (!isNaN(p) && p > 0) { TOKENS[i].price = p; changed = true; } if (!isNaN(ch)) { TOKENS[i].ch = ch; changed = true; } if (!isNaN(vol) && vol > 0) { TOKENS[i].vol = vol; changed = true; } if (!isNaN(hi) && hi > 0) { TOKENS[i].hi = hi; changed = true; } if (!isNaN(lo) && lo > 0) { TOKENS[i].lo = lo; changed = true; } }); if (changed) setTick(n => n + 1); } catch { /* silent — static fallback data remains */ } }; update(); const id = setInterval(update, 30_000); return () => clearInterval(id); }, []); // Make markets-row Trade button & token cells navigate to detail React.useEffect(() => { window.__hcxOpenDetail = (sym) => { const tk = TOKENS.find(x => x.sym === sym); if (tk) setDetailToken(tk); }; }, []); return (
); } // Boot const root = ReactDOM.createRoot(document.getElementById("root")); root.render(); // Expose for debugging Object.assign(window, { App, TOKENS, AXES });