Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(robinhood): build out hood-api, hood-cli, hood-launcher, hood402, hood-mcp, hood-traders, hoodkit; wire Robinhood Chain markets pages and worlds-lobby integration
fudjia8772fc5223a8
diff --git a/robinhood/hood-mcp/docs/index.html b/robinhood/hood-mcp/docs/index.htmlnew file mode 100644index 000000000..9e2f17f31--- /dev/null+++ b/robinhood/hood-mcp/docs/index.html@@ -0,0 +1,130 @@+<title>hood-mcp — MCP servers for Robinhood Chain</title>+<meta name="description" content="Model Context Protocol servers for Robinhood Chain: zero-config Stock Token data plus a guarded, spend-capped trading server for AI agents." />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🏹</text></svg>" />+<link rel="stylesheet" href="site.css" />++<nav class="top">+ <div class="wrap">+ <div class="brand"><span class="tick">hood</span>-mcp</div>+ <div class="links">+ <a href="index.html" aria-current="page">Overview</a>+ <a href="install.html">Install</a>+ <a href="tools.html">Tools</a>+ <a href="safety.html">Safety model</a>+ <a href="https://github.com/nirholas/hood-mcp">GitHub</a>+ </div>+ </div>+</nav>++<main class="wrap">+ <section class="hero" style="border-top:none;">+ <div class="badges">+ <span class="badge">chain 4663</span>+ <span class="badge free">data server: free, zero-config</span>+ <span class="badge guarded">trading server: opt-in, spend-capped</span>+ </div>+ <h1>MCP servers for <span class="grad">Robinhood Chain</span></h1>+ <p class="lede">+ Stock Token quotes, multiplier-correct portfolios, memecoin launches, and chain stats —+ free and read-only. Plus a separate, explicitly opt-in trading server with hard spend caps+ and a confirm gate for agents that want to act, not just look.+ </p>+ <div class="cta">+ <a class="btn primary" href="install.html">Install in 60 seconds</a>+ <a class="btn" href="tools.html">Browse tools</a>+ <a class="btn" href="https://github.com/nirholas/hood-mcp">View source</a>+ </div>+ </section>++ <section>+ <h2>A real session</h2>+ <p class="section-lede">+ This is an unedited MCP tool call against the live server in this repo, captured against+ Robinhood Chain mainnet during the build — the same stdio transport Claude Code, Claude+ Desktop, and Cursor use.+ </p>+ <div class="transcript">+ <div class="bar"><span class="dot"></span><span class="dot"></span><span class="dot"></span> claude · hood-mcp connected</div>+ <div class="body">+ <div class="user">What's GME trading at on Robinhood Chain, and what's the premium over the oracle price?</div>+ <div class="tool-call">→ calling <span class="name">get_stock_quote</span>({ "symbol": "GME" })</div>+ <pre class="tool-result">{+ "symbol": "GME",+ "name": "GameStop • Robinhood Token",+ "chainlink": { "priceUsd": 21.76125, "ageSeconds": 169330 },+ "dexPriceUsd": 20.521686,+ "premiumPct": -5.6962,+ "premiumNote": "positive = DEX trades above oracle",+ "uiMultiplier": "1000000000000000000",+ "underlyingSharePriceUsd": 21.76125,+ "sources": ["chainlink", "uniswap-v3", "robinhood-chain-rpc"]+}</pre>+ <div class="answer">+ The Chainlink oracle prices the GME Stock Token at <strong>$21.76</strong>. It's actually+ trading at <strong>$20.52</strong> on the token's Uniswap v3 pool — a+ <strong>5.70% discount</strong> to the oracle. The <code>uiMultiplier</code> is+ <code>1e18</code> (1:1), so that's also the underlying share price: no split or+ reinvested-dividend adjustment has happened yet.+ </div>+ </div>+ </div>+ </section>++ <section>+ <h2>Two servers</h2>+ <p class="section-lede">One package, two binaries, two very different trust levels.</p>+ <div class="grid cols-2">+ <div class="card">+ <h3>hood-mcp <span class="pill free">free</span></h3>+ <p>+ 9 read-only tools. No API key, no wallet, no config — runs against the public RPC out+ of the box. Stock Token quotes with live oracle + DEX premium, multiplier-correct+ portfolios, memecoin data, launch scanning, chain stats.+ </p>+ </div>+ <div class="card">+ <h3>hood-mcp-trading <span class="pill guarded">opt-in</span></h3>+ <p>+ 4 tools for one configured wallet. Refuses to start without an explicit kill switch.+ Every mutating call is spend-capped in USD and requires a second, confirmed call to+ broadcast. See the <a href="safety.html">safety model</a>.+ </p>+ </div>+ </div>+ </section>++ <section>+ <h2>Why this exists</h2>+ <p class="section-lede">+ Robinhood Chain launched 2026-07-01. As of this build, the ecosystem has exactly two other+ MCP servers for the chain — both zero-star, read-only hobby projects a few days old.+ This is the productized one: a full data surface plus a trading surface built to a real+ safety bar, not a demo.+ </p>+ <div class="grid cols-3">+ <div class="card">+ <h3>Multiplier-correct</h3>+ <p>Stock Tokens implement ERC-8056. Raw balances understate positions after a split or+ reinvested dividend — this server does the share math right, same as the underlying+ <code>hoodchain</code> SDK.</p>+ </div>+ <div class="card">+ <h3>Real upstreams</h3>+ <p>Chainlink, Uniswap v3, Blockscout, GeckoTerminal, DefiLlama — no cached fixtures, no+ placeholder data. Every tool call hits the chain or a real API.</p>+ </div>+ <div class="card">+ <h3>Guarded by default</h3>+ <p>The trading server ships with spend caps and a confirm gate on by default. An agent+ cannot move funds on the first call, ever.</p>+ </div>+ </div>+ </section>++ <footer>+ MIT © 2026 nirholas · Built by <a href="https://x.com/nichxbt">nirholas</a> ·+ <a href="https://three.ws">three.ws</a> ·+ <a href="https://github.com/nirholas/hood-mcp">github.com/nirholas/hood-mcp</a>+ </footer>+</main>diff --git a/src/robinhood-stock.js b/src/robinhood-stock.jsnew file mode 100644index 000000000..7c85e538f--- /dev/null+++ b/src/robinhood-stock.js@@ -0,0 +1,200 @@+// /markets/robinhood/stock/:symbol — Robinhood Chain Stock Token detail page.+//+// Chainlink NAV (current + recent round history chart), all DEX pairs,+// premium/discount, uiMultiplier, holders + recent transfers (Blockscout),+// contract links. Display-only — buy rail is an eligibility-gated outbound+// "Trade on DEX" link (Stock Tokens are tokenized debt securities, see the+// legal line in _shared.md; the acquisition gate never lives here, only the+// disclosure does).++import { formatUsd, escapeHtml as esc } from './shared/coin-format.js';+import { mountStockEligibilityGate } from './robinhood-purchase.js';++const $ = (id) => document.getElementById(id);++function symbolFromPath() {+ const m = location.pathname.match(/^\/markets\/robinhood\/stock\/([A-Za-z0-9.-]{1,10})\/?$/);+ return m ? m[1].toUpperCase() : null;+}++async function getJson(url) {+ const res = await fetch(url, { headers: { accept: 'application/json' } });+ const body = await res.json().catch(() => null);+ if (!res.ok) {+ const err = new Error(body?.error_description || body?.error || `request failed (${res.status})`);+ err.status = res.status;+ throw err;+ }+ return body?.data ?? body;+}++function fmtNav(n) {+ if (n == null || !Number.isFinite(n)) return '—';+ return `$${n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;+}++function premiumChip(pct) {+ if (pct == null || !Number.isFinite(pct)) return '<span class="rh-premium flat">—</span>';+ const cls = Math.abs(pct) < 0.05 ? 'flat' : pct > 0 ? 'pos' : 'neg';+ return `<span class="rh-premium ${cls}">${pct > 0 ? '+' : ''}${pct.toFixed(2)}%</span>`;+}++function renderSkeletons() {+ $('rh-head').innerHTML = `+ <div class="ch-hero">+ <div class="cv-skel" style="width:14rem;height:2.5rem"></div>+ <div class="cv-skel" style="width:18rem;height:3rem;margin-top:0.75rem"></div>+ </div>`;+ $('rh-chart').innerHTML = '<div class="cv-chart-panel"><div class="cv-skel" style="height:240px;border-radius:8px"></div></div>';+ $('rh-stats').innerHTML = '<div class="cv-stats-grid">' + Array.from({ length: 6 }, () => '<div class="cv-skel" style="height:5rem"></div>').join('') + '</div>';+}++function renderHead(s) {+ document.getElementById('rh-doc-title').textContent = `${s.symbol} — Robinhood Chain Stock Token · three.ws`;+ document.getElementById('rh-doc-desc').setAttribute('content', `Live Chainlink NAV, DEX premium/discount, holders, and contract links for ${s.name} (${s.symbol}) on Robinhood Chain.`);+ document.getElementById('rh-crumb-symbol').textContent = s.symbol;++ $('rh-head').innerHTML = `+ <div class="ch-hero">+ <div class="ch-title-row">+ ${s.iconUrl ? `<img src="${esc(s.iconUrl)}" alt="" width="48" height="48" style="border-radius:50%" data-no-dark-filter />` : ''}+ <h1 class="ch-title">${esc(s.name.replace(' • Robinhood Token', ''))}</h1>+ <span class="cv-rank-badge">${esc(s.symbol)}</span>+ </div>+ <div class="cv-price-row" style="margin-top:0.75rem">+ <span class="cv-price cv-mono">${fmtNav(s.nav.priceUsd)}</span>+ <span style="color:var(--cv-text-3);font-size:0.875rem">NAV (Chainlink)</span>+ ${premiumChip(s.dex.premiumPct)}+ </div>+ </div>`;+}++function renderChart(s) {+ const el = $('rh-chart');+ const points = (s.nav.history || []).map((p) => p.priceUsd);+ if (points.length < 2) {+ el.innerHTML = '<div class="cv-empty"><p>No NAV history available yet.</p></div>';+ return;+ }+ const min = Math.min(...points);+ const max = Math.max(...points);+ const range = max - min || 1;+ const w = 800;+ const h = 240;+ const path = points.map((v, i) => `${((i / (points.length - 1)) * w).toFixed(1)},${(h - ((v - min) / range) * h).toFixed(1)}`).join(' ');+ el.innerHTML = `+ <div class="cv-chart-panel">+ <div class="cv-chart-bar"><span class="title">Chainlink NAV — recent rounds</span></div>+ <svg viewBox="0 0 ${w} ${h}" style="width:100%;height:auto" aria-label="NAV price history"><polyline points="${path}" fill="none" stroke="var(--cv-chart-green)" stroke-width="2"/></svg>+ </div>`;+}++function renderStats(s) {+ const mult = s.uiMultiplier ? Number(s.uiMultiplier) / 1e18 : null;+ $('rh-stats').innerHTML = `+ <div class="cv-stats-grid">+ <div class="cv-mini-stat"><div class="label">DEX Price</div><div class="value">${s.dex.priceUsd != null ? fmtNav(s.dex.priceUsd) : '—'}</div></div>+ <div class="cv-mini-stat"><div class="label">Premium / Discount</div><div class="value">${premiumChip(s.dex.premiumPct)}</div></div>+ <div class="cv-mini-stat"><div class="label">uiMultiplier</div><div class="value cv-mono">${mult != null ? mult.toFixed(4) : '—'}</div></div>+ <div class="cv-mini-stat"><div class="label">Holders</div><div class="value cv-mono">${s.holdersCount != null ? s.holdersCount.toLocaleString('en-US') : '—'}</div></div>+ <div class="cv-mini-stat"><div class="label">Circulating Mkt Cap</div><div class="value">${esc(formatUsd(s.circulatingMarketCapUsd))}</div></div>+ <div class="cv-mini-stat"><div class="label">Feed Updated</div><div class="value">${s.nav.updatedAt ? new Date(s.nav.updatedAt * 1000).toLocaleString('en-US') : '—'}</div></div>+ </div>`;+}++function renderHolders(s) {+ const el = $('rh-holders');+ const holders = s.holders || [];+ if (!holders.length) {+ el.innerHTML = '<h2 class="cv-h2">Holders</h2><div class="cv-empty"><p>No holder data available.</p></div>';+ return;+ }+ el.innerHTML = `+ <h2 class="cv-h2">Holders</h2>+ <div class="cv-table-wrap">+ <table class="cv-table">+ <thead><tr><th class="left">Address</th><th>Balance</th></tr></thead>+ <tbody>${holders+ .map(+ (h) => `+ <tr><td class="left cv-mono">${h.address ? `<a href="https://robinhoodchain.blockscout.com/address/${esc(h.address)}" target="_blank" rel="noopener noreferrer">${esc(h.address.slice(0, 8))}…${esc(h.address.slice(-6))}</a>` : '—'}</td><td class="cv-mono">${h.value ? Number(h.value).toLocaleString('en-US') : '—'}</td></tr>`,+ )+ .join('')}</tbody>+ </table>+ </div>`;+}++function renderTransfers(s) {+ const el = $('rh-transfers');+ const transfers = s.recentTransfers || [];+ if (!transfers.length) {+ el.innerHTML = '<h2 class="cv-h2">Recent Transfers</h2><div class="cv-empty"><p>No recent transfers.</p></div>';+ return;+ }+ el.innerHTML = `+ <h2 class="cv-h2">Recent Transfers</h2>+ <div class="cv-table-wrap">+ <table class="cv-table">+ <thead><tr><th class="left">Tx</th><th class="left">From</th><th class="left">To</th></tr></thead>+ <tbody>${transfers+ .map(+ (t) => `+ <tr>+ <td class="left cv-mono">${t.hash ? `<a href="https://robinhoodchain.blockscout.com/tx/${esc(t.hash)}" target="_blank" rel="noopener noreferrer">${esc(t.hash.slice(0, 8))}…</a>` : '—'}</td>+ <td class="left cv-mono">${t.from ? `${esc(t.from.slice(0, 6))}…${esc(t.from.slice(-4))}` : '—'}</td>+ <td class="left cv-mono">${t.to ? `${esc(t.to.slice(0, 6))}…${esc(t.to.slice(-4))}` : '—'}</td>+ </tr>`,+ )+ .join('')}</tbody>+ </table>+ </div>`;+}++function renderLinks(s) {+ $('rh-links').innerHTML = `+ <h2 class="cv-h2">Links</h2>+ <div class="cv-pills">+ <a class="cv-pill" href="${esc(s.links.explorer)}" target="_blank" rel="noopener noreferrer">Contract ↗</a>+ ${s.links.feed ? `<a class="cv-pill" href="${esc(s.links.feed)}" target="_blank" rel="noopener noreferrer">Chainlink Feed ↗</a>` : ''}+ ${s.links.dex ? `<a class="cv-pill" href="${esc(s.links.dex)}" target="_blank" rel="noopener noreferrer">DEX Pool ↗</a>` : ''}+ </div>`;+}++function renderNotFound(symbol) {+ document.getElementById('rh-main').removeAttribute('aria-busy');+ $('rh-head').innerHTML = `<div class="cv-empty"><p>No Stock Token found for symbol "${esc(symbol)}".</p><a class="cv-load-more" href="/markets/robinhood">Back to Robinhood Chain →</a></div>`;+ ['rh-chart', 'rh-stats', 'rh-holders', 'rh-transfers', 'rh-links', 'rh-buy-rail'].forEach((id) => {+ const el = $(id);+ if (el) el.innerHTML = '';+ });+}++function renderError(message) {+ document.getElementById('rh-main').removeAttribute('aria-busy');+ $('rh-head').innerHTML = `<div class="cv-empty"><p>${esc(message || 'Failed to load this Stock Token.')}</p><button class="cv-load-more" type="button" id="rh-retry">Retry</button></div>`;+ document.getElementById('rh-retry')?.addEventListener('click', main);+}++async function main() {+ const symbol = symbolFromPath();+ if (!symbol) return;+ renderSkeletons();+ let s;+ try {+ s = await getJson(`/api/v1/robinhood/stocks-detail?symbol=${encodeURIComponent(symbol)}`);+ } catch (err) {+ if (err.status === 404) renderNotFound(symbol);+ else renderError(err.message);+ return;+ }+ document.getElementById('rh-main').removeAttribute('aria-busy');+ renderHead(s);+ renderChart(s);+ renderStats(s);+ renderHolders(s);+ renderTransfers(s);+ renderLinks(s);+ mountStockEligibilityGate($('rh-buy-rail'), { symbol: s.symbol, dexUrl: s.links.dex });+}++main();diff --git a/workers/robinhood-feed/README.md b/workers/robinhood-feed/README.mdnew file mode 100644index 000000000..50107d681--- /dev/null+++ b/workers/robinhood-feed/README.md@@ -0,0 +1,180 @@+# robinhood-feed++The PumpPortal-equivalent for **Robinhood Chain** (mainnet chain ID 4663): a+long-lived Node worker that watches NOXA + The Odyssey memecoin launchpads and+their Uniswap v3 pools, normalizes every launch/trade/graduation into the same+shape three.ws's pump.fun consumers already understand, and serves it over+SSE + WebSocket + a REST snapshot. No mocks — every field comes from a real+on-chain read (RPC logs + the Arbitrum sequencer feed).++Nothing like this exists for Robinhood Chain today. It's also sellable+standalone: any RH-chain trading bot, alert bot, or dashboard needs exactly+this firehose.++## Why it exists++three.ws's `/play` feature turns every pump.fun coin into a deterministic 3D+world you walk into as your avatar, with live trades animating the space. This+worker is the data plane that lets `/play` do the same for Robinhood Chain+coins — see `api/robinhood/coin-trades.js` and `api/robinhood/play-worlds.js`,+which proxy it into the exact contract `src/game/chart-screen.js` (the in-world+trading terminal) already polls.++## Architecture++| File | Role |+|------|------|+| `index.js` | Entrypoint — starts the firehose, wires it into the server, graceful SIGINT/SIGTERM shutdown. |+| `src/config.js` | Env-driven config (network, RPC URL, sequencer feed URL, poll intervals, buffer sizes). Every default works with zero config against the public endpoints. |+| `src/chain.js` | Shared `hoodchain` (the `robinhood-chain-sdk` npm package) read client; cached ERC-20 name/symbol resolution; one-time Uniswap v3 pool inspection (which side is the coin, ETH vs USDG quote). |+| `src/eth-price.js` | ETH/USD spot, 4-source failover (Coinbase → Kraken → CoinGecko → DefiLlama), cached ~60s — the ETH-gas-chain analogue of three.ws's `sol-price.js`. |+| `src/normalize.js` | **Pure** functions mapping decoded on-chain events to the pump-compatible shape. No chain reads — unit-tests directly against captured real logs (`tests/fixtures/`). |+| `src/feed.js` | The orchestrator: composes the SDK's `watchLaunches`/`watchCurveTrades`/`watchGraduations` (NOXA + Odyssey via RPC logs), a dynamic Uniswap v3 `Swap` watcher over tracked pools (NOXA pools from block one, Odyssey pools post-graduation), and the sequencer feed as a liveness/gap watchdog. Backfills on cold start, gap-fills on a stalled watcher, dedupes cross-source. |+| `src/server.js` | HTTP + WS server: `/healthz`, `/recent`, SSE `/events`, WebSocket `/ws`. Keeps a small replay buffer so a fresh subscriber sees recent history instead of a blank feed. |++Built entirely on `hoodchain` (`robinhood/robinhood-chain-sdk/`, published npm+name `hoodchain`) — this worker adds composition, pump-shape normalization, and+serving on top; it does not reimplement chain reads the SDK already provides.++## Divergences from the pump.fun (PumpPortal) feed++Documented per the mission brief — fields map 1:1 where semantics align:++- **Chain**: Robinhood Chain is EVM (Arbitrum Orbit L2), not Solana. Addresses+ are `0x…` (40 hex chars), not base58. `mint` in every event is the coin's ERC-20+ contract address.+- **Native asset**: ETH, not SOL. The `sol_amount` / `sol_value_usd` field names+ are kept **verbatim** for compatibility with existing chart-screen.js /+ market-reactor.js field reads (`src/game/chart-screen.js:186-195`,+ `src/game/market-reactor.js:78-79`) — the *value* carried is the trade's+ native-ETH magnitude, not SOL. A `quote_symbol` field (`'ETH'` or `'USDG'`)+ always tells you which.+- **Launchpads**: two exist, not one — **NOXA** (instant Uniswap v3 listing,+ one tx: deploy + pool + locked liquidity, no bonding curve) and **The+ Odyssey** (pump.fun-style ETH bonding curve; graduates via `PoolMigrated` to+ a locked Uniswap v3 pool). NOXA coins have no `graduation` event — they're+ tradeable via Uniswap swaps from block one, which this worker watches+ directly (`trade.source: 'uniswap-v3'` vs `'odyssey-curve'`).+ `launchpad` on every launch event tells you which.+- **No off-chain metadata service**: pump.fun ships `image_uri`/description/+ socials from its own API; Robinhood Chain launchpads don't expose an+ equivalent yet, so `image_uri`/`description`/`twitter`/etc. are always `null`.+ `name`/`symbol` ARE real — resolved on-chain via the ERC-20 `name()`/+ `symbol()` calls.+- **`initial_buy_native`/`initial_buy_usd`** on a launch event are best-effort:+ the hoodchain SDK's high-level launch watchers don't carry NOXA's raw+ `initialBuyAmount` log field through their decoded `Launch` type, so these+ resolve to `null` rather than a fabricated figure when unavailable.+- **Sequencer feed vs RPC logs**: the Arbitrum Nitro sequencer feed+ (`wss://feed.mainnet.chain.robinhood.com`) delivers every L2 transaction+ ~100–300ms before it's queryable over RPC, but decoding trade *semantics*+ (which pool, buy vs sell, amounts) out of its raw RLP payload is far less+ reliable than reading decoded event logs. This worker uses RPC logs (via+ `hoodchain`'s `watchContractEvent`, polled at `RH_POLL_MS`, default 2s) for+ every decoded event, and the sequencer feed only as a sub-second block-tip /+ gap-detection signal (`GET /healthz` → `firehose.feed.seconds_since_frame`).+- **`market_cap_usd`** is always `null` — computing a live circulating market+ cap needs a total-supply read this worker doesn't do per-trade (would be one+ more RPC call per event); left `null` rather than approximated.++## Running it++```bash+cd workers/robinhood-feed+npm install # pulls hoodchain via file:../../robinhood/robinhood-chain-sdk+npm start # listens on :8788 (mainnet, public RPC + sequencer feed)+```++Zero-config defaults hit the public Robinhood Chain endpoints. Every knob is an+env var:++| Var | Default | Meaning |+|-----|---------|---------|+| `RH_NETWORK` | `mainnet` | `mainnet` (4663) or `testnet` (46630). |+| `RH_RPC_URL` | public RPC | Override the HTTP RPC (e.g. an Alchemy endpoint once `ROBINHOOD_MAINNET` is enabled on the app — see Known limitations). |+| `ALCHEMY_API_KEY` | — | If set, mainnet RPC calls route through Alchemy automatically. |+| `RH_FEED_URL` | public sequencer feed | Override the sequencer WS URL. |+| `RH_USE_FEED` | `1` | Set `0` to disable the sequencer-feed watchdog entirely (RPC-only mode). |+| `RH_POLL_MS` | `2000` | RPC log poll interval for the SDK watchers. |+| `PORT` | `8788` | HTTP/WS server port. |+| `RH_BACKFILL_BLOCKS` | `200000` | How many blocks of launch history to backfill on cold start. |+| `RH_GAP_BLOCKS` | `2000` | Chain-head lead that triggers a gap-fill rescan (≈3.3 min of blocks at Robinhood Chain's ~100ms cadence — must clear one poll tick's normal advance or every tick misreads itself as stalled). |+| `RH_MAX_POOLS` | `400` | LRU cap on concurrently-watched Uniswap v3 pools. |++## API++- `GET /healthz` → `{ ok, network, uptime_s, subscribers, buffer, firehose: { last_scanned_block, tracked_pools, feed: { last_sequence, seconds_since_frame } } }`+- `GET /recent?kind=launch|trade|graduation|all&limit=20` → `{ events: [{ kind, data }] }`, newest first.+- `GET /events?kinds=launch,trade,graduation` (SSE) → replays the buffer (`replay: true`), then streams live. `text/event-stream`, each line `data: {"kind":"trade","data":{...}}`.+- `WS /ws?kinds=launch,trade,graduation` → identical events over a WebSocket.++Event shapes are documented inline in `src/normalize.js`. Every trade carries+both the legacy pump-compatible fields (`sol_amount`, `usd_amount`, `user`,+`tx`, `is_buy`) and chain-explicit fields (`chain`, `chain_id`, `quote_symbol`,+`explorer_tx_url`).++## Tests++```bash+npm test+```++Unit tests (`tests/normalize.test.js`) run the pure normalizer against **real+on-chain logs**, captured live from Robinhood Chain mainnet during development+and committed as fixtures (`tests/fixtures/*.json`) — an Odyssey `Traded` log,+a NOXA `TokenLaunched` log, an Odyssey `TokenCreated` log, and a Uniswap v3+`Swap` log on the resulting pool. No mocks: every asserted value traces back to+a real transaction hash. Captured with:++```js+import { createHoodClient, ODYSSEY_ADDRESSES, NOXA_ADDRESSES,+ odysseyTradedEvent, odysseyTokenCreatedEvent, noxaTokenLaunchedEvent } from 'hoodchain';+const hood = createHoodClient();+const logs = await hood.public.getLogs({+ address: ODYSSEY_ADDRESSES.bondingCurveFactory,+ event: odysseyTradedEvent,+ fromBlock: /* recent range */, toBlock: 'latest',+});+```++## Deploying++Same shape as the other long-lived Node workers in `workers/` (e.g.+`agent-sniper`): a Cloud Run **service** (not a job — it's a persistent+WS/SSE server), min instances ≥ 1 so the SDK watchers and replay buffer stay+warm.++```bash+gcloud run deploy robinhood-feed \+ --source workers/robinhood-feed \+ --region us-central1 \+ --min-instances 1 --max-instances 1 \+ --no-cpu-throttling \+ --set-env-vars RH_NETWORK=mainnet+```++`--max-instances 1`: the firehose is a single logical stream (RPC watchers ++sequencer feed + replay buffer); running two instances would double the RPC+load and split subscribers across two independent buffers. Scale reads by+fronting it with a CDN/cache on `/recent`, not by adding instances.++Once deployed, set `ROBINHOOD_FEED_URL` on the three.ws API service (Cloud Run+`three-ws-api`) to this worker's URL so `api/robinhood/coin-trades.js` and+`api/robinhood/play-worlds.js` stop falling back to their empty-but-honest+`configured: false` state.++## Known limitations (owner action)++- **Alchemy accelerator not yet enabled**: `ALCHEMY_API_KEY` is set in the+ environment, but the Alchemy app doesn't have the Robinhood Chain network+ enabled (`ROBINHOOD_MAINNET is not enabled for this app` — verified live+ during development). The worker runs correctly against the public RPC+ without it; enabling it would mainly cut RPC latency, not add capability.+ Enable at `https://dashboard.alchemy.com/apps/<app>/networks`.+- **Public RPC rate limits**: the public `rpc.mainnet.chain.robinhood.com`+ has no documented SLA. Under sustained load, point `RH_RPC_URL` at a paid+ provider (Alchemy, once enabled).++---++Built by [nirholas](https://x.com/nichxbt) · [three.ws](https://three.ws)