modscode JA

modscode / Gallery / meme-watch

meme-watch

Live USD PnL for the top 5 memecoin positions in a Solana wallet, plus a live chart terminal for any token. Helius only.

Code you can checkTerminal + desktopPaneBandToastBoxButtonInputText

What it does

  • Draws a band above the prompt, a pane, toasts
  • Adds /memes, /token
  • Hooks session.start, ui.close
  • Keeps its own state between turns
  • Calls the network

Good points

  • Written in TypeScript
  • Has a desktop-specific branch
  • Handles errors
  • Writes no files

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like meme-watch by Nathan Liow (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/nathanliow-meme-watch/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text } = $.ui.resolve(e)
    const sym = '…'
    const formatUsd = '…'
    const formatUsd2 = '…'
    const formatPct = '…'
    const sym2 = '…'
    const formatUsd3 = '…'
    const formatUsd4 = '…'
    const formatPct2 = '…'
    const sym3 = '…'
    const formatUsd5 = '…'
    const formatUsd6 = '…'
    const formatPct3 = '…'
    return (
      <Box flexDirection="column">
        <Box>
          <Text>
            🐸
            {" "}
            <Text>
              {" · "}
              <Text bold>
                {sym}
              </Text>
              {" "}
              {formatUsd}
              {" "}
              <Text color="green">
                {formatUsd2}
                {" ("}
                {formatPct}
                )
              </Text>
            </Text>
            <Text>
              {" · "}
              <Text bold>
                {sym2}
              </Text>
              {" "}
              {formatUsd3}
              {" "}
              <Text color="green">
                {formatUsd4}
                {" ("}
                {formatPct2}
                )
              </Text>
            </Text>
            <Text>
              {" · "}
              <Text bold>
                {sym3}
              </Text>
              {" "}
              {formatUsd5}
              {" "}
              <Text color="green">
                {formatUsd6}
                {" ("}
                {formatPct3}
                )
              </Text>
            </Text>
          </Text>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Chart" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Input } = $.ui.resolve(e)
    const sym = '…'
    const name = '…'
    const mint = '…'
    const fmtPrice = '…'
    const fmtPct = '…'
    const slot = '…'
    const lagMs = '…'
    const fmtUsd = '…'
    const fmtNum = '…'
    const histText = '…'
    const label = '…'
    const i = '…'
    const k = '…'
    const k2 = '…'
    const fmtPct2 = '…'
    const k3 = '…'
    const fmtPct3 = '…'
    const top10Pct = '…'
    const hhmmss = '…'
    const fmtPrice2 = '…'
    const fmtUsd2 = '…'
    const fmtNum2 = '…'
    const maker = '…'
    const hhmmss2 = '…'
    const fmtPrice3 = '…'
    const fmtUsd3 = '…'
    const fmtNum3 = '…'
    const maker2 = '…'
    const hhmmss3 = '…'
    const fmtPrice4 = '…'
    const fmtUsd4 = '…'
    const fmtNum4 = '…'
    const maker3 = '…'
    const err = '…'
    const formatPrice = '…'
    const formatUsd = '…'
    const formatUsd2 = '…'
    const formatPct = '…'
    const formatPrice2 = '…'
    const formatUsd3 = '…'
    const formatUsd4 = '…'
    const formatPct2 = '…'
    const formatPrice3 = '…'
    const formatUsd5 = '…'
    const formatUsd6 = '…'
    const formatPct3 = '…'
    const err2 = '…'
    const owner = '…'
    const formatPrice4 = '…'
    return (
      <Box flexDirection="column">
        <Box marginBottom={1}>
          <Box flexDirection="column">
            <Box flexDirection="row" justifyContent="space-between">
              <Box flexDirection="row" gap={1}>
                <Box flexDirection="column">
                  <Text wrap="truncate">
                    <Text color="#eaecef" bold>
                      {sym}
                    </Text>
                    <Text color="#5e6673">
                      {`  ${name} · ${mint}`}
                    </Text>
                  </Text>
                  <Text>
                    <Text bold>
                      {fmtPrice}
                    </Text>
                    <Text bold>
                      {`  ${fmtPct}`}
                    </Text>
                    <Text color="#5e6673">
                      {" 24h"}
                    </Text>
                  </Text>
                </Box>
              </Box>
              <Box flexDirection="column" alignItems="flex-end">
                <Text color="#0ecb81" bold>
                  ● LIVE · LaserStream
                </Text>
                <Text color="#5e6673" wrap="truncate">
                  {`slot ${slot} · Δ${lagMs}ms · SOL ${fmtPrice}`}
                </Text>
              </Box>
            </Box>
            <Text wrap="truncate">
              <Text>
                <Text color="#5e6673">
                  MCAP
                  {" "}
                </Text>
                <Text bold>
                  {fmtUsd}
                </Text>
                <Text>
                  {"   "}
                </Text>
              </Text>
              <Text>
                <Text color="#5e6673">
                  SUPPLY
                  {" "}
                </Text>
                <Text bold>
                  {fmtNum}
                </Text>
                <Text>
                  {"   "}
                </Text>
              </Text>
              <Text>
                <Text color="#5e6673">
                  HISTORY
                  {" "}
                </Text>
                <Text color="#848e9c" bold>
                  {histText}
                </Text>
                <Text>
                  {"   "}
                </Text>
              </Text>
            </Text>
            <Box flexDirection="row" justifyContent="space-between" marginTop={1}>
              <Box flexDirection="row" gap={1}>
                <Button label={`${label}`} hotkey={`${i}`} variant="primary" />
                <Button label={`${label}`} hotkey={`${i}`} variant="primary" />
                <Button label={`${label}`} hotkey={`${i}`} variant="primary" />
              </Box>
              <Text wrap="truncate">
                <Text>
                  <Text color="#5e6673">
                    {k}
                    {" "}
                  </Text>
                  <Text>
                    {fmtPct}
                  </Text>
                  <Text>
                    {"  "}
                  </Text>
                </Text>
                <Text>
                  <Text color="#5e6673">
                    {k2}
                    {" "}
                  </Text>
                  <Text>
                    {fmtPct2}
                  </Text>
                  <Text>
                    {"  "}
                  </Text>
                </Text>
                <Text>
                  <Text color="#5e6673">
                    {k3}
                    {" "}
                  </Text>
                  <Text>
                    {fmtPct3}
                  </Text>
                  <Text>
                    {"  "}
                  </Text>
                </Text>
              </Text>
            </Box>
            <Box flexDirection="row" gap={1}>
              <Box flexDirection="column" borderStyle="round" borderColor="#2b3139" paddingX={1}>
                <Box flexDirection="column" marginBottom={1}>
                  <Text>
                    <Text color="#848e9c" bold>
                      LAST 60s
                    </Text>
                    <Text color="#5e6673">
                      {" vol "}
                    </Text>
                    <Text color="#eaecef">
                      0
                    </Text>
                  </Text>
                  <Text>
                    <Text color="#0ecb81">
                      0
                      {" buys"}
                    </Text>
                    <Text color="#5e6673">
                      {" / "}
                    </Text>
                    <Text color="#f6465d">
                      0
                      {" sells"}
                    </Text>
                    <Text color="#5e6673">
                      {" · "}
                      0
                      {" wallets"}
                    </Text>
                  </Text>
                  <Text>
                    <Text color="#0ecb81">
                      ████████
                    </Text>
                    <Text color="#f6465d">
                      ████████
                    </Text>
                  </Text>
                </Box>
                <Box flexDirection="column" marginBottom={1}>
                  <Text>
                    <Text color="#848e9c" bold>
                      1H
                    </Text>
                    <Text color="#5e6673">
                      {" vol "}
                    </Text>
                    <Text color="#eaecef">
                      0
                    </Text>
                  </Text>
                  <Text>
                    <Text color="#0ecb81">
                      0
                      {" buys"}
                    </Text>
                    <Text color="#5e6673">
                      {" / "}
                    </Text>
                    <Text color="#f6465d">
                      0
                      {" sells"}
                    </Text>
                    <Text color="#5e6673">
                      {" · "}
                      0
                      {" wallets"}
                    </Text>
                  </Text>
                  <Text>
                    <Text color="#0ecb81">
                      ████████
                    </Text>
                    <Text color="#f6465d">
                      ████████
                    </Text>
                  </Text>
                </Box>
                <Box flexDirection="column" marginBottom={1}>
                  <Text>
                    <Text color="#848e9c" bold>
                      24H
                    </Text>
                    <Text color="#5e6673">
                      {" vol "}
                    </Text>
                    <Text color="#eaecef">
                      0
                    </Text>
                  </Text>
                  <Text>
                    <Text color="#0ecb81">
                      0
                      {" buys"}
                    </Text>
                    <Text color="#5e6673">
                      {" / "}
                    </Text>
                    <Text color="#f6465d">
                      0
                      {" sells"}
                    </Text>
                    <Text color="#5e6673">
                      {" · "}
                      0
                      {" wallets"}
                    </Text>
                  </Text>
                  <Text>
                    <Text color="#0ecb81">
                      ████████
                    </Text>
                    <Text color="#f6465d">
                      ████████
                    </Text>
                  </Text>
                </Box>
                <Text color="#848e9c" bold>
                  TOP 10 ACCOUNTS
                </Text>
                <Text>
                  <Text color="#5e6673">
                    {"hold "}
                  </Text>
                  <Text color="#f0b90b">
                    {top10Pct}
                    %
                  </Text>
                  <Text color="#5e6673">
                    {" (incl. pools)"}
                  </Text>
                </Text>
                <Text color="#f0b90b">
                  ████████░░░░░░░░
                </Text>
              </Box>
            </Box>
            <Text color="#5e6673" wrap="truncate">
              {"TIME      "}
              {"SIDE    "}
              {"PRICE         "}
              {"     SIZE"}
              {"   "}
              {" FLOW         "}
              {"    AMOUNT"}
              {"  "}
              MAKER
            </Text>
            <Text wrap="truncate">
              <Text color="#5e6673">
                {hhmmss}
              </Text>
              <Text bold>
                {"▲ BUY   "}
              </Text>
              <Text color="#eaecef">
                {fmtPrice2}
              </Text>
              <Text>
                {fmtUsd2}
                {" ◆◆"}
              </Text>
              <Text>
                {" ▮▮▮▮▮▮▮▮     "}
              </Text>
              <Text color="#848e9c">
                {fmtNum2}
                {" "}
              </Text>
              <Text color="#5e6673">
                {maker}
              </Text>
            </Text>
            <Text wrap="truncate">
              <Text color="#5e6673">
                {hhmmss2}
              </Text>
              <Text bold>
                {"▲ BUY   "}
              </Text>
              <Text color="#eaecef">
                {fmtPrice3}
              </Text>
              <Text>
                {fmtUsd3}
                {" ◆◆"}
              </Text>
              <Text>
                {" ▮▮▮▮▮▮▮▮     "}
              </Text>
              <Text color="#848e9c">
                {fmtNum3}
                {" "}
              </Text>
              <Text color="#5e6673">
                {maker2}
              </Text>
            </Text>
            <Text wrap="truncate">
              <Text color="#5e6673">
                {hhmmss3}
              </Text>
              <Text bold>
                {"▲ BUY   "}
              </Text>
              <Text color="#eaecef">
                {fmtPrice4}
              </Text>
              <Text>
                {fmtUsd4}
                {" ◆◆"}
              </Text>
              <Text>
                {" ▮▮▮▮▮▮▮▮     "}
              </Text>
              <Text color="#848e9c">
                {fmtNum4}
                {" "}
              </Text>
              <Text color="#5e6673">
                {maker3}
              </Text>
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Input label="token: " placeholder="paste a token address, Enter" submitLabel="chart" />
              <Box flexDirection="row" gap={2}>
                <Button label="older history" hotkey="o" plain />
                <Button label={`copy ${mint}`} hotkey="c" plain />
                <Text color="#5e6673">
                  1-7 timeframe · Esc to the prompt
                </Text>
              </Box>
            </Box>
            <Text color="#f0b90b" wrap="truncate">
              {err}
            </Text>
          </Box>
        </Box>
        <Text dimColor>
          {"TOKEN    "}
          {"      PRICE"}
          {"     VALUE"}
          {"  INVESTED"}
          {"        PnL"}
          {"        %"}
        </Text>
        <Text dimColor>
          /memes &lt;wallet&gt; to start.
        </Text>
        <Text dimColor>
          Loading positions…
        </Text>
        <Box flexDirection="row">
          <Box width={9}>
            <Button label={`${sym}`} plain autoFocus />
          </Box>
          <Text>
            {formatPrice}
            {formatUsd}
            {"         …"}
            <Text>
              {formatUsd2}
              {formatPct}
            </Text>
          </Text>
        </Box>
        <Box flexDirection="row">
          <Box width={9}>
            <Button label={`${sym}`} plain autoFocus />
          </Box>
          <Text>
            {formatPrice2}
            {formatUsd3}
            {"         …"}
            <Text>
              {formatUsd4}
              {formatPct2}
            </Text>
          </Text>
        </Box>
        <Box flexDirection="row">
          <Box width={9}>
            <Button label={`${sym}`} plain autoFocus />
          </Box>
          <Text>
            {formatPrice3}
            {formatUsd5}
            {"         …"}
            <Text>
              {formatUsd6}
              {formatPct3}
            </Text>
          </Text>
        </Box>
        <Text color="yellow">
          {err2}
        </Text>
        <Input label="chart any token: " placeholder="paste a token address, Enter" submitLabel="chart" />
        <Text dimColor>
          Tab to focus · ↑↓ highlight a token · Enter charts it · 1-7 timeframe · Esc back to the prompt
        </Text>
        <Text dimColor>
          {`${owner}…${owner} · `}
          {"SOL "}
          {formatPrice4}
        </Text>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Not a Solana token address`)
    await $.ui.toast(`Not a Solana token address`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

hooks/register.tsx lines 714–735 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    // Only positions with a PnL: still-scanning ones join once their basis is in.
    const list = (await read($, positions)).flatMap(p => {
      const r = pnl(p)
      return r ? [{ ...p, r }] : []
    })
    if (e.props.hasSurvey || !list.length) return next(e)
    const { Box, Text } = $.ui.resolve(e)
    return (
      <Box>
        <Text>
          🐸{' '}
          {list.map(({ sym, valueUsd, r }, i) => (
            <Text>
              {i ? ' · ' : ''}<Text bold>{sym}</Text> {formatUsd(valueUsd)}{' '}
              <Text color={r.usd >= 0 ? 'green' : 'red'}>{formatUsd(r.usd, true)} ({formatPct(r.pct)})</Text>
            </Text>
          ))}
        </Text>
      </Box>
    )
  })
hooks/register.tsx lines 737–777 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const els = $.ui.resolve(e)
    const { Box, Text, Button } = els
    const owner = await read($, wallet)
    const list = await read($, positions)
    const sol = await read($, solUsd)
    const err = await read($, error)
    const color = (n: number) => (n >= 0 ? 'green' : 'red')
    const chartRows = (e.props.scroll.bodyRows || 40) - list.length - 7

    return (
      <Box flexDirection="column">
        <Box marginBottom={1}>{await chartView($, e, true, chartRows)}</Box>
        <Text dimColor>{'TOKEN'.padEnd(9)}{'PRICE'.padStart(11)}{'VALUE'.padStart(10)}{'INVESTED'.padStart(10)}{'PnL'.padStart(11)}{'%'.padStart(9)}</Text>
        {!owner && <Text dimColor>/memes &lt;wallet&gt; to start.</Text>}
        {owner && list.length === 0 && !err && <Text dimColor>Loading positions…</Text>}
        {list.map((p, i) => {
          const r = pnl(p)
          return (
            <Box flexDirection="row">
            <Box width={9}>
              <Button key={`chart-${p.mint}`} label={p.sym.slice(0, 8)} plain autoFocus={i === 0 ? true : undefined} onPress={() => void chartInMemes($, p.mint)} />
            </Box>
            <Text>
              {formatPrice(p.priceUsd).padStart(11)}
              {formatUsd(p.valueUsd).padStart(10)}
              {(p.basis ? formatUsd(p.basis.buyUsd) : '…').padStart(10)}
              {r ? <Text color={color(r.usd)}>{formatUsd(r.usd, true).padStart(11)}{formatPct(r.pct).padStart(9)}</Text> : <Text dimColor>{'scanning'.padStart(11)}</Text>}
            </Text>
            </Box>
          )
        })}
        {err !== '' && <Text color="yellow">{err}</Text>}
        {'Input' in els && <els.Input key="token" label="chart any token: " placeholder="paste a token address, Enter" submitLabel="chart" onSubmit={v => void chartInMemes($, v.trim())} />}
        <Text dimColor>Tab to focus · ↑↓ highlight a token · Enter charts it · 1-7 timeframe · Esc back to the prompt</Text>
        <Text dimColor>
          {owner ? `${owner.slice(0, 4)}…${owner.slice(-4)} · ` : ''}SOL {formatPrice(sol)}
        </Text>
      </Box>
    )
  })
hooks/register.tsx lines 818–977 · Pane
async function chartView($: EngineInterface, e: Extract<RenderInput, { component: 'Pane' }>, inMemes: boolean, rows: number) {
    const els = $.ui.resolve(e)
    const { Box, Text, Button } = els
    const mint = await read($, tokenA)
    const info = await read($, infoA)
    const tf = tfOf(await read($, tfA))
    const candles = await read($, candlesA)
    const trades = await read($, tradesA)
    const feed = await read($, feedA)
    const hist = await read($, historyA)
    const sol = await read($, solUsd)
    const err = await read($, tokenErrorA)
    const addressBox = 'Input' in els ? <els.Input key="mint" label="token: " placeholder="paste a token address, Enter" submitLabel="chart" onSubmit={v => void openToken($, v.trim())} /> : null
    if (!mint) return inMemes ? <Text dimColor>Highlight a token below to chart it.</Text> : <Box flexDirection="column">{addressBox}<Text dimColor>Tab to focus, paste an address, Enter.</Text></Box>

    const W = e.props.bodyColumns
    const now = Date.now() / 1000
    const price = candles[candles.length - 1]?.c ?? trades[0]?.price ?? 0
    // A window's numbers only once the history reaches back that far (or holds the token's whole life).
    const covers = (sec: number) => !hist.more || (hist.count > 0 && hist.from <= now - sec)
    const change = (sec: number) => (covers(sec) ? changeSince(all, now - sec, price) : undefined)
    const ch24 = change(86400)
    const tick = trades[0]?.side === 'sell' ? C.down : C.up
    const sym = info?.symbol ?? short(mint)
    const color = (n: number) => (n >= 0 ? C.up : C.down)

    // Layout over `rows`: header 2, stats 1, timeframe bar 2, chart, tape header 1, tape, footer 2-3.
    const rest = Math.max(10, rows - (inMemes ? 9 : 10))
    const tapeRows = inMemes ? 3 : Math.max(3, Math.min(40, Math.round(rest * 0.36)))
    const chartRows = Math.max(6, Math.min(120, rest - tapeRows))
    const side = W >= 100 ? 30 : 0
    const chartCols = Math.max(20, Math.min(255, W - side - (side ? 1 : 0)))

    const stat = (label: string, value: string, valueColor = C.bright) => (
      <Text>
        <Text color={C.dim}>{label} </Text>
        <Text color={valueColor} bold>{value}</Text>
        <Text>{'   '}</Text>
      </Text>
    )
    const feedBadge =
      feed.mode === 'live' ? <Text color={C.up} bold>● LIVE · LaserStream</Text>
      : feed.mode === 'polling' ? <Text color={C.warn} bold>◐ POLLING · Helius RPC</Text>
      : feed.mode === 'connecting' ? <Text color={C.warn} bold>◌ CONNECTING</Text>
      : <Text color={C.dim} bold>○ OFF</Text>

    let chart
    if (e.surface === 'terminal') {
      const { Raster } = $.ui.resolve(e)
      const key = `${sym}|${info?.supply}|${tf.label}|${chartCols}x${chartRows}|${candles.length}|${candles[0]?.t}|${JSON.stringify(candles[candles.length - 1] ?? null)}`
      if (chartCache.key !== key) chartCache = { key, b64: toBase64(new Uint8Array(rasterChart(candles, chartCols, chartRows, info?.supply ?? 0).buffer)) }
      chart = <Raster key="chart" columns={chartCols} rows={chartRows} cells={chartCache.b64} />
    } else {
      chart = <Box width={chartCols} height={chartRows}><Text color={C.dim}>The chart draws in the terminal.</Text></Box>
    }

    // Flow bars for the side panel: green buys against red sells.
    const bw = side - 4
    const flowBar = (a: number, b: number) => {
      const n = a + b ? Math.round((a / (a + b)) * bw) : Math.round(bw / 2)
      return <Text><Text color={C.up}>{'█'.repeat(n)}</Text><Text color={C.down}>{'█'.repeat(bw - n)}</Text></Text>
    }
    const flowBlock = (title: string, sec: number) => {
      const f = flowSince(all, now - sec)
      return (
        <Box flexDirection="column" marginBottom={1}>
          <Text><Text color={C.text} bold>{title}</Text><Text color={C.dim}>  vol </Text><Text color={C.bright}>{fmtUsd(f.volUsd)}</Text></Text>
          <Text><Text color={C.up}>{fmtNum(f.buys)} buys</Text><Text color={C.dim}> / </Text><Text color={C.down}>{fmtNum(f.sells)} sells</Text><Text color={C.dim}> · {fmtNum(f.makers)} wallets</Text></Text>
          {flowBar(f.buyUsd, f.sellUsd)}
        </Box>
      )
    }
    const span = hist.count ? now - hist.from : 0
    const panel = side ? (
      <Box flexDirection="column" width={side} height={chartRows} borderStyle="round" borderColor={C.line} paddingX={1}>
        {flowBlock('LAST 60s', 60)}
        {covers(3600) && flowBlock('1H', 3600)}
        {covers(86400) ? flowBlock('24H', 86400) : hist.count > 0 && flowBlock(`LOADED ${fmtSpan(span)}`, span + 1)}
        {info?.top10Pct != null && <Text color={C.text} bold>TOP 10 ACCOUNTS</Text>}
        {info?.top10Pct != null && <Text><Text color={C.dim}>hold </Text><Text color={info.top10Pct > 30 ? C.warn : C.bright}>{info.top10Pct.toFixed(1)}%</Text><Text color={C.dim}> (incl. pools)</Text></Text>}
        {info?.top10Pct != null && <Text color={info.top10Pct > 30 ? C.warn : C.text}>{bar(info.top10Pct / 100, bw)}</Text>}
      </Box>
    ) : null

    // Time & sales, sized against the biggest print on screen.
    const shown = trades.slice(0, tapeRows)
    const maxUsd = Math.max(1, ...shown.map(t => t.usd))
    const wide = W >= 96
    const tape = shown.map(t => {
      const c = t.side === 'buy' ? C.up : C.down
      const big = t.usd >= 1000
      return (
        <Text wrap="truncate">
          <Text color={C.dim}>{hhmmss(t.t).padEnd(10)}</Text>
          <Text color={c} bold>{(t.side === 'buy' ? '▲ BUY ' : '▼ SELL').padEnd(8)}</Text>
          <Text color={C.bright}>{fmtPrice(t.price).padEnd(14)}</Text>
          <Text color={c} bold={big}>{fmtUsd(t.usd).padStart(9)}{big ? (t.usd >= 10_000 ? ' ◆◆' : ' ◆ ') : '   '}</Text>
          {wide && <Text color={c}>{' ' + '▮'.repeat(Math.max(1, Math.round((t.usd / maxUsd) * 12))).padEnd(13)}</Text>}
          <Text color={C.text}>{fmtNum(t.tokens).padStart(10)}  </Text>
          <Text color={C.dim}>{short(t.maker)}</Text>
        </Text>
      )
    })

    const histText = hist.loading ? `loading history… ${fmtNum(hist.count)} swaps` : hist.count ? `${fmtNum(hist.count)} swaps over ${fmtSpan(span)}${hist.more ? '' : ' (all)'}` : 'no swaps yet'

    return (
      <Box flexDirection="column" width={W}>
        {/* Header: identity and price on the left, the feed on the right. */}
        <Box flexDirection="row" justifyContent="space-between">
          <Box flexDirection="row" gap={1}>
            <Box flexDirection="column">
              <Text wrap="truncate">
                <Text color={C.bright} bold>{sym}</Text>
                <Text color={C.dim}>{info?.name ? `  ${info.name} · ${short(mint)}` : `  ${short(mint)}`}</Text>
              </Text>
              <Text>
                <Text color={tick} bold>{fmtPrice(price)}</Text>
                {ch24 != null && <Text color={color(ch24)} bold>{'  ' + fmtPct(ch24)}</Text>}
                {ch24 != null && <Text color={C.dim}> 24h</Text>}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column" alignItems="flex-end">
            {feedBadge}
            <Text color={C.dim} wrap="truncate">
              {feed.msg || (feed.slot ? `slot ${feed.slot.toLocaleString('en-US')} · Δ${feed.lagMs}ms · SOL ${fmtPrice(sol)}` : `SOL ${fmtPrice(sol)}`)}
            </Text>
          </Box>
        </Box>

        {/* Stats strip. */}
        <Text wrap="truncate">
          {info?.supply ? stat('MCAP', fmtUsd(price * info.supply)) : null}
          {info?.supply ? stat('SUPPLY', fmtNum(info.supply)) : null}
          {stat('HISTORY', histText, C.text)}
        </Text>

        {/* Timeframes (hotkeys 1-7) and change over each window the history covers. */}
        <Box flexDirection="row" justifyContent="space-between" marginTop={1}>
          <Box flexDirection="row" gap={1}>
            {TIMEFRAMES.map((t, i) => (
              <Button key={`tf-${t.label}`} label={t.label} hotkey={String(i + 1)} variant={t.label === tf.label ? 'primary' : 'secondary'} onPress={() => setTimeframe($, t.label)} />
            ))}
          </Box>
          <Text wrap="truncate">
            {([['5M', 300], ['1H', 3600], ['6H', 21600], ['24H', 86400]] as const).map(([k, sec]) => {
              const c = change(sec)
              return c == null ? null : <Text><Text color={C.dim}>{k} </Text><Text color={color(c)}>{fmtPct(c)}</Text><Text>{'  '}</Text></Text>
            })}
          </Text>
        </Box>

        {/* Chart and side panel. */}
        <Box flexDirection="row" gap={side ? 1 : 0}>
          {chart}
          {panel}
        </Box>

        {/* Time & sales. */}
Licence text (MIT)
MIT License

Copyright (c) 2026 Nathan Liow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What its code calls

networkruns programsreads filesenv varsremembers

The design, read from code

Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.

What its code shows

Read from the source at commit 5b81e3d8b951 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.3 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.https://mainnet.helius-rpc.com
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.hooks/register.tsx:534 node (a shell or interpreter)
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add nathanliow/meme-watch
/plugin install meme-watch@meme-watch

This installs the marketplace's latest commit, which may not be the one read here (5b81e3d8b951). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "nathanliow-meme-watch" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs