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: integrate hood402 for Robinhood Chain payments
fudjiab21276e69416
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f449db6a9..0bacce84b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-07-12- **Docs · The autonomous economy** (`/docs/autonomous-economy`) — How the three.ws on-chain treasury funds itself and where every dollar flows: the funding-root and engine wallets, the topup/sweepback loop, the allowlist- and destination-locks that keep money inside platform-owned wallets, and the two leak scanners that audit every signer wallet on-chain every minute — plus how to verify there's no leak yourself.+- **Robinhood Chain** (`/markets/robinhood`) — The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.- **Agent discovery fixed: six paid endpoints were invisible to x402 scanners** — The machine-readable catalog at /openapi.json — what AI agents and x402 scanners like x402scan and AgentCash read to find and pay for three.ws APIs — had six paid endpoints (agent bouncer, verifiable vanity keys, crypto intel, cosmetic purchase, animation download, club cover) accidentally buried inside another entry, making them undiscoverable. All 61 payable routes now list correctly and the document passes the AgentCash discovery validator. The Permit2 gasless-payment demo is now only advertised when its settlement lane is actually live, so agents are never quoted a payment path that can't settle. (`/openapi.json`) `[fix, improvement]`- **Agent profiles, redesigned** — Agent profile pages got a ground-up redesign. Instead of one endless column of cards, everything is now organized into clear sections — Overview, Capabilities, Economy, Activity, Trust & Identity, Reviews, and Developers — with a sticky navigation bar that follows you as you scroll and hides sections that have nothing to show. The hero is a compact identity band with the live 3D avatar beside the agent's name, description, and actions, and secondary view modes now live in a tidy menu instead of a wall of buttons. Pages are roughly 40% shorter and much easier to scan. Prefer the old look? Every profile keeps a “Classic layout” link that serves the previous design unchanged. The companion panels (live presence, stages, work-for-hire, alpha co-pilot) now sit in a compact strip beside the profile instead of stacking above it — on mobile the agent's name and avatar are the first thing you see — and the live watch view (screen, avatar cam, action log) has a proper home in the Activity section. Signed-out visitors get a clear “sign in to see the action log” state instead of an endless loading spinner, and stats with nothing to report simply don't render. (`/agents`) `[improvement, feature]`- **AI features can no longer go down when one provider does** — Every AI-powered feature on three.ws (fact checks, agent chat, persona extraction, scene composing) routes through one shared brain that tries free providers first and falls back automatically. That chain just got much deeper: Groq now has a second lane with its own separate quota, OpenRouter gets a zero-credit free lane so an empty account no longer kills it, optional Cerebras and Google AI Studio lanes activate the moment a key is added, and — the anchor — Gemini on the platform's own Google Cloud now backs the whole chain with no third-party quota to exhaust. Previously a rare bad hour where every free tier was exhausted at once could surface an error; now the request rides through. The fact-checker was also corrected to stop favoring a paid key ahead of the free lanes. (`/changelog`) `[improvement, fix, infra]`@@ -20,6 +21,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Paid downloads can never ship before the payment settles** — Every paid endpoint on three.ws follows a 'deliver, then settle' order: the handler produces its result, the wrapper charges the buyer on-chain, and only then sends the response. That works for endpoints that hand back a value, but a streaming endpoint — one that writes its own file or feed directly to the connection, the natural shape for a binary download — could deliver the good before the settlement step ran, handing it over for free. No live endpoint did this, but it was a latent trap for the next one built. The payment wrapper now refuses to complete such a response silently: a streaming route must opt in explicitly, and when it does, the wrapper settles the payment first and only then lets the download start. Any endpoint that tried to send its body early is now caught and flagged instead of leaking the good. `[security]`- **Paid endpoints are fully discoverable by payment crawlers again** — Agent-payment directories like AgentCash and x402scan discover a paid API by reading its 402 'payment required' challenge and checking that each endpoint declares what it takes in and what it returns. three.ws sends that challenge two ways — a complete JSON body and a compact copy in a response header — and crawlers read the header. To stay under strict header-size limits, the header copy had been dropping its entire discovery block on richer endpoints, so those endpoints looked schema-less to crawlers even though the full body was correct. The header now keeps the discovery block, shrinking only the parts a crawler doesn't need (and falling back to a compact placeholder schema for the largest endpoints) so every paid route advertises its input and output shape while the header stays small. All 21 paid endpoints now pass AgentCash's discovery validator cleanly. (`/openapi.json`) `[improvement, infra]`- **Paid endpoints now confirm a payment can settle before doing the work** — The in-house payment facilitator that verifies agent-to-agent USDC payments used to check only that a payment was correctly formed — the right amount, token, and recipient — but not that the buyer's account actually held the funds. Because paid endpoints run the requested work first and settle the payment afterward, a payment signed from an empty account could pass the check, trigger real (and sometimes costly) work like an AI generation, and only then fail to settle — leaving the platform to absorb the cost. Verification now simulates the payment on-chain, and falls back to a direct balance check if that's briefly unavailable, so a payment that can't settle is rejected before any work runs. Genuine, funded payments are unaffected. `[security]`+- **Robinhood Chain now on three.ws Markets — live stocks, coins, and a real buy flow** — A new /markets/robinhood hub covers Robinhood Chain end to end: a 24/7 tokenized-equity board with live Chainlink NAV vs. Uniswap DEX premium for every Stock Token, a memecoin screener across the NOXA and The Odyssey launchpads, recent on-chain launches, and chain stats. Every coin and Stock Token has its own detail page with a price chart, holders, recent transfers, and contract links. Coin pages carry a real buy flow — connect a wallet, switch to Robinhood Chain, get a live Uniswap v3 quote, and swap with your own slippage tolerance; wallets with no funds on the chain get a bridge link instead of a dead end. Stock Tokens stay display-only, since they are tokenized securities not offered to US persons. A new paid API endpoint returns a wallet's full Stock Token portfolio, corporate-action-adjusted and priced at live NAV. (`/markets/robinhood`) `[feature]`- **Seeker wallet signing fixed before it ever shipped** — Automated testing of the Solana Seeker app in an Android emulator against Solana Mobile's reference wallet caught four bugs in our Mobile Wallet Adapter integration: the app icon was sent in a format the wallet spec rejects, and message signing, transaction signing, and send-transaction all read the wallet's response in the wrong shape. All four are fixed — wallet connect was verified end to end, returning a real public key through the on-device signing flow. `[fix, security]`- **The autonomous coin launcher learned taste** — The Memetic Launcher's picks got a full quality overhaul. Its cultural radar was half-blind — the pump.fun intel feed was silenced by a miscalibrated quality bar and generic sector words like 'meme' drowned out actual memes — so most picks fell back to random word-salad names. Now the radar reads live meme culture properly (Know Your Meme, Google Trends, Hacker News, Wikipedia attention, and pump.fun's own breakout data), each launch rides a specific rising narrative, the launcher remembers its recent picks so it never re-mints the same joke, coin descriptions are no longer cut off mid-sentence, and a quality gate refuses to spend real SOL on a filler pick when no genuine signal exists. Launch previews in the user launcher now refresh hourly instead of every minute. (`/launcher`) `[improvement, fix]`- **The in-house payment settler is now flood-protected** — three.ws settles agent payments through its own self-hosted facilitator instead of a third party. Every settlement is co-signed and broadcast by a platform sponsor wallet that pays the tiny network fee — which meant anyone could, in principle, spam it with valid but negligible transfers to burn that wallet's balance down and stall the paid economy until a human topped it up. The settler now caps how many settle/verify calls it will handle per source and in total, and refuses to settle amounts too small to cover their own network fee, so a settlement can never cost the platform more than it moves. Legitimate agent payments are unaffected. `[security, infra]`diff --git a/STRUCTURE.md b/STRUCTURE.mdindex 072a55265..2f258332e 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -88,6 +88,7 @@ bottom.| Market surfaces III (protocol/chain/stablecoin detail + fees, DEX volumes, hacks, trending) | Detail pages `→ /protocol/:slug /chain/:name /stablecoin/:id` over [api/defi/protocol.js](api/defi/protocol.js), [api/defi/chain.js](api/defi/chain.js), [api/defi/stablecoin.js](api/defi/stablecoin.js); surfaces `→ /fees /dex-volumes /hacks` over [api/defi/](api/defi) (fees, dex-volumes, hacks over DeFiLlama) + `→ /markets/trending` over [api/coin/trending.js](api/coin/trending.js) (CoinGecko /search/trending); list rows in [src/defi.js](src/defi.js), [src/chains.js](src/chains.js), [src/stablecoins.js](src/stablecoins.js) now deep-link into the detail pages | In-repo | Turns the DeFiLlama list pages into full detail experiences: a protocol page (TVL history + hallmark markers, per-chain breakdown, fees/revenue, funding rounds, methodology), a chain page (TVL + stablecoin + DEX-volume charts, top protocols), a stablecoin page (supply history, per-chain distribution, peg-deviation badge). Plus three new market surfaces — protocol fees & revenue, the DEX-volume leaderboard, and a searchable DeFi hacks database ($16.7B all-time) — and a CoinGecko trending page (most-searched coins/categories/NFTs). All real key-free data, cross-linked. Docs: [docs/coin-pages.md](docs/coin-pages.md) || Market detail pages (exchange, category) + DeFi yields | [pages/exchange.html](pages/exchange.html) + [src/exchange-page.js](src/exchange-page.js) `→ /exchange/:id` over [api/coin/exchange.js](api/coin/exchange.js), [pages/category.html](pages/category.html) + [src/category-page.js](src/category-page.js) `→ /category/:id` over [api/coin/category.js](api/coin/category.js) + [api/coin/markets.js](api/coin/markets.js) (`?category=`), [pages/yields.html](pages/yields.html) + [src/yields.js](src/yields.js) `→ /yields` over [api/defi/yields.js](api/defi/yields.js) | In-repo | Rich detail pages that turn list rows into full profiles. Exchange: trust badge, normalized-volume stat, BTC-volume history chart, and a per-pair markets table (spot + derivatives fallback), reached from `/exchanges` and the new Derivatives Exchanges table. Category: rank, sector stats, the full sortable coins table for that sector, and related categories, reached from `/categories`. Yields: an explorer over ~15k live DeFiLlama pools with chain/project/stablecoin/min-TVL filters, APY/TVL sort, URL-synced state, and a per-pool APY+TVL history chart on row expand. Docs: [docs/coin-pages.md](docs/coin-pages.md) || Crypto news + archive + markets hub | [pages/markets.html](pages/markets.html) + [src/markets-page.js](src/markets-page.js) `→ /markets`, [pages/markets-news.html](pages/markets-news.html) + [src/markets-news.js](src/markets-news.js) `→ /markets/news`, [pages/news-article.html](pages/news-article.html) + [src/news-article.js](src/news-article.js) `→ /markets/news/article`, [pages/news-archive.html](pages/news-archive.html) + [src/news-archive.js](src/news-archive.js) `→ /markets/archive`, [pages/news-digest.html](pages/news-digest.html) + [src/news-digest.js](src/news-digest.js) `→ /markets/digest`; backend [api/news/](api/news) (feed, article, knowledge, archive, digest, rss, image) over [api/_lib/article-extract.js](api/_lib/article-extract.js) (page→reader→feed→preview ladder), [api/_lib/news-coins.js](api/_lib/news-coins.js) (ticker→live market snapshot), [api/_lib/news-knowledge-store.js](api/_lib/news-knowledge-store.js) (durable `news_knowledge` corpus) + hourly archiver [api/cron/news-archive-append.js](api/cron/news-archive-append.js) over [api/_lib/news.js](api/_lib/news.js) + [api/_lib/news-sources.js](api/_lib/news-sources.js), corpus on `gs://three-ws-news-archive` | In-repo | The Markets news wing + front door: /markets/news is “Your briefing” — live news aggregated natively from 192 publisher feeds (Featured/Trending/Saved tabs, breaking ticker, AI briefing card, top-stories hero + rail, search, sentiment, ticker chips, og:image preview resolution for imageless feeds), a rich article reader that recovers the **full story** even from Cloudflare-blocked publishers (page→reader-service→feed→preview ladder), renders **live coin cards** (price/24h/7d/sparkline→/coin/:id) for detected tickers, AI summary/key points/entities with extractive fallback, and related coverage — and records every fully-read story to a durable **news knowledge base** (`GET /api/news/knowledge`) that grounds the 3D agents. Plus the largest open crypto-news archive (662,047 enriched articles, Sept 2017 → today, EN+中文, GCS-hosted) and the /markets hub aggregating global stats, the top-100 table, breaking news, and every market surface as a hero card. Docs: [docs/coin-pages.md](docs/coin-pages.md), [docs/api-reference.md](docs/api-reference.md) |+| Robinhood Chain markets + buy flow | Hub + detail pages [pages/markets-robinhood.html](pages/markets-robinhood.html) + [src/markets-robinhood.js](src/markets-robinhood.js) `→ /markets/robinhood`, [pages/robinhood-stock.html](pages/robinhood-stock.html) + [src/robinhood-stock.js](src/robinhood-stock.js) `→ /markets/robinhood/stock/:symbol`, [pages/robinhood-coin.html](pages/robinhood-coin.html) + [src/robinhood-coin.js](src/robinhood-coin.js) `→ /markets/robinhood/coin/:address`, buy flow [src/robinhood-purchase.js](src/robinhood-purchase.js); backend [api/_lib/robinhood.js](api/_lib/robinhood.js) + `api/v1/robinhood/{chain,stocks,stocks-detail,coins,coins-detail,launches}.js` (free) + [api/v1/robinhood/portfolio.js](api/v1/robinhood/portfolio.js) (x402 paid) | In-repo | The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs. Uniswap DEX premium for every Stock Token (one multicall, never 95 RPC calls), a memecoin screener across NOXA/The Odyssey launchpads (CoinGecko categories + on-chain launch logs via Blockscout), and chain TVL/gas/block stats. Detail pages add NAV history, holders, transfers, and contract links. Coin pages carry a real buy panel — injected-wallet connect, chain-switch to 4663, live Uniswap v3 `QuoterV2` quote + `SwapRouter02` swap with slippage, LI.FI bridge deep-link; Stock Tokens are display-only (tokenized securities, not offered to US persons) with an eligibility-gated outbound DEX link instead. Paid `portfolio` endpoint returns ERC-8056 `uiMultiplier`-correct holdings. Docs: [docs/robinhood-chain-markets.md](docs/robinhood-chain-markets.md) || Premium Data API pass | [api/premium/](api/premium) + [api/_lib/premium.js](api/_lib/premium.js), dashboards [src/dashboard-next/pages/data-api.js](src/dashboard-next/pages/data-api.js) `→ /dashboard/data-api` + [src/dashboard-next/pages/billing.js](src/dashboard-next/pages/billing.js) `→ /dashboard/billing` | In-repo | Monthly pass ($9.99/30d) paid on Solana in $THREE (20% off), SOL, or USDC — replaces per-call x402 on the news archive with an `x402_live_` API key (existing access-control lane) + SIWX browser grants. Quote→sign→verify flow with on-chain balance-delta verification; tables `premium_passes`/`premium_quotes`. Docs: [docs/premium.md](docs/premium.md) || Liquidations pulse (/coins) | Collector [services/liquidation-collector/](services/liquidation-collector) (standalone always-on Node service, ported from SperaxOS), proxy [api/coin/liquidations.js](api/coin/liquidations.js) `→ GET /api/coin/liquidations`, UI strip in [src/coins-index.js](src/coins-index.js) `→ /coins` | Live — collector on Cloud Run (`liquidation-collector`, min-instances 1, unthrottled CPU) since 2026-07-10 | Real-time long/short liquidation pain across Binance, Bybit, and OKX public futures WebSocket streams: dominant-side badge (LONG PAIN / SHORT SQUEEZE / BALANCED), 1h long-vs-short bars, and the 3 largest recent liquidations, polled every 30s (pauses on hidden tab). The collector holds long-lived WebSockets so it can't run as a Vercel function — deploy it separately and point `LIQUIDATION_COLLECTOR_URL` at it. No fallback data: the proxy 503s `collector_offline` (never fabricated numbers) when unset or unreachable, and the strip degrades to a quiet single-line offline state. Docs: [docs/api-reference.md#liquidations](docs/api-reference.md#liquidations) || BNB Chain campaign hub | [pages/bnb.html](pages/bnb.html) + [src/bnb.js](src/bnb.js) `→ /bnb`, pure helpers [src/bnb-hub-helpers.js](src/bnb-hub-helpers.js), live block-time API [api/bnb/block-time.js](api/bnb/block-time.js) over [api/_lib/bnb/chains.js](api/_lib/bnb/chains.js) `probeBlockTime` | In-repo · hub live, tracks rolling out | The campaign's front door: three feature cards (gasless agent onboarding, on-chain-gated 3D vault, real-time on-chain world), each claim traced to `prompts/bnb-chain/00-CONTEXT.md`'s verified facts (0.45s blocks — never 20k TPS or 250ms finality). Embeds a live block-time widget (real RPC measurement on every load). Each card self-detects liveness via a real HTTP probe against its track's route/API on the running deployment — a 404 renders a designed "coming soon" state, never a dead link — so cards auto-light-up as the sibling tracks below ship: gasless registration `→ /create-agent` + `api/bnb/register-agent.js` (prompt 03), vault `→ /vault` (prompt 12), on-chain world `→ /bnb-latency` (prompt 17) + the Explore on-chain toggle (prompt 16). Campaign root: [prompts/bnb-chain/](prompts/bnb-chain) |diff --git a/api/_lib/coin-communities.js b/api/_lib/coin-communities.jsindex 6590913f9..759ab6854 100644--- a/api/_lib/coin-communities.js+++ b/api/_lib/coin-communities.js@@ -18,6 +18,11 @@ import { normalizeGatewayURL } from '../../src/ipfs.js';// Solana mint addresses — base58, 32–44 chars. Communities are keyed by these.const BASE58_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;+// EVM addresses (Ethereum/Base/BSC/Robinhood Chain, etc.) — the CHAINS list in+// api/community/messages.js already names these as supported chain ids; this+// gate previously only accepted Solana, so every EVM-chain world's Town chat+// 400'd before the request ever reached CoinCommunities.+const EVM_RE = /^0x[a-fA-F0-9]{40}$/;let _configured = false;@@ -49,7 +54,7 @@ export function canPostServer() {/** Validate a community token address before it ever reaches the API. */export function isValidToken(token) {- return typeof token === 'string' && BASE58_RE.test(token);+ return typeof token === 'string' && (BASE58_RE.test(token) || EVM_RE.test(token));}class UnconfiguredError extends Error {diff --git a/api/_lib/service-catalog/services/robinhood-portfolio.js b/api/_lib/service-catalog/services/robinhood-portfolio.jsindex 0211a1043..dfb83479a 100644--- a/api/_lib/service-catalog/services/robinhood-portfolio.js+++ b/api/_lib/service-catalog/services/robinhood-portfolio.js@@ -35,5 +35,22 @@ export default {address: { type: 'string', description: 'EVM wallet address to value (0x…40 hex chars).' },},},+ outputExample: {+ owner: '0x9701fb0aDe1E269c8f64Ec0C7b3cfADB31A13A52',+ positions: [+ {+ symbol: 'AAPL',+ name: 'Apple • Robinhood Token',+ address: '0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9',+ rawBalance: '1000000000000000000',+ uiMultiplier: '1000000000000000000',+ shares: 1,+ navPriceUsd: 315.5,+ valueUsd: 315.5,+ },+ ],+ totalValueUsd: 315.5,+ positionCount: 1,+ },storefronts: ['x402scan'],};diff --git a/api/_lib/x402/ring-catalog.js b/api/_lib/x402/ring-catalog.jsindex 227abe018..03707005a 100644--- a/api/_lib/x402/ring-catalog.js+++ b/api/_lib/x402/ring-catalog.js@@ -1174,6 +1174,25 @@ export const RING_CATALOG = [businessEffect: 'Generates a real GPU-derived remix of a published creation, records parent→child provenance, and routes a real on-chain USDC royalty to the source creator.',note: 'autobuy:false — every call is a real GPU generation plus a possible real on-chain USDC royalty transfer to a third-party creator wallet; requires a live, published remixable source creation id (the canary UUID resolves to source_not_found). Verify once against a known published remixable source.',},++ // ── Robinhood Chain — market data ────────────────────────────────────────+ {+ slug: 'robinhood-portfolio',+ sourceFile: 'api/v1/robinhood/portfolio.js',+ path: '/api/v1/robinhood/portfolio',+ method: 'GET',+ query: { address: '0x0000000000000000000000000000000000000000' },+ body: NO_BODY,+ priceAtomicDefault: 2_000,+ priceSlug: 'robinhood-portfolio',+ tier: 'intel',+ kind: 'intel',+ network: null,+ autobuy: false,+ weight: 0,+ businessEffect: 'Reads a wallet\'s multiplier-correct Robinhood Chain Stock Token portfolio via on-chain multicall, priced at live Chainlink NAV (read-only, no state change).',+ note: 'autobuy:false — the canary (zero address) always succeeds but fans out one multicall of ~95 balanceOf reads against the public Robinhood Chain RPC per call; rotating it hourly adds avoidable RPC load for a brand-new, low-traffic endpoint. One-time settle proof via the coverage sweep.',+ },];// ── selectors ─────────────────────────────────────────────────────────────────diff --git a/api/v1/_catalog.js b/api/v1/_catalog.jsindex d1febd805..e552d88bc 100644--- a/api/v1/_catalog.js+++ b/api/v1/_catalog.js@@ -177,6 +177,77 @@ export const CATALOG = [chain: 'string — "ethereum" | "solana", optional hint validated against address (auto-detected from format when omitted)',},},+ {+ id: 'v1.robinhood.chain',+ method: 'GET',+ path: '/api/v1/robinhood/chain',+ auth: 'public',+ summary:+ 'Robinhood Chain (4663) stats: block height, gas, tx/address counts, and chain TVL ' ++ '(now + 90-day history). Free, keyless, real data from Blockscout + DefiLlama; 60/min per IP.',+ params: {},+ },+ {+ id: 'v1.robinhood.stocks',+ method: 'GET',+ path: '/api/v1/robinhood/stocks',+ auth: 'public',+ summary:+ 'The 24/7 Robinhood Chain tokenized-equity board: live Chainlink NAV vs. deepest Uniswap ' ++ 'DEX price, premium/discount, uiMultiplier, 24h volume, and liquidity for every Stock ' ++ 'Token — one on-chain multicall, never 95 RPC calls. Free, keyless; 60/min per IP.',+ params: {+ q: 'string — filter by symbol or name substring (optional)',+ sort: 'string — "symbol" | "volume" | "premium" | "liquidity" (default symbol)',+ dir: 'string — "asc" | "desc" (default desc, ignored for symbol)',+ },+ },+ {+ id: 'v1.robinhood.stocks-detail',+ method: 'GET',+ path: '/api/v1/robinhood/stocks-detail',+ auth: 'public',+ summary:+ 'One Robinhood Chain Stock Token in depth: Chainlink NAV + recent round history, every ' ++ 'DEX pair, premium/discount, holders, recent transfers, and contract links. Display-only ' ++ '— carries the US-persons eligibility disclosure. Free, keyless; 60/min per IP.',+ params: { symbol: 'string — Stock Token ticker, e.g. "AAPL" (required)' },+ },+ {+ id: 'v1.robinhood.coins',+ method: 'GET',+ path: '/api/v1/robinhood/coins',+ auth: 'public',+ summary:+ 'Robinhood Chain memecoin screener (NOXA + The Odyssey launchpads) via CoinGecko ' ++ 'categories: price, market cap, 24h/7d change, 7d sparkline. Free, keyless; 60/min per IP.',+ params: {+ category: 'string — "meme" | "stocks-ecosystem" | "ecosystem" (default meme)',+ sort: 'string — "market_cap" | "volume" | "gainers" | "losers" (default market_cap)',+ },+ },+ {+ id: 'v1.robinhood.coins-detail',+ method: 'GET',+ path: '/api/v1/robinhood/coins-detail',+ auth: 'public',+ summary:+ 'One Robinhood Chain coin in depth: DexScreener market data (price, mcap, FDV, ' ++ 'liquidity, volume, pools) + Blockscout holders/transfers/contract links. Non-security ' ++ 'token, no eligibility gate. Free, keyless; 60/min per IP.',+ params: { address: 'string — 0x… token contract address (required)' },+ },+ {+ id: 'v1.robinhood.launches',+ method: 'GET',+ path: '/api/v1/robinhood/launches',+ auth: 'public',+ summary:+ 'Recent Robinhood Chain launchpad activity (NOXA instant + The Odyssey bonding-curve), ' ++ 'read from on-chain logs and enriched with DexScreener market data, newest first. ' ++ 'Free, keyless; 60/min per IP.',+ params: { limit: 'number 1–60 (default 40)' },+ },{id: 'v1.pump.search',method: 'GET',diff --git a/data/changelog.json b/data/changelog.jsonindex 564bf4e16..616149ed2 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-12",+ "title": "Robinhood Chain now on three.ws Markets — live stocks, coins, and a real buy flow",+ "summary": "A new /markets/robinhood hub covers Robinhood Chain end to end: a 24/7 tokenized-equity board with live Chainlink NAV vs. Uniswap DEX premium for every Stock Token, a memecoin screener across the NOXA and The Odyssey launchpads, recent on-chain launches, and chain stats. Every coin and Stock Token has its own detail page with a price chart, holders, recent transfers, and contract links. Coin pages carry a real buy flow — connect a wallet, switch to Robinhood Chain, get a live Uniswap v3 quote, and swap with your own slippage tolerance; wallets with no funds on the chain get a bridge link instead of a dead end. Stock Tokens stay display-only, since they are tokenized securities not offered to US persons. A new paid API endpoint returns a wallet's full Stock Token portfolio, corporate-action-adjusted and priced at live NAV.",+ "tags": [+ "feature"+ ],+ "link": "/markets/robinhood"+ },{"date": "2026-07-12","title": "News stories now open the full article, with live coin charts",diff --git a/data/pages.json b/data/pages.jsonindex 204a59d31..d38ea6007 100644--- a/data/pages.json+++ b/data/pages.json@@ -1590,6 +1590,14 @@"changefreq": "hourly","added": "2026-07-10"},+ {+ "path": "/markets/robinhood",+ "title": "Robinhood Chain",+ "description": "The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.",+ "priority": 0.7,+ "changefreq": "hourly",+ "added": "2026-07-12"+ },{"path": "/markets/news","title": "Crypto News",diff --git a/docs/robinhood-chain-markets.md b/docs/robinhood-chain-markets.mdnew file mode 100644index 000000000..f709c8537--- /dev/null+++ b/docs/robinhood-chain-markets.md@@ -0,0 +1,94 @@+# Robinhood Chain on three.ws++`/markets/robinhood` is three.ws's home for [Robinhood Chain](https://docs.robinhood.com/chain/) —+a permissionless Arbitrum Orbit L2 (chain ID `4663`, settles to Ethereum, ETH gas, ~100ms blocks)+that hosts ~95 tokenized US equities ("Stock Tokens") trading 24/7 alongside a live memecoin+ecosystem. Nothing else offers a clean market-data view of it: GeckoTerminal doesn't index the+chain, and general aggregators have no equity semantics (Chainlink NAV vs. DEX price, corporate+actions). This page — and the API behind it — is that missing layer.++## What's on the page++**`/markets/robinhood`** has three tabs:++- **Stocks** — the 24/7 tokenized-equity board. For every Stock Token: the Chainlink NAV price+ (read live on-chain), the deepest Uniswap DEX price, the premium/discount between them, 24h DEX+ volume, and liquidity. Sortable and searchable.+- **Coins** — a memecoin screener across the chain's two launchpads (**NOXA**, an instant+ Uniswap v3 launcher, and **The Odyssey**, a pump.fun-style bonding curve), split into CoinGecko's+ "Robinhood Chain Meme" / "Robinhood Chain Stocks Ecosystem" / "Robinhood Ecosystem" categories,+ plus a live feed of recent launches read directly from on-chain logs.+- **Chain** — block height, gas, transaction/address counts, and 90 days of chain TVL (DefiLlama).++Every coin and Stock Token links to its own detail page —+`/markets/robinhood/stock/:symbol` (e.g. `/markets/robinhood/stock/AAPL`) and+`/markets/robinhood/coin/:address` — with a price history chart, a full stats grid, holders,+recent transfers, and contract links (Blockscout).++## The buy flow++Coin detail pages carry a real buy panel: connect an injected EVM wallet (MetaMask etc.), switch+to Robinhood Chain (4663) via `wallet_switchEthereumChain` (falling back to+`wallet_addEthereumChain` if the wallet has never seen the chain), get a live Uniswap v3 quote from+`QuoterV2` across all four fee tiers, and swap through `SwapRouter02`'s `exactInputSingle` with a+user-set slippage tolerance. Wallets with no ETH on 4663 yet get a bridge deep-link+([LI.FI](https://jumper.exchange/)) instead of a dead end.++**Stock Tokens are display-only.** They're tokenized debt securities issued by Robinhood Assets+(Jersey) Ltd and may not be offered, sold, or delivered to US persons (additional limits: Canada,+UK, Switzerland) — a legal restriction enforced at front-ends, not the contract level. Their detail+page carries the disclosure and an outbound "Trade on DEX" link instead of an in-house swap; the+buy path is cleanly ready to enable once an operator affirms eligibility (swap+`mountStockEligibilityGate` for `mountBuyPanel` in `src/robinhood-stock.js` — no other wiring+changes).++## API — `/api/v1/robinhood/*`++Free, keyless, real data only:++| Endpoint | Returns |+| --- | --- |+| `GET /api/v1/robinhood/chain` | Block height, gas, tx/address counts, chain TVL + 90-day history |+| `GET /api/v1/robinhood/stocks` | Every Stock Token: NAV, DEX price, premium, volume, liquidity (`?q=`, `?sort=`) |+| `GET /api/v1/robinhood/stocks-detail?symbol=AAPL` | One Stock Token in depth: NAV history, all DEX pairs, holders, transfers, links |+| `GET /api/v1/robinhood/coins?category=meme` | Memecoin screener (`category`: `meme` \| `stocks-ecosystem` \| `ecosystem`; `sort`: `market_cap` \| `volume` \| `gainers` \| `losers`) |+| `GET /api/v1/robinhood/coins-detail?address=0x…` | One coin: pools, market stats, holders, transfers, links |+| `GET /api/v1/robinhood/launches` | Recent launches from NOXA + The Odyssey, newest first |++Paid via x402 ($0.002 USDC, Base or Solana):++| Endpoint | Returns |+| --- | --- |+| `GET /api/v1/robinhood/portfolio?address=0x…` | Multiplier-correct Stock Token portfolio: every held symbol's true position (raw balance × ERC-8056 `uiMultiplier`) priced at the live Chainlink NAV, plus a total USD value |++Every response carries `source` and `asOf` fields. A miss is a structured error, never a bare 500.++### Why the multiplier matters++Stock Tokens implement **ERC-8056** (`uiMultiplier()`): corporate actions (splits, dividends) are+applied by adjusting the multiplier, not by rebasing balances. `raw balance × uiMultiplier / 1e18+= true position` — reading the raw ERC-20 balance alone misstates a holding after any corporate+action. The portfolio endpoint (and the stocks board's `uiMultiplier` column) always does this+math; Chainlink feed prices are already multiplier-adjusted, so they're never re-multiplied.++## Data sources++- **Chainlink NAV** — read live on-chain via one multicall across every feed-backed Stock Token+ (`latestRoundData` + `uiMultiplier` + `totalSupply`), cached 20s. Never 95 separate RPC calls.+- **DEX price / liquidity / volume** — [DexScreener](https://dexscreener.com) (`chainId: "robinhood"`),+ batched 30 addresses per call for the board.+- **Holders, transfers, token stats, chain stats** — [Blockscout](https://robinhoodchain.blockscout.com) Pro API.+- **Chain TVL** — [DefiLlama](https://defillama.com/chain/robinhood-chain).+- **Memecoin screener** — CoinGecko categories `robinhood-chain-meme`, `robinhood-chain-stocks-ecosystem`, `robinhood-ecosystem`.+- **Recent launches** — decoded on-chain logs from the NOXA and Odyssey launchpad factories+ (Blockscout's log API, filtered by event topic — the public RPC's `eth_getLogs` caps at 10k+ matched logs and can't reliably answer "what's newest").++## Related surfaces++- [Market Data API](./market-data-api.md) — the same paid-endpoint pattern (x402, `priceFor`,+ service-catalog descriptor) applied to the rest of three.ws's market data.+- [Trust primitives](./trust-primitives.md) — score a Robinhood Chain wallet's cross-chain+ reputation before transacting with it.+- [x402 distribution](./x402-distribution.md) — how the paid portfolio endpoint gets discovered+ across the x402 ecosystem.diff --git a/docs/start-here.md b/docs/start-here.mdindex 0b5f88a8d..65a4813c6 100644--- a/docs/start-here.md+++ b/docs/start-here.md@@ -72,6 +72,7 @@ If you're here to create and share agents rather than write code, follow this pa- **Vetting a counterparty before you pay it?** → [Trust primitives](./trust-primitives.md) — the cross-chain Agent Reputation endpoint scores ANY wallet, mint, or agent id (Solana or EVM) 0–100 from real on-chain evidence, in one paid call, before your agent transacts- **Wondering where the platform's money goes?** → [The autonomous economy](./autonomous-economy.md) — how the on-chain treasury funds itself, the funding-root → engines → sweepback loop, the locks that keep every dollar inside platform-owned wallets, and the two leak scanners that audit every wallet on-chain every minute (so far: 44,122 transactions scanned, zero leaks)- **Your agent needs market data?** → [Market Data API](./market-data-api.md) — the live feeds behind every /markets page (prices, TVL, yields, stablecoins, gas, derivatives, exploits) as 17 pay-per-call x402 endpoints from $0.001 USDC, plus the one-call `market-pulse` bundle; start at the free index [/api/x402/market](https://three.ws/api/x402/market)+- **Trading Robinhood Chain?** → [Robinhood Chain on three.ws](./robinhood-chain-markets.md) — the 24/7 tokenized-equity board (live Chainlink NAV vs. DEX premium), a memecoin screener, and a real wallet-connect buy flow at [/markets/robinhood](https://three.ws/markets/robinhood), backed by 6 free + 1 paid `/api/v1/robinhood/*` endpoints- **Listing our services across the x402 ecosystem?** → [x402 distribution](./x402-distribution.md) — the operating playbook for x402scan, the CDP Bazaar, agentic.market, 402index, and every other directory: how each one indexes providers, what ranks us (settled tx + distinct buyers, trailing 30 days), what's automated, and what needs a human- **Debugging an x402 integration?** → [x402 developer tools](./x402-dev-tools.md) — a free test bench: echo your payment envelope (signatures redacted), debug a failed 402 exchange into an ordered fix list, and verify a receipt's attestation and on-chain settlement, all against a live server without spending anything- **Paying from the BNB ecosystem?** → [BNB Chain payments](./bnb-payments.md) — three.ws speaks MPP (BNB's Machine Payments Protocol) as well as x402, so agents can pay our endpoints on BNB Chain and our agents can pay theirs; covers the buyer/seller flow, the x402↔MPP bridge spec, and MegaFuel gasless (zero-gas) sends with an honest self-pay fallbackdiff --git a/public/changelog.json b/public/changelog.jsonindex eaee11d59..61d194729 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-12T13:35:49.974Z",+ "generated_at": "2026-07-12T13:39:31.151Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -16,6 +16,16 @@"launch"]},+ {+ "date": "2026-07-12",+ "type": "launch",+ "title": "Robinhood Chain",+ "summary": "The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.",+ "link": "/markets/robinhood",+ "tags": [+ "launch"+ ]+ },{"date": "2026-07-12","type": "update",@@ -153,6 +163,16 @@"security"]},+ {+ "date": "2026-07-12",+ "type": "update",+ "title": "Robinhood Chain now on three.ws Markets — live stocks, coins, and a real buy flow",+ "summary": "A new /markets/robinhood hub covers Robinhood Chain end to end: a 24/7 tokenized-equity board with live Chainlink NAV vs. Uniswap DEX premium for every Stock Token, a memecoin screener across the NOXA and The Odyssey launchpads, recent on-chain launches, and chain stats. Every coin and Stock Token has its own detail page with a price chart, holders, recent transfers, and contract links. Coin pages carry a real buy flow — connect a wallet, switch to Robinhood Chain, get a live Uniswap v3 quote, and swap with your own slippage tolerance; wallets with no funds on the chain get a bridge link instead of a dead end. Stock Tokens stay display-only, since they are tokenized securities not offered to US persons. A new paid API endpoint returns a wallet's full Stock Token portfolio, corporate-action-adjusted and priced at live NAV.",+ "link": "/markets/robinhood",+ "tags": [+ "feature"+ ]+ },{"date": "2026-07-12","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex dbaae541e..0b81fb214 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -14,6 +14,14 @@<category>launch</category><description>How the three.ws on-chain treasury funds itself and where every dollar flows: the funding-root and engine wallets, the topup/sweepback loop, the allowlist- and destination-locks that keep money inside platform-owned wallets, and the two leak scanners that audit every signer wallet on-chain every minute — plus how to verify there's no leak yourself.</description></item>+ <item>+ <title>Robinhood Chain</title>+ <link>https://three.ws/markets/robinhood</link>+ <guid isPermaLink="false">2026-07-12:Robinhood Chain</guid>+ <pubDate>Sun, 12 Jul 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.</description>+ </item><item><title>Agent discovery fixed: six paid endpoints were invisible to x402 scanners</title><link>https://three.ws/openapi.json</link>@@ -118,6 +126,14 @@<category>security</category><description>The in-house payment facilitator that verifies agent-to-agent USDC payments used to check only that a payment was correctly formed — the right amount, token, and recipient — but not that the buyer's account actually held the funds. Because paid endpoints run the requested work first and settle the payment afterward, a payment signed from an empty account could pass the check, trigger real (and sometimes costly) work like an AI generation, and only then fail to settle — leaving the platform to absorb the cost. Verification now simulates the payment on-chain, and falls back to a direct balance check if that's briefly unavailable, so a payment that can't settle is rejected before any work runs. Genuine, funded payments are unaffected.</description></item>+ <item>+ <title>Robinhood Chain now on three.ws Markets — live stocks, coins, and a real buy flow</title>+ <link>https://three.ws/markets/robinhood</link>+ <guid isPermaLink="false">2026-07-12:Robinhood Chain now on three.ws Markets — live stocks, coins, and a real buy flow</guid>+ <pubDate>Sun, 12 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A new /markets/robinhood hub covers Robinhood Chain end to end: a 24/7 tokenized-equity board with live Chainlink NAV vs. Uniswap DEX premium for every Stock Token, a memecoin screener across the NOXA and The Odyssey launchpads, recent on-chain launches, and chain stats. Every coin and Stock Token has its own detail page with a price chart, holders, recent transfers, and contract links. Coin pages carry a real buy flow — connect a wallet, switch to Robinhood Chain, get a live Uniswap v3 quote, and swap with your own slippage tolerance; wallets with no funds on the chain get a bridge link instead of a dead end. Stock Tokens stay display-only, since they are tokenized securities not offered to US persons. A new paid API endpoint returns a wallet's full Stock Token portfolio, corporate-action-adjusted and priced at live NAV.</description>+ </item><item><title>Seeker wallet signing fixed before it ever shipped</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex 60cdcf3e9..3173d4960 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-12T13:35:49.953Z",+ "generated_at": "2026-07-12T13:39:31.135Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",@@ -1946,6 +1946,16 @@"tags": [],"showcase": false},+ {+ "path": "/markets/robinhood",+ "title": "Robinhood Chain",+ "description": "The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.",+ "added": "2026-07-12",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false+ },{"path": "/markets/news","title": "Crypto News",diff --git a/public/llms-full.txt b/public/llms-full.txtindex afe5a95de..d7c94a4e7 100644--- a/public/llms-full.txt+++ b/public/llms-full.txt@@ -1180,6 +1180,12 @@ URL: https://three.ws/marketsThe three.ws markets hub — live global stats, the top 100 coins, breaking crypto news from 192 publisher feeds, a 662k-article news archive, and hero links to the full markets toolset.+### Robinhood Chain++URL: https://three.ws/markets/robinhood++The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.+### Crypto NewsURL: https://three.ws/markets/newsdiff --git a/public/llms.txt b/public/llms.txtindex 2f5c2f8cd..6ba85ca5f 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -212,6 +212,7 @@ On-chain features: pay-per-call, token launches, vanity wallets.- [Hero Stage](https://three.ws/hero-demo): A cinematic 3D hero stage for three.ws agents — a lit avatar centered in deep space over concentric glowing rings, a drifting starfield, and soft bloom, with pointer parallax and a live avatar switcher. Motion-safe.- [EVM Vanity Wallet](https://three.ws/evm-wallet): Grind a custom Ethereum / EVM wallet address with the prefix or suffix of your choice. A real secp256k1 keypair, generated entirely in your browser — the private key never leaves your device.- [Markets Hub](https://three.ws/markets): The three.ws markets hub — live global stats, the top 100 coins, breaking crypto news from 192 publisher feeds, a 662k-article news archive, and hero links to the full markets toolset.+- [Robinhood Chain](https://three.ws/markets/robinhood): The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.- [Crypto News](https://three.ws/markets/news): Live crypto news aggregated natively from 192 publisher feeds in 18 languages — filter by category (Bitcoin, DeFi, security, regulation, and more), pick a language, search headlines, and open any story in a rich reader with summary, key points, sentiment, and related coverage.- [Crypto News Reader](https://three.ws/markets/news/article): Rich article reader for crypto news — full story extraction with AI summary, key points, sentiment, detected tickers, and related coverage from across the industry.- [Crypto News Archive](https://three.ws/markets/archive): The largest open crypto-news archive: 660,000+ articles from September 2017 to today, refreshed hourly from the live feed, in English and Chinese — searchable by keyword, ticker, source, sentiment, date, and language.diff --git a/public/nav-data.js b/public/nav-data.jsindex 7bc377c25..4e3dd28b7 100644--- a/public/nav-data.js+++ b/public/nav-data.js@@ -332,6 +332,11 @@ export const NAV_GROUPS = [href: '/markets',desc: 'Global stats, the top 100 coins, live news, and every market tool in one place',},+ {+ title: 'Robinhood Chain',+ href: '/markets/robinhood',+ desc: 'Live Stock Token NAV vs DEX premium, a memecoin screener, and a real buy flow',+ },{title: 'Crypto News',href: '/markets/news',diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex 9c61d283c..15eef721e 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -56,25 +56,6 @@.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }.sm-brand:hover { text-decoration: none; }</style>-- <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">- <meta property="og:type" content="website">- <meta property="og:site_name" content="three.ws">- <meta property="og:locale" content="en_US">- <meta property="og:title" content="Sitemap · three.ws">- <meta property="og:description" content="Human-readable index of every page on three.ws.">- <meta property="og:url" content="https://three.ws/sitemap">- <meta property="og:image" content="https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap">- <meta property="og:image:width" content="1200">- <meta property="og:image:height" content="630">- <meta property="og:image:type" content="image/png">- <meta property="og:image:alt" content="Sitemap — three.ws">- <meta name="twitter:card" content="summary_large_image">- <meta name="twitter:site" content="@trythreews">- <meta name="twitter:title" content="Sitemap · three.ws">- <meta name="twitter:description" content="Human-readable index of every page on three.ws.">- <meta name="twitter:image" content="https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap">- <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script></head><body><header class="sm-topbar">@@ -84,7 +65,7 @@<main class="sm-wrap"><div class="sm-hero"><h1>Sitemap</h1>- <p>All 424 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <p>All 425 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p><div class="sm-formats"><a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a><a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>@@ -96,7 +77,7 @@</div><div class="sm-filter"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>- <input id="sm-filter-input" type="search" placeholder="Filter 424 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />+ <input id="sm-filter-input" type="search" placeholder="Filter 425 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" /><kbd aria-hidden="true">/</kbd></div><p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>@@ -737,7 +718,7 @@<section class="sm-section" id="crypto"><header>- <h2>Crypto<span class="sm-count" data-count>110</span></h2>+ <h2>Crypto<span class="sm-count" data-count>111</span></h2><p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p></header><ul class="sm-list">@@ -1483,6 +1464,13 @@<span class="sm-desc">The three.ws markets hub — live global stats, the top 100 coins, breaking crypto news from 192 publisher feeds, a 662k-article news archive, and hero links to the full markets toolset.</span></a></li>+ <li>+ <a href="/markets/robinhood">+ <span class="sm-title">Robinhood Chain</span>+ <span class="sm-path">/markets/robinhood</span>+ <span class="sm-desc">The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The Odyssey launchpads, recent launches, and chain TVL — plus a real wallet-connect buy flow for its coins.</span>+ </a>+ </li><li><a href="/markets/news"><span class="sm-title">Crypto News</span>diff --git a/robinhood/hood-api/docs/samples.js b/robinhood/hood-api/docs/samples.jsnew file mode 100644index 000000000..08b4d5bd4--- /dev/null+++ b/robinhood/hood-api/docs/samples.js@@ -0,0 +1,1693 @@+window.HOOD_API_SAMPLES = {+ "capturedAt": "2026-07-12T13:44:08.147Z",+ "health": {+ "status": 200,+ "body": {+ "status": "ok",+ "version": "0.1.0",+ "chainId": 4663,+ "rpcOk": true,+ "blockHeight": "7850302",+ "paymentsEnabled": true,+ "asOf": "2026-07-12T13:44:08.375Z"+ }+ },+ "chain": {+ "status": 200,+ "body": {+ "chainId": 4663,+ "network": "mainnet",+ "blockHeight": "7850302",+ "avgBlockTimeMs": 101,+ "gas": {+ "currentGwei": 0.051716,+ "slowGwei": 0.05,+ "averageGwei": 0.06,+ "fastGwei": 0.26+ },+ "ethPriceUsd": 1807.15,+ "tvlUsd": 130635631.14444755,+ "marketCapUsd": 218092334384.94617,+ "totalTransactions": "48538402",+ "transactionsToday": "10439032",+ "totalAddresses": "1312150",+ "networkUtilizationPct": 9.132633493891262e-8,+ "explorer": "https://robinhoodchain.blockscout.com",+ "asOf": "2026-07-12T13:44:08.639Z",+ "source": [+ "robinhood-chain-rpc",+ "blockscout",+ "defillama"+ ]+ }+ },+ "stocks": {+ "status": 200,+ "body": {+ "count": 95,+ "pricedCount": 34,+ "dexPricedCount": 73,+ "stocks": [+ {+ "symbol": "AAOI",+ "name": "Applied Optoelectronics • Robinhood Token",+ "address": "0x521Cf887E6531c6F667b5BC4D896E5d9bfE8EB2E",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 133.944719,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x078c1690865964838Ae346077046750846a552D1",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "AAPL",+ "name": "Apple • Robinhood Token",+ "address": "0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",+ "decimals": 18,+ "chainlinkPriceUsd": 315.5,+ "feedUpdatedAt": "2026-07-10T19:04:34.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2.1687599999999997e-14,+ "pool": "0x8bb3514e2204E1cDF3Ac149EFEe7Ff04D91B719f",+ "feeTier": 500,+ "hasFeed": true+ },+ {+ "symbol": "AMAT",+ "name": "Applied Materials • Robinhood Token",+ "address": "0x36046893810a7E7fCE501229d57dc3FC8c8716d0",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 616.834622,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.003998,+ "pool": "0xa255bAfB65F9c79047EC74814e456e53713C8Cb3",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "AMD",+ "name": "AMD • Robinhood Token",+ "address": "0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",+ "decimals": 18,+ "chainlinkPriceUsd": 558.21015,+ "feedUpdatedAt": "2026-07-10T19:55:46.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "AMZN",+ "name": "Amazon • Robinhood Token",+ "address": "0x12f190a9F9d7D37a250758b26824B97CE941bF54",+ "decimals": 18,+ "chainlinkPriceUsd": 245.5677,+ "feedUpdatedAt": "2026-07-10T14:01:43.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "APLD",+ "name": "Applied Digital • Robinhood Token",+ "address": "0xb8DBf92F9741c9ac1c32115E78581f23509916FD",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 39.688161,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.003578,+ "pool": "0x3B2ebc77D892CD02c913b9dA9A8354D7925F4C8c",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "ASML",+ "name": "ASML Holding NV • Robinhood Token",+ "address": "0x47F93d52cBeC7C6D2CfC080e154002370a60dAEA",+ "decimals": 18,+ "chainlinkPriceUsd": 1797.58755,+ "feedUpdatedAt": "2026-07-10T19:11:01.000Z",+ "dexPriceUsd": 1399.953441,+ "premiumDiscount": -0.2212043074063346,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.003636,+ "pool": "0xedb22516B14Eb2d1C86927Db373B0E8bF70F5cD1",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "ASTS",+ "name": "AST SpaceMobile • Robinhood Token",+ "address": "0x1AF6446f07eb1d97c546AFC8c9544cBDF3AD5137",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 64.06555,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xB4C19C79b22310B5fB70959C3490149638E7bd14",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "AVGO",+ "name": "Broadcom • Robinhood Token",+ "address": "0x156E175DD063a8cE274C50654eF40e0032b3fbcF",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 369.31726,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.004072,+ "pool": "0xC3DaBBED6574E1Ef93C9E3e68E4E30bA77CA38be",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "BA",+ "name": "Boeing • Robinhood Token",+ "address": "0x4D21483a44Bf67a86b77E3dA301411880797D452",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 211.903133,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xbf3904cAd0E63a4796CF806C21f2C1528B8eBE06",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "BABA",+ "name": "Alibaba • Robinhood Token",+ "address": "0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",+ "decimals": 18,+ "chainlinkPriceUsd": 112.195,+ "feedUpdatedAt": "2026-07-10T18:18:43.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "BE",+ "name": "Bloom Energy • Robinhood Token",+ "address": "0x822CC93fFD030293E9842c30BBD678F530701867",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": false+ },+ {+ "symbol": "CBRS",+ "name": "Cerebras Systems • Robinhood Token",+ "address": "0x5c90450Bbb4273D7b2f17CF6917AEB237A569679",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 166.902244,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xa887c160493C80b8cF2a847A0da103e8aA5FE8F9",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "CCL",+ "name": "Carnival Corporation • Robinhood Token",+ "address": "0x9651342CeA770aE9a2969Ba2A52611523146aef9",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 28.258401,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xB19AcE635Ef3A28B85bFB01Bae97d0DE80750680",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "CELH",+ "name": "Celsius • Robinhood Token",+ "address": "0x8cF07C5A878945185d327aAa6e33FAa95F95e7bF",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 27.694041,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.00465,+ "pool": "0xe36DBdc0D6d5ab3182b6C18ba14B65BD676cCe02",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "CLSK",+ "name": "CleanSpark • Robinhood Token",+ "address": "0xcBB95BBF36099d34dA091dc6Fa6F49EfA257Cee3",+ "decimals": 18,+ "chainlinkPriceUsd": 12.86499999,+ "feedUpdatedAt": "2026-07-10T19:55:13.000Z",+ "dexPriceUsd": 15.512892,+ "premiumDiscount": 0.20582137676317258,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xf58a091afD28F26e7E2a60803e6Dfb5A8e451021",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "COIN",+ "name": "Coinbase • Robinhood Token",+ "address": "0x6330D8C3178a418788dF01a47479c0ce7CCF450b",+ "decimals": 18,+ "chainlinkPriceUsd": 159.43135,+ "feedUpdatedAt": "2026-07-10T17:11:13.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 0.000028,+ "pool": "0x5C51A0035051fa2DB80AEc8781Be3bD6207d27E0",+ "feeTier": 3000,+ "hasFeed": true+ },+ {+ "symbol": "COST",+ "name": "Costco • Robinhood Token",+ "address": "0x4EA005168D7F09a7A0Ba9D1DEf21a479950E44C2",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 894.825303,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xdb073638f94A384b8B7a647d73274deCAC9E7cA5",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "CRCL",+ "name": "Circle Internet Group • Robinhood Token",+ "address": "0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",+ "decimals": 18,+ "chainlinkPriceUsd": 66.34635,+ "feedUpdatedAt": "2026-07-10T21:02:40.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "CRWV",+ "name": "CoreWeave • Robinhood Token",+ "address": "0x5f10A1C971B69e47e059e1dC91901B59b3fB49C3",+ "decimals": 18,+ "chainlinkPriceUsd": 88.8397,+ "feedUpdatedAt": "2026-07-10T19:23:13.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "DDOG",+ "name": "Datadog • Robinhood Token",+ "address": "0x27c99fBde9D0d2AA4f4Bfb4943f237843DdF6958",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 211.90302,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xb9a8b0A8a724f0813ceF2C9BfEf102087A33753E",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "DELL",+ "name": "Dell • Robinhood Token",+ "address": "0x941AE714EC6D8130c7B75d67160Ca08f1e7d11Dd",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 391.90292,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xc30c89cB7815A1488b7998D15eEC73961707Fc5a",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "ELF",+ "name": "e.l.f. Beauty • Robinhood Token",+ "address": "0x39EC44Bee4F6A116c6F9B8De566848a985C53C60",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 64.065551,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xc7d6ceD1B7746784a20a1201Fa9Eb4c676f1b0E3",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "EWY",+ "name": "iShares MSCI South Korea fund • Robinhood Token",+ "address": "0x7f0aBeF0C07280F82c6a08ead09dEd6BAE2C13Fc",+ "decimals": 18,+ "chainlinkPriceUsd": 183.77499999,+ "feedUpdatedAt": "2026-07-10T17:45:47.000Z",+ "dexPriceUsd": 199.360577,+ "premiumDiscount": 0.08480792823206687,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x23A254C637Ef0F13F6259586f059FFf52b89ed6b",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "F",+ "name": "Ford Motor • Robinhood Token",+ "address": "0x25C288E6D899b9BC30160965aD9644c67e73bE0C",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 13.951433,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2623.823544,+ "pool": "0x01948e834623aA859ffDC0D299dD15e7C9D7486F",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "FLNC",+ "name": "Fluence Energy • Robinhood Token",+ "address": "0x282e87451E10fA6679BC7D76C69BE44cD3fC777C",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 18.947495,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xcACD42C86E2D79b48a5E02b1Ca36e0806cc95955",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "FUTU",+ "name": "Futu Holdings • Robinhood Token",+ "address": "0xeB30663bDFf0622Ef4e4E5cBb4E975F19f33f51D",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 97.38982,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xb3E2fb8e10AF6C9FDD7F2D31CEa79927a9dBfcf6",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "GLW",+ "name": "Corning • Robinhood Token",+ "address": "0x7c04E6A3368F2A1DE3874f0e80d2e0A1a9915da6",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 220.165615,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x5f15120B65498573Dd0770F92646077A76B60724",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "GME",+ "name": "GameStop • Robinhood Token",+ "address": "0x1b0E319c6A659F002271B69dB8A7df2F911c153E",+ "decimals": 18,+ "chainlinkPriceUsd": 21.76125,+ "feedUpdatedAt": "2026-07-10T14:33:26.000Z",+ "dexPriceUsd": 20.521686,+ "premiumDiscount": -0.05696198518007933,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xE9713f453aDB9245B19559790c96F470a18F2fDF",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "GOOGL",+ "name": "Alphabet Class A • Robinhood Token",+ "address": "0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",+ "decimals": 18,+ "chainlinkPriceUsd": 356.72,+ "feedUpdatedAt": "2026-07-10T19:26:46.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 0.000114,+ "pool": "0x34D0dC122CF9A8Eb296fC5e0D3A233625D7d19b7",+ "feeTier": 500,+ "hasFeed": true+ },+ {+ "symbol": "INOD",+ "name": "Innodata • Robinhood Token",+ "address": "0xf1953DAB6FaD537488d5A022361FfAa8B4c95eC6",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 70.820687,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x47ec01141EA4D6325908bc5291a981b17eF2daD6",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "INTC",+ "name": "Intel • Robinhood Token",+ "address": "0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",+ "decimals": 18,+ "chainlinkPriceUsd": 109.65095,+ "feedUpdatedAt": "2026-07-10T19:46:11.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "INTU",+ "name": "Intuit • Robinhood Token",+ "address": "0x56d23beE5f41A7120170b0c603Dae30128e460e9",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 248.412857,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x235B2650E67570Ef3bFd0b3024fc0Ed0B0b24245",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "IONQ",+ "name": "IonQ • Robinhood Token",+ "address": "0x558378E000D634A36593E338eBacdd6207640EfE",+ "decimals": 18,+ "chainlinkPriceUsd": 43.08,+ "feedUpdatedAt": "2026-07-10T19:20:26.000Z",+ "dexPriceUsd": 49.440424,+ "premiumDiscount": 0.14764215413184778,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xbc44b11f569d3FEEd9B4088F5A3fC569D2E3c77F",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "IREN",+ "name": "IREN Limited • Robinhood Token",+ "address": "0xF0AB0c93bE6F41369d302e55db1A96b3c430212D",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 47.504536,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x0dBe9EEEa89C6EF5cd2ffCDF800E6f2548524cDB",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "LITE",+ "name": "Lumentum • Robinhood Token",+ "address": "0x8eF20885F94e3D9bc7eB3080279188Bd5ED7c08C",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 811.610521,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x48731d5732b6bD1AD3325C77cEDCFF131169783c",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "LLY",+ "name": "Eli Lilly • Robinhood Token",+ "address": "0x8005d266423c7ea827372c9c864491e5786600ea",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 1066.022337,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xF4274130137eeE20bAD928B593d992716516CEB9",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "LULU",+ "name": "Lululemon • Robinhood Token",+ "address": "0x4e62068525Ab11FE768e29dfD00ef909B9803016",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 107.672695,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.038974,+ "pool": "0x19757223628dA89569f9A2488Af6C45cB9824EA1",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "LUNR",+ "name": "Intuitive Machines • Robinhood Token",+ "address": "0xa5D4968421bA94814Be3B136b15cf422101aC1a3",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 18.20496,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.004726,+ "pool": "0xEd48CCb8d9BB86c7E039b153C53CB1A1d8bE85E5",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "MDB",+ "name": "MongoDB • Robinhood Token",+ "address": "0xDdf2266b79abf0B48898959B0ed6E6adf512be74",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 285.442397,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x2bb3E8b0406eE84646eeA60dF2c249E07aa473c8",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "META",+ "name": "Meta Platforms • Robinhood Token",+ "address": "0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",+ "decimals": 18,+ "chainlinkPriceUsd": 670.67485,+ "feedUpdatedAt": "2026-07-10T19:56:41.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "MRVL",+ "name": "Marvell Technology • Robinhood Token",+ "address": "0x62fd0668e10D8B72339BE2DCF7643001688ff13B",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 268.452393,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x06cc0b96Be1fa1d754CE2e1228F5d8c616F795b0",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "MSFT",+ "name": "Microsoft • Robinhood Token",+ "address": "0xe93237C50D904957Cf27E7B1133b510C669c2e74",+ "decimals": 18,+ "chainlinkPriceUsd": 384.69,+ "feedUpdatedAt": "2026-07-10T15:38:01.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "MSTR",+ "name": "Strategy Inc. • Robinhood Token",+ "address": "0xec262a75e413fAfD0dF80480274532C79D42da09",+ "decimals": 18,+ "chainlinkPriceUsd": 94.695,+ "feedUpdatedAt": "2026-07-10T19:39:55.000Z",+ "dexPriceUsd": 84.753979,+ "premiumDiscount": -0.10497936533079881,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.058762,+ "pool": "0x17578C0e0D15da44f31677263114F71aE76653EA",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "MU",+ "name": "Micron Technology • Robinhood Token",+ "address": "0xfF080c8ce2E5feadaCa0Da81314Ae59D232d4afD",+ "decimals": 18,+ "chainlinkPriceUsd": 978.5434,+ "feedUpdatedAt": "2026-07-10T20:01:24.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "MXL",+ "name": "MaxLinear • Robinhood Token",+ "address": "0x48961813349333209994750ffA89b3c5C22eC969",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 91.794228,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x5859a41c8063a82Bd896bC3F39EdE983856DaaF6",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "NBIS",+ "name": "Nebius Group • Robinhood Token",+ "address": "0x9D9c6684F596F66a64C030B93A886D51Fd4D7931",+ "decimals": 18,+ "chainlinkPriceUsd": 219.2375,+ "feedUpdatedAt": "2026-07-10T19:58:11.000Z",+ "dexPriceUsd": 248.412727,+ "premiumDiscount": 0.13307589714350865,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x0DDA7C6A2ccE72aBbFA88394aFe407fF98417448",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "NFLX",+ "name": "Netflix • Robinhood Token",+ "address": "0xE0444EF8BF4eD74f74FD73686e2ddF4C1c5591E8",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 69.366151,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2771.68413,+ "pool": "0xeA75eA625d83aE276b9ae8B0A3dC205916EE65cF",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "NNE",+ "name": "Nano Nuclear Energy • Robinhood Token",+ "address": "0xBEF75684C43c4ea7BD18Dd532a2244674Ee8b926",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 20.524587,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x8368991BF7f5380CecD4a6f4fc4eA151d62343Bc",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "NOW",+ "name": "ServiceNow • Robinhood Token",+ "address": "0x0C3260aF4B8f13a69c4c2dFb84fD667890CDFa14",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 88.150932,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.026672,+ "pool": "0x00Ed6C6954EdF77FfA945696F1EACf08eDcC8d3A",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "NU",+ "name": "Nu • Robinhood Token",+ "address": "0x408c14038a04f7bD235329E26d2bf569ee20e250",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 12.20442,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.003934,+ "pool": "0xb6d047637151f6De1d02028acdd187Aa9cb7AFE3",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "NVDA",+ "name": "NVIDIA • Robinhood Token",+ "address": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",+ "decimals": 18,+ "chainlinkPriceUsd": 210.19,+ "feedUpdatedAt": "2026-07-10T16:23:43.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "NVTS",+ "name": "Navitas Semiconductor • Robinhood Token",+ "address": "0xbE6702d7b70315376dC48a3293f24f0982F86386",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 17.491526,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xa6DB97Fb3e2Dcb5De6eC43B04bE6AA151905DC17",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "ORCL",+ "name": "Oracle • Robinhood Token",+ "address": "0xb0992820E760d836549ba69BC7598b4af75dEE03",+ "decimals": 18,+ "chainlinkPriceUsd": 141.0837,+ "feedUpdatedAt": "2026-07-10T18:45:37.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "P",+ "name": "Everpure • Robinhood Token",+ "address": "0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 70.786416,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x0425C69694c9357b6F2DAeb9897795fcD9c6e6cB",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "PENG",+ "name": "Penguin Solutions • Robinhood Token",+ "address": "0x9b23573b156B52565012F5cE02CDF60AFBaa70Be",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 64.093625,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x10508F818e05193eFd10A5AD360441067892551F",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "PLTR",+ "name": "Palantir Technologies • Robinhood Token",+ "address": "0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",+ "decimals": 18,+ "chainlinkPriceUsd": 126.5614,+ "feedUpdatedAt": "2026-07-10T20:15:57.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "POET",+ "name": "POET Technologies • Robinhood Token",+ "address": "0xcf6B2D875361be807EAfa57458c80f28521F9333",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 9.993697,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xa1C781ed62AC2d0283f50fF5A843647a56ddd80a",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "PR",+ "name": "Permian Resources • Robinhood Token",+ "address": "0x4189F0c66EBBB0bfeF1C31f763131361EF32f77C",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 18.204968,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xC2B5A8d6eCbbE9e4590271F7fE0261a3B265C3E7",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "QBTS",+ "name": "D-Wave Quantum • Robinhood Token",+ "address": "0xC583c60aeF9Dc401Da72cEC1B404743a93cea1Cc",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 21.792916,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x9eb22AD27148Cb90423422eC8A4a2ECF267E96bf",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "QCOM",+ "name": "Qualcomm • Robinhood Token",+ "address": "0x0f17206447090e464C277571124dD2688E48AEA9",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 203.642087,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xFf3aB07DD9C241a72D42b3841814bF800494607a",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "QQQ",+ "name": "Invesco QQQ • Robinhood Token",+ "address": "0xD5f3879160bc7c32ebb4dC785F8a4F505888de68",+ "decimals": 18,+ "chainlinkPriceUsd": 725.4506,+ "feedUpdatedAt": "2026-07-10T16:51:00.000Z",+ "dexPriceUsd": 174.399196,+ "premiumDiscount": -0.7595987983192791,+ "uiMultiplier": 1,+ "liquidityUsd": 349.377598,+ "pool": "0xEbD78dcfc8a6b3A696f1E191aD1ff321f9579f79",+ "feeTier": 3000,+ "hasFeed": true+ },+ {+ "symbol": "QUBT",+ "name": "Quantum Computing • Robinhood Token",+ "address": "0x59818904ab4cE163b3cE4FfB64f2D6Ca02c434B4",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 9.22558,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x2E2a857C08aD6C09f1d1EC4FDB4Cc7cd06cF17f4",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "RBLX",+ "name": "Roblox • Robinhood Token",+ "address": "0xF0C4BF4C582cb3836e98394b1d4e7B7281101bE8",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 44.741688,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x2ef5945cd5664876b6481FdacFaA2942995a4DA8",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "RDDT",+ "name": "Reddit • Robinhood Token",+ "address": "0x05b37Fb53A299a1b874A619e1c4C404D52C36F4C",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 151.087355,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xa8744E76aED23B05F0126335E7BD38f7935D19fe",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "RDW",+ "name": "Redwire • Robinhood Token",+ "address": "0x92Ef19E82bD8fF36661DE838D5eaE7e5CEF0EfFE",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 10.195511,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800.004376,+ "pool": "0x71E15C0Ed50142C772beE6195c936F04E4696F5d",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "RGTI",+ "name": "Rigetti Computing • Robinhood Token",+ "address": "0x284358abc07F9359f19f4b5b4aC91901Be2597Ba",+ "decimals": 18,+ "chainlinkPriceUsd": 16.57150813,+ "feedUpdatedAt": "2026-07-10T20:00:54.000Z",+ "dexPriceUsd": 18.570157,+ "premiumDiscount": 0.12060754243494412,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xb549D4EaF467277E48Aa350f216e413DF8c8BA12",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "RIVN",+ "name": "Rivian Automotive • Robinhood Token",+ "address": "0xB1BF26c1D20ff267A4f93550d1E0d06ac40a114B",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 14.038783,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xb30A75B200D98A600a3766869344928E35823E23",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "RKLB",+ "name": "Rocket Lab Corporation • Robinhood Token",+ "address": "0x3b14C39E89D60D627b42a1A4CA45b5bb45Fc12e2",+ "decimals": 18,+ "chainlinkPriceUsd": 81.2897,+ "feedUpdatedAt": "2026-07-10T23:36:37.000Z",+ "dexPriceUsd": 78.252165,+ "premiumDiscount": -0.03736678816627434,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xa9888De1B9D64A93eaeb495A39FE9B3d00654928",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "SATS",+ "name": "EchoStar • Robinhood Token",+ "address": "0x95052ddcd5DC25641657424A8Cf04834997E1730",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 97.389819,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xF9F25cD5b5Ab162f7aad3cB2A1843916Af49167f",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "SGOV",+ "name": "iShares 0-3 Month Treasury Bond • Robinhood Token",+ "address": "0x92FD66527192E3e61d4DDd13322Aa222DE86F9B5",+ "decimals": 18,+ "chainlinkPriceUsd": 100.60428845,+ "feedUpdatedAt": "2026-07-11T00:01:40.000Z",+ "dexPriceUsd": 82.421505,+ "premiumDiscount": -0.18073566972283478,+ "uiMultiplier": 1.0009575198909908,+ "liquidityUsd": 164.884854,+ "pool": "0xFfb376Bfc48668f16719b42ed8AEEF5b98dBc4f1",+ "feeTier": 100,+ "hasFeed": true+ },+ {+ "symbol": "SHOP",+ "name": "Shopify • Robinhood Token",+ "address": "0xF53F66751B1Eff985311b693531E3290F600c410",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 111.967095,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x18A1aFa849A6940870c2163B7ECBCC85d455Ad99",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "SLV",+ "name": "iShares Silver Trust • Robinhood Token",+ "address": "0x411eFb0E7f985935DAec3D4C3ebaEa0d0AD7D89f",+ "decimals": 18,+ "chainlinkPriceUsd": 54.1649,+ "feedUpdatedAt": "2026-07-10T21:43:28.000Z",+ "dexPriceUsd": 2.40826,+ "premiumDiscount": -0.9555383652512974,+ "uiMultiplier": 1,+ "liquidityUsd": 4.816522,+ "pool": "0x8cB787e6c315D464775289BaD00FDD67d53Ecb3D",+ "feeTier": 3000,+ "hasFeed": true+ },+ {+ "symbol": "SMCI",+ "name": "Super Micro Computer • Robinhood Token",+ "address": "0xc01aA1fECeC0605b13bc84874ff7256C0f5F562a",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 31.227608,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x9f0167dA6D9738b57CbA0833a541Db77762fB7Bb",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "SNDK",+ "name": "Sandisk Corporation • Robinhood Token",+ "address": "0xB90A19fF0Af67f7779afF50A882A9CfF42446400",+ "decimals": 18,+ "chainlinkPriceUsd": 1931.62665,+ "feedUpdatedAt": "2026-07-10T23:50:30.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "SOFI",+ "name": "SoFi Technologies • Robinhood Token",+ "address": "0x98E75885157C80992A8D41b696D8c9C6Fb30A926",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 16.80603,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xEA9368e1c88bCe7F04D16919eB131778A0dF826a",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "SOXX",+ "name": "iShares Semiconductor ETF • Robinhood Token",+ "address": "0x75742c18BC1f1C5c5f448f4C9D9C6F66dafAAa38",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 593.05133,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x563a3154BC09d2a2364b9a2A5766148F4e89be77",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "SPCX",+ "name": "Space Exploration Technologies Corp. Class A Common Stock • Robinhood Token",+ "address": "0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",+ "decimals": 18,+ "chainlinkPriceUsd": 145.725,+ "feedUpdatedAt": "2026-07-10T19:57:10.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 0.000002,+ "pool": "0xfbB32C09488e3fc33fe6fD84fe6aE442B4d13a31",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "SPMO",+ "name": "Invesco S&P 500 Momentum ETF • Robinhood Token",+ "address": "0xAd622320e520de39e72d41EF07438C3Fd3354875",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 154.126192,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x727C8A9e0da8Bb21bE322D2Bb5D891b126143b8C",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "SPY",+ "name": "SPDR S&P 500 ETF Trust • Robinhood Token",+ "address": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",+ "decimals": 18,+ "chainlinkPriceUsd": 753.615,+ "feedUpdatedAt": "2026-07-10T16:16:43.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "TSEM",+ "name": "Tower Semiconductor • Robinhood Token",+ "address": "0x89776d4Cd68193597A2fC132cfaC1fDe36CCeA8a",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 263.659645,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x350051ec863739E4875F255e760Ad3514c10f110",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "TSLA",+ "name": "Tesla • Robinhood Token",+ "address": "0x322F0929c4625eD5bAd873c95208D54E1c003b2d",+ "decimals": 18,+ "chainlinkPriceUsd": 407.825,+ "feedUpdatedAt": "2026-07-10T19:53:35.000Z",+ "dexPriceUsd": 23.20889,+ "premiumDiscount": -0.9430910562128364,+ "uiMultiplier": 1,+ "liquidityUsd": 47.13946258260744,+ "pool": "0xA953CA88ff430e9487c60cA34d757414f4efdA07",+ "feeTier": 3000,+ "hasFeed": true+ },+ {+ "symbol": "TSM",+ "name": "Taiwan Semiconductor Manufacturing • Robinhood Token",+ "address": "0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",+ "decimals": 18,+ "chainlinkPriceUsd": 434.3715,+ "feedUpdatedAt": "2026-07-10T20:06:23.000Z",+ "dexPriceUsd": 424.15395,+ "premiumDiscount": -0.02352260680086059,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x07e8Ea83D4C1340774c8965125e26e12bf943bf1",+ "feeTier": 10000,+ "hasFeed": true+ },+ {+ "symbol": "TTWO",+ "name": "Take-Two Interactive Software • Robinhood Token",+ "address": "0x5e81213613b6B86EaB4c6c50d718d34359459786",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 224.923279,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x0889178E5cf9408EAD5D0D1e8c6Ff29e113388AF",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "UMC",+ "name": "United Microelectronics • Robinhood Token",+ "address": "0x0E6e67Ba88e7b5d9B67636A215c76779B948dE79",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 26.614066,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xD95a760934ddf6818176d51c12e89520DD7bAC44",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "UPS",+ "name": "UPS • Robinhood Token",+ "address": "0xf23250dac154D05Bb671CB0d0eBEf3c635c79CE2",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 105.546982,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x3Ab74C45DceCC6A62898204Dd42143a816B44CB1",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "USAR",+ "name": "USA Rare Earth • Robinhood Token",+ "address": "0xd917B029C761D264c6A312BBbcDA868658eF86a6",+ "decimals": 18,+ "chainlinkPriceUsd": 18.53505,+ "feedUpdatedAt": "2026-07-10T18:50:42.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "USO",+ "name": "United States Oil Fund • Robinhood Token",+ "address": "0xa30FA36Db767ad9eD3f7a60fC79526fB4d56D344",+ "decimals": 18,+ "chainlinkPriceUsd": 108.685,+ "feedUpdatedAt": "2026-07-10T18:31:52.000Z",+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": true+ },+ {+ "symbol": "WDAY",+ "name": "Workday • Robinhood Token",+ "address": "0x82DA4646242e1D962e96e932269Dc644c94a9CaA",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 112.052826,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xcF64702D2538149a2e84FfA96b00ee745195791D",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "WEEK",+ "name": "Roundhill Weekly T-Bill ETF • Robinhood Token",+ "address": "0xc93a8c440CEa26D7445dF01729f193b27965099f",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": null,+ "premiumDiscount": null,+ "uiMultiplier": 2.0061825242718445,+ "liquidityUsd": null,+ "pool": null,+ "feeTier": null,+ "hasFeed": false+ },+ {+ "symbol": "XLK",+ "name": "State Street Technology Select Sector SPDR ETF • Robinhood Token",+ "address": "0x15Cd20759CE7F3285c29A319dE2D1A2e098c6f43",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 177.171165,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xe20463635cEEEA8E30A315FFc4D4e81c80E53147",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "XNDU",+ "name": "Xanadu Quantum • Robinhood Token",+ "address": "0xA8eB3BCcbf2017eE7CBfb652eB51CF2E1B153289",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 11.727049,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x69174bFCFAcaDfB056982C88c351549ef6308213",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "XOM",+ "name": "ExxonMobil Holdings Corporation • Robinhood Token",+ "address": "0xf9B46d3D1B22199D4D1025a9cEDB540A33F1a2d5",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 131.345517,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2779.01469,+ "pool": "0x6aF79a2c154E7EeA9c87B38617D5f0B598B690FB",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "ZM",+ "name": "Zoom • Robinhood Token",+ "address": "0x44c4F142009036cF477eD2d09932051843137CF1",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 79.829437,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0x89eF54007B030a07B12F7cda9fe98cb278Cd7E6d",+ "feeTier": 10000,+ "hasFeed": false+ },+ {+ "symbol": "ZS",+ "name": "Zscaler • Robinhood Token",+ "address": "0x7dc013eB55e436f30d7ED1AFE4E36d6e45e3c3f7",+ "decimals": 18,+ "chainlinkPriceUsd": null,+ "feedUpdatedAt": null,+ "dexPriceUsd": 118.958347,+ "premiumDiscount": null,+ "uiMultiplier": 1,+ "liquidityUsd": 2800,+ "pool": "0xdF9A23295D5D66E8066370CeA9349DEf9CcafDAe",+ "feeTier": 10000,+ "hasFeed": false+ }+ ],+ "note": "Per-token 24h DEX volume and OHLCV candles are on the detail endpoint (/v1/stocks/{symbol}); reconstructing them for every token per request would hammer the public RPC.",+ "asOf": "2026-07-12T13:44:10.900Z",+ "source": [+ "hoodchain-registry",+ "chainlink-feeds",+ "uniswap-v3-onchain"+ ]+ }+ },+ "stockDetail": {+ "status": 200,+ "body": {+ "symbol": "TSLA",+ "name": "Tesla • Robinhood Token",+ "address": "0x322F0929c4625eD5bAd873c95208D54E1c003b2d",+ "decimals": 18,+ "uiMultiplier": 1,+ "chainlink": {+ "priceUsd": 407.825,+ "feed": "0x4A1166a659A55625345e9515b32adECea5547C38",+ "roundId": "18446744073709551930",+ "updatedAt": "2026-07-10T19:53:35.000Z",+ "ageSeconds": 150635+ },+ "dex": {+ "priceUsd": 23.20889,+ "pool": "0xA953CA88ff430e9487c60cA34d757414f4efdA07",+ "feeTier": 3000,+ "quoteAsset": "WETH",+ "liquidityUsd": 47.13946258260744,+ "volume24hUsd": 38.84698600036214+ },+ "premiumDiscount": -0.9430910562128364,+ "candles": {+ "interval": "1h",+ "fromBlock": "6950302",+ "toBlock": "7850302",+ "series": [+ {+ "t": 1783771200,+ "o": 408.173106564646,+ "h": 408.173106564646,+ "l": 403.2395191182679,+ "c": 403.2395191182679,+ "v": 5.0735481782259395+ },+ {+ "t": 1783778400,+ "o": 408.2967464796052,+ "h": 408.2967464796052,+ "l": 405.6090842492009,+ "c": 405.720682811202,+ "v": 14.37966501006062+ },+ {+ "t": 1783782000,+ "o": 409.4467387168462,+ "h": 409.4467387168462,+ "l": 409.4467387168462,+ "c": 409.4467387168462,+ "v": 0.54219+ },+ {+ "t": 1783785600,+ "o": 403.90094872710546,+ "h": 403.90094872710546,+ "l": 403.25483616472144,+ "c": 403.25483616472144,+ "v": 4.260329290758027+ },+ {+ "t": 1783789200,+ "o": 403.79192966178255,+ "h": 403.79192966178255,+ "l": 403.79192966178255,+ "c": 403.79192966178255,+ "v": 0.00813285+ },+ {+ "t": 1783792800,+ "o": 404.2261077126562,+ "h": 404.2261077126562,+ "l": 404.2261077126562,+ "c": 404.2261077126562,+ "v": 0.4395122674030227+ },+ {+ "t": 1783800000,+ "o": 406.4076269161194,+ "h": 406.4076269161194,+ "l": 406.4076269161194,+ "c": 406.4076269161194,+ "v": 1.8073+ },+ {+ "t": 1783810800,+ "o": 408.81960226354744,+ "h": 408.81960226354744,+ "l": 408.81960226354744,+ "c": 408.81960226354744,+ "v": 0.6661398985426578+ },+ {+ "t": 1783818000,+ "o": 410.0052191394728,+ "h": 410.0052191394728,+ "l": 410.0052191394728,+ "c": 410.0052191394728,+ "v": 0.5477582714237483+ },+ {+ "t": 1783832400,+ "o": 407.5527049170627,+ "h": 409.47967791430267,+ "l": 407.5527049170627,+ "c": 409.47967791430267,+ "v": 0.5439972999999999+ },+ {+ "t": 1783839600,+ "o": 409.4990953108372,+ "h": 409.4990953108372,+ "l": 409.4990953108372,+ "c": 409.4990953108372,+ "v": 0.018073000000000002+ },+ {+ "t": 1783854000,+ "o": 401.7389551187121,+ "h": 407.8736815154242,+ "l": 401.7389551187121,+ "c": 407.8736815154242,+ "v": 10.560339933948127+ }+ ]+ },+ "holders": 3530,+ "transfersCount": 347334,+ "links": {+ "token": "https://robinhoodchain.blockscout.com/token/0x322F0929c4625eD5bAd873c95208D54E1c003b2d",+ "feed": "https://robinhoodchain.blockscout.com/address/0x4A1166a659A55625345e9515b32adECea5547C38",+ "pool": "https://robinhoodchain.blockscout.com/address/0xA953CA88ff430e9487c60cA34d757414f4efdA07"+ },+ "asOf": "2026-07-12T13:44:11.445Z",+ "source": [+ "hoodchain-registry",+ "chainlink-feeds",+ "uniswap-v3-onchain",+ "blockscout"+ ]+ }+ },+ "coins": {+ "status": 200,+ "body": {+ "count": 0,+ "lookbackBlocks": "200000",+ "coins": [],+ "asOf": "2026-07-12T13:44:11.541Z",+ "source": [+ "noxa-launchpad",+ "odyssey-launchpad",+ "uniswap-v3-onchain",+ "blockscout"+ ]+ }+ },+ "launches": {+ "status": 200,+ "body": {+ "count": 0,+ "lookbackBlocks": "864000",+ "launchpads": [+ "noxa",+ "odyssey"+ ],+ "launches": [],+ "asOf": "2026-07-12T13:44:11.635Z",+ "source": [+ "noxa-launchpad",+ "odyssey-launchpad",+ "robinhood-chain-rpc"+ ]+ }+ },+ "portfolioChallenge": {+ "status": 402,+ "body": {+ "error": "X-PAYMENT header is required",+ "accepts": [+ {+ "scheme": "exact",+ "network": "base-sepolia",+ "maxAmountRequired": "2000",+ "resource": "http://127.0.0.1:42685/v1/portfolio/0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",+ "description": "Multiplier-correct Robinhood Chain portfolio valuation",+ "mimeType": "application/json",+ "payTo": "0xc8E94d65E00ccb90b41eDE17ca08cA137e46629c",+ "maxTimeoutSeconds": 300,+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",+ "outputSchema": {+ "input": {+ "type": "http",+ "method": "GET",+ "discoverable": true+ }+ },+ "extra": {+ "name": "USDC",+ "version": "2"+ }+ }+ ],+ "x402Version": 1+ }+ }+};diff --git a/robinhood/hood-api/docs/site.css b/robinhood/hood-api/docs/site.cssnew file mode 100644index 000000000..bc5d7577a--- /dev/null+++ b/robinhood/hood-api/docs/site.css@@ -0,0 +1,245 @@+/* hoodchain docs — dark-first, one accent gradient, system type stack */+:root {+ --bg: #0a0a0c;+ --bg-raised: #121216;+ --bg-inset: #0e0e11;+ --border: #232329;+ --border-strong: #34343c;+ --text: #ededf0;+ --text-dim: #9c9ca6;+ --text-faint: #62626c;+ --accent-a: #7ef29a;+ --accent-b: #4cc9f0;+ --accent-grad: linear-gradient(96deg, var(--accent-a), var(--accent-b));+ --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;+ --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;+ --up: #6fe08a;+ --down: #f26d7e;+}+* { box-sizing: border-box; }+html { scroll-behavior: smooth; }+body {+ margin: 0;+ background: var(--bg);+ color: var(--text);+ font: 15px/1.6 var(--sans);+ -webkit-font-smoothing: antialiased;+}+a { color: inherit; text-decoration: none; }+a:hover { color: var(--accent-a); }+a:focus-visible, button:focus-visible {+ outline: 2px solid var(--accent-b);+ outline-offset: 2px;+ border-radius: 4px;+}+code, pre { font-family: var(--mono); font-size: 0.86em; }+pre {+ background: var(--bg-inset);+ border: 1px solid var(--border);+ border-radius: 10px;+ padding: 16px 18px;+ overflow-x: auto;+ line-height: 1.55;+}+code:not(pre code) {+ background: var(--bg-raised);+ border: 1px solid var(--border);+ border-radius: 5px;+ padding: 1px 6px;+}++.wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; }++/* nav */+nav.top {+ position: sticky; top: 0; z-index: 10;+ background: color-mix(in srgb, var(--bg) 82%, transparent);+ backdrop-filter: blur(12px);+ border-bottom: 1px solid var(--border);+}+nav.top .wrap { display: flex; align-items: center; gap: 22px; height: 56px; }+.brand { font-weight: 700; letter-spacing: -0.02em; font-size: 16px; }+.brand .tick { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }+nav.top .links { display: flex; gap: 18px; margin-left: auto; font-size: 14px; color: var(--text-dim); }+nav.top .links a { padding: 4px 2px; transition: color 0.15s ease; }++/* hero */+.hero { padding: 84px 0 40px; }+.hero h1 {+ font-size: clamp(30px, 5.4vw, 52px);+ line-height: 1.08;+ letter-spacing: -0.035em;+ margin: 0 0 14px;+ font-weight: 750;+}+.hero h1 .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }+.hero p.lede { color: var(--text-dim); font-size: 17px; max-width: 620px; margin: 0 0 26px; }+.cta { display: flex; gap: 12px; flex-wrap: wrap; }+.btn {+ display: inline-flex; align-items: center; gap: 8px;+ border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600;+ border: 1px solid var(--border-strong);+ background: var(--bg-raised);+ color: var(--text);+ cursor: pointer;+ transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;+}+.btn:hover { border-color: var(--accent-a); color: var(--text); transform: translateY(-1px); }+.btn.primary { background: var(--accent-grad); color: #0a0f0b; border: none; }+.btn.primary:hover { filter: brightness(1.06); color: #0a0f0b; }+.install {+ font-family: var(--mono); font-size: 13.5px;+ color: var(--text-dim);+ background: var(--bg-inset);+ border: 1px solid var(--border);+ border-radius: 8px; padding: 10px 16px;+ display: inline-flex; gap: 10px; align-items: center;+}+.install .dollar { color: var(--accent-a); user-select: none; }++/* live board */+.board-head { display: flex; align-items: baseline; gap: 12px; margin: 46px 0 14px; }+.board-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }+.status { font-size: 12.5px; color: var(--text-faint); }+.status .dot {+ display: inline-block; width: 7px; height: 7px; border-radius: 50%;+ background: var(--text-faint); margin-right: 6px;+ vertical-align: 1px;+ transition: background 0.3s ease;+}+.status.live .dot { background: var(--up); box-shadow: 0 0 6px color-mix(in srgb, var(--up) 70%, transparent); }+.status.error .dot { background: var(--down); }+.board {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));+ gap: 10px;+}+.tile {+ background: var(--bg-raised);+ border: 1px solid var(--border);+ border-radius: 12px;+ padding: 14px 16px;+ transition: border-color 0.15s ease, transform 0.12s ease;+}+.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }+.tile .sym { font-weight: 700; font-size: 14px; letter-spacing: 0.01em; }+.tile .co { color: var(--text-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+.tile .px {+ font-family: var(--mono); font-size: 21px; font-weight: 600;+ margin-top: 8px; letter-spacing: -0.01em;+ transition: color 0.4s ease;+}+.tile .px.up { color: var(--up); }+.tile .px.down { color: var(--down); }+.tile .px.skeleton {+ color: transparent; border-radius: 6px;+ background: linear-gradient(90deg, var(--bg-inset) 25%, var(--border) 50%, var(--bg-inset) 75%);+ background-size: 200% 100%;+ animation: shimmer 1.4s infinite;+}+@keyframes shimmer { to { background-position: -200% 0; } }+.tile .meta { color: var(--text-faint); font-size: 11.5px; margin-top: 6px; font-family: var(--mono); }+.board-note { color: var(--text-faint); font-size: 12.5px; margin-top: 12px; }+.board-error {+ border: 1px solid color-mix(in srgb, var(--down) 40%, transparent);+ background: color-mix(in srgb, var(--down) 7%, var(--bg-raised));+ border-radius: 12px; padding: 16px 18px; font-size: 14px; color: var(--text-dim);+ display: none;+}+.board-error.visible { display: block; }+.board-error a { color: var(--accent-b); }++/* sections */+section.block { margin: 64px 0; }+section.block h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 6px; }+section.block p.sub { color: var(--text-dim); margin: 0 0 20px; max-width: 640px; }+.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }+.card {+ background: var(--bg-raised);+ border: 1px solid var(--border);+ border-radius: 12px;+ padding: 18px 20px;+ transition: border-color 0.15s ease, transform 0.12s ease;+}+.card:hover { border-color: var(--border-strong); transform: translateY(-1px); }+.card h3 { margin: 0 0 6px; font-size: 15px; }+.card h3 code { font-size: 13px; }+.card p { margin: 0; color: var(--text-dim); font-size: 13.5px; }++.disclosure {+ border: 1px solid var(--border);+ border-left: 3px solid var(--accent-b);+ background: var(--bg-inset);+ border-radius: 10px;+ padding: 14px 18px;+ color: var(--text-dim);+ font-size: 13.5px;+ margin: 26px 0;+}++table { border-collapse: collapse; width: 100%; font-size: 13.5px; }+.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }+th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); }+th { color: var(--text-faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }+tr:last-child td { border-bottom: none; }+td code { white-space: nowrap; }++footer {+ border-top: 1px solid var(--border);+ margin-top: 80px; padding: 28px 0 44px;+ color: var(--text-faint); font-size: 13.5px;+}+footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }++@media (max-width: 720px) {+ .hero { padding: 56px 0 28px; }+ nav.top .links { gap: 12px; }+ nav.top .links a.hide-sm { display: none; }+}++/* hood-api additions: endpoint rows, method/price pills, tabs */+.pill {+ display: inline-flex; align-items: center; font-family: var(--mono);+ font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;+ border-radius: 5px; padding: 2px 7px; line-height: 1.5;+}+.pill.get { background: color-mix(in srgb, var(--accent-b) 16%, transparent); color: var(--accent-b); }+.pill.free { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }+.pill.paid { background: color-mix(in srgb, #f2c14e 18%, transparent); color: #f2c14e; }+.pill.ws { background: color-mix(in srgb, var(--accent-a) 16%, transparent); color: var(--accent-a); }++.endpoint {+ border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raised);+ padding: 16px 18px; margin-bottom: 10px;+}+.endpoint .row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }+.endpoint .path { font-family: var(--mono); font-size: 14px; font-weight: 600; }+.endpoint .desc { color: var(--text-dim); font-size: 13.5px; margin: 8px 0 0; }+.endpoint .price { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); }+.endpoint details { margin-top: 10px; }+.endpoint summary {+ cursor: pointer; color: var(--text-faint); font-size: 12.5px; user-select: none;+ list-style: none;+}+.endpoint summary::-webkit-details-marker { display: none; }+.endpoint summary:before { content: '▸ '; }+.endpoint details[open] summary:before { content: '▾ '; }+.endpoint pre { margin-top: 8px; max-height: 340px; }++.tabs { display: flex; gap: 4px; margin-bottom: 10px; }+.tabs button {+ background: var(--bg-inset); border: 1px solid var(--border); color: var(--text-dim);+ font-size: 12.5px; font-family: var(--mono); padding: 6px 12px; border-radius: 7px 7px 0 0;+ cursor: pointer; border-bottom: none;+}+.tabs button.active { color: var(--text); background: var(--bg-inset); border-color: var(--border-strong); }+.tabpanel { display: none; }+.tabpanel.active { display: block; }++.section-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 30px; font-size: 13px; }+.section-nav a { color: var(--text-dim); }+.section-nav a:hover { color: var(--accent-a); }++.samplemeta { font-size: 12px; color: var(--text-faint); margin: 4px 0 12px; }+.samplemeta .live-badge { color: var(--up); }+.samplemeta .cached-badge { color: #f2c14e; }diff --git a/robinhood/hood-api/openapi.json b/robinhood/hood-api/openapi.jsonnew file mode 100644index 000000000..c4cb84e4a--- /dev/null+++ b/robinhood/hood-api/openapi.json@@ -0,0 +1,606 @@+{+ "openapi": "3.1.0",+ "info": {+ "title": "hood-api",+ "version": "0.1.0",+ "description": "Hosted market-data API for Robinhood Chain (chain ID 4663): Stock Tokens with Chainlink + DEX premium/discount, memecoin launchpads, multiplier-correct portfolios, cross-venue tokenized-equity spreads, and a real-time firehose. Free tier is IP-rate-limited; paid endpoints are metered via x402.",+ "license": {+ "name": "MIT"+ },+ "contact": {+ "name": "nirholas",+ "url": "https://x.com/nichxbt"+ }+ },+ "servers": [+ {+ "url": "https://hood-api.example.com",+ "description": "Production (replace with your deployment URL)"+ }+ ],+ "components": {+ "schemas": {+ "ApiError": {+ "type": "object",+ "properties": {+ "error": {+ "type": "string",+ "example": "unknown_symbol"+ },+ "hint": {+ "type": "string",+ "example": "Symbol not found in the Stock Token registry."+ },+ "docs": {+ "type": "string",+ "format": "uri",+ "example": "https://nirholas.github.io/hood-api/#errors"+ }+ },+ "required": [+ "error",+ "hint",+ "docs"+ ]+ }+ },+ "parameters": {}+ },+ "paths": {+ "/v1/health": {+ "get": {+ "tags": [+ "Health"+ ],+ "summary": "Service liveness + RPC reachability",+ "responses": {+ "200": {+ "description": "OK",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ }+ }+ }+ },+ "/v1/chain": {+ "get": {+ "tags": [+ "Chain"+ ],+ "summary": "Chain stats: block height, gas, TVL, ETH price",+ "responses": {+ "200": {+ "description": "Chain stats",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/stocks": {+ "get": {+ "tags": [+ "Stocks"+ ],+ "summary": "All Stock Tokens: Chainlink price, DEX price, premium/discount, liquidity",+ "responses": {+ "200": {+ "description": "Stock Token list",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/stocks/{symbol}": {+ "get": {+ "tags": [+ "Stocks"+ ],+ "summary": "Stock Token detail: candles, holders, feed metadata, links",+ "parameters": [+ {+ "schema": {+ "type": "string",+ "minLength": 1,+ "maxLength": 10,+ "example": "AAPL",+ "description": "Stock Token ticker, case-insensitive"+ },+ "required": true,+ "description": "Stock Token ticker, case-insensitive",+ "name": "symbol",+ "in": "path"+ },+ {+ "schema": {+ "type": "string",+ "enum": [+ "5m",+ "15m",+ "1h",+ "4h",+ "1d"+ ]+ },+ "required": false,+ "name": "interval",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "Stock Token detail",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/coins": {+ "get": {+ "tags": [+ "Coins"+ ],+ "summary": "Memecoins: launchpad state, price, liquidity, holders, age",+ "parameters": [+ {+ "schema": {+ "type": "integer",+ "minimum": 1,+ "maximum": 60,+ "example": 25+ },+ "required": false,+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "Coin list",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/coins/{address}": {+ "get": {+ "tags": [+ "Coins"+ ],+ "summary": "Coin detail: launch info, graduation status, DEX stats, holders",+ "parameters": [+ {+ "schema": {+ "type": "string",+ "pattern": "^0x[a-fA-F0-9]{40}$",+ "example": "0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",+ "description": "EVM contract or wallet address"+ },+ "required": true,+ "description": "EVM contract or wallet address",+ "name": "address",+ "in": "path"+ }+ ],+ "responses": {+ "200": {+ "description": "Coin detail",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/launches": {+ "get": {+ "tags": [+ "Coins"+ ],+ "summary": "Recent + live launchpad activity (NOXA, The Odyssey)",+ "parameters": [+ {+ "schema": {+ "type": "string",+ "enum": [+ "noxa",+ "odyssey"+ ],+ "description": "Restrict to one launchpad"+ },+ "required": false,+ "description": "Restrict to one launchpad",+ "name": "launchpad",+ "in": "query"+ },+ {+ "schema": {+ "type": "string",+ "enum": [+ "15m",+ "1h",+ "6h",+ "24h"+ ],+ "example": "1h"+ },+ "required": false,+ "name": "lookback",+ "in": "query"+ },+ {+ "schema": {+ "type": "integer",+ "minimum": 1,+ "maximum": 200,+ "example": 50+ },+ "required": false,+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "Launch list",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/portfolio/{address}": {+ "get": {+ "tags": [+ "Paid"+ ],+ "summary": "Multiplier-correct portfolio valuation (x402, $0.002)",+ "parameters": [+ {+ "schema": {+ "type": "string",+ "pattern": "^0x[a-fA-F0-9]{40}$",+ "example": "0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9",+ "description": "EVM contract or wallet address"+ },+ "required": true,+ "description": "EVM contract or wallet address",+ "name": "address",+ "in": "path"+ }+ ],+ "responses": {+ "200": {+ "description": "Portfolio",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/stocks/{symbol}/history": {+ "get": {+ "tags": [+ "Paid"+ ],+ "summary": "Deep OHLCV history for one Stock Token (x402, $0.005)",+ "parameters": [+ {+ "schema": {+ "type": "string",+ "minLength": 1,+ "maxLength": 10,+ "example": "AAPL",+ "description": "Stock Token ticker, case-insensitive"+ },+ "required": true,+ "description": "Stock Token ticker, case-insensitive",+ "name": "symbol",+ "in": "path"+ },+ {+ "schema": {+ "type": "string",+ "enum": [+ "5m",+ "15m",+ "1h",+ "4h",+ "1d"+ ],+ "example": "1h",+ "description": "Candle bucket size"+ },+ "required": false,+ "description": "Candle bucket size",+ "name": "interval",+ "in": "query"+ },+ {+ "schema": {+ "type": "string",+ "enum": [+ "1h",+ "6h",+ "24h",+ "7d",+ "30d"+ ],+ "example": "7d",+ "description": "How far back to reconstruct OHLCV from swap logs"+ },+ "required": false,+ "description": "How far back to reconstruct OHLCV from swap logs",+ "name": "lookback",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "History",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/equities": {+ "get": {+ "tags": [+ "Paid"+ ],+ "summary": "Cross-venue tokenized-equity spreads: Robinhood Chain vs xStocks vs Ondo (x402, $0.01)",+ "parameters": [+ {+ "schema": {+ "type": "integer",+ "minimum": 1,+ "maximum": 30,+ "example": 10+ },+ "required": false,+ "name": "limit",+ "in": "query"+ }+ ],+ "responses": {+ "200": {+ "description": "Cross-venue list",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/equities/{symbol}": {+ "get": {+ "tags": [+ "Paid"+ ],+ "summary": "Cross-venue price for one ticker (x402, $0.01)",+ "parameters": [+ {+ "schema": {+ "type": "string",+ "minLength": 1,+ "maxLength": 10,+ "example": "AAPL",+ "description": "Stock Token ticker, case-insensitive"+ },+ "required": true,+ "description": "Stock Token ticker, case-insensitive",+ "name": "symbol",+ "in": "path"+ }+ ],+ "responses": {+ "200": {+ "description": "Cross-venue row",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ },+ "/v1/firehose": {+ "get": {+ "tags": [+ "Paid"+ ],+ "summary": "Mint a metered session token for the real-time /v1/ws firehose (x402, $0.01)",+ "responses": {+ "200": {+ "description": "Session token",+ "content": {+ "application/json": {+ "schema": {+ "type": "object",+ "additionalProperties": {}+ }+ }+ }+ },+ "default": {+ "description": "Error",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ }+ }+ }+ }+ },+ "webhooks": {}+}diff --git a/robinhood/hood-api/scripts/capture-samples.ts b/robinhood/hood-api/scripts/capture-samples.tsnew file mode 100644index 000000000..50f692564--- /dev/null+++ b/robinhood/hood-api/scripts/capture-samples.ts@@ -0,0 +1,41 @@+import 'dotenv/config'+import { writeFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import { serve } from '@hono/node-server'+import { createApp } from '../src/app.js'++/**+ * Captures real responses from a locally-running instance of this server and+ * writes them to `docs/samples.json`. The docs site embeds these as a+ * clearly-labeled "sample of live output — captured <timestamp>" fallback for+ * when it isn't loaded against a live deployment.+ */++const app = createApp()+const server = serve({ fetch: app.fetch, port: 0 }, async (info) => {+ const base = `http://127.0.0.1:${info.port}`+ const paths = {+ health: '/v1/health',+ chain: '/v1/chain',+ stocks: '/v1/stocks',+ stockDetail: '/v1/stocks/TSLA',+ coins: '/v1/coins?limit=8',+ launches: '/v1/launches?lookback=24h&limit=8',+ portfolioChallenge: '/v1/portfolio/0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9',+ }++ const samples: Record<string, unknown> = { capturedAt: new Date().toISOString() }+ for (const [key, path] of Object.entries(paths)) {+ const res = await fetch(base + path)+ samples[key] = { status: res.status, body: await res.json() }+ console.log(`captured ${key}: HTTP ${res.status}`)+ }++ // A <script src> file, not JSON fetched via XHR/fetch — the docs page must work when+ // opened directly via file://, where fetch() of a local file is blocked by browser CORS+ // policy but a <script> tag loads fine.+ const outPath = fileURLToPath(new URL('../docs/samples.js', import.meta.url))+ writeFileSync(outPath, `window.HOOD_API_SAMPLES = ${JSON.stringify(samples, null, 2)};\n`)+ console.log(`wrote ${outPath}`)+ server.close()+})diff --git a/robinhood/hood-api/scripts/emit-openapi.ts b/robinhood/hood-api/scripts/emit-openapi.tsnew file mode 100644index 000000000..5465b62d6--- /dev/null+++ b/robinhood/hood-api/scripts/emit-openapi.ts@@ -0,0 +1,24 @@+import { writeFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import { createApp } from '../src/app.js'++/** Regenerates `openapi.json` from the live route definitions. Run after any route change. */+const app = createApp()+const doc = app.getOpenAPI31Document({+ openapi: '3.1.0',+ info: {+ title: 'hood-api',+ version: '0.1.0',+ description:+ 'Hosted market-data API for Robinhood Chain (chain ID 4663): Stock Tokens with Chainlink + DEX ' ++ 'premium/discount, memecoin launchpads, multiplier-correct portfolios, cross-venue tokenized-equity ' ++ 'spreads, and a real-time firehose. Free tier is IP-rate-limited; paid endpoints are metered via x402.',+ license: { name: 'MIT' },+ contact: { name: 'nirholas', url: 'https://x.com/nichxbt' },+ },+ servers: [{ url: 'https://hood-api.example.com', description: 'Production (replace with your deployment URL)' }],+})++const outPath = fileURLToPath(new URL('../openapi.json', import.meta.url))+writeFileSync(outPath, JSON.stringify(doc, null, 2) + '\n')+console.log(`wrote ${outPath}`)diff --git a/robinhood/hood-api/src/routes/paid.ts b/robinhood/hood-api/src/routes/paid.tsindex d4712fcf3..5c40d84d3 100644--- a/robinhood/hood-api/src/routes/paid.ts+++ b/robinhood/hood-api/src/routes/paid.ts@@ -1,5 +1,5 @@import { createRoute, OpenAPIHono, z } from '@hono/zod-openapi'-import { ApiError, toApiError } from '../lib/errors.js'+import { ApiError, apiValidationHook, toApiError } from '../lib/errors.js'import { paymentsEnabled } from '../lib/env.js'import { PRICES } from '../lib/x402.js'import { SymbolParam, AddressParam, HistoryQuery, EquitiesListQuery, ErrorSchema, LOOKBACK_BLOCKS } from '../schemas.js'@@ -9,7 +9,7 @@ import { getEquity, listEquities } from '../services/equities.js'import { mintSession } from '../lib/firehose-session.js'import { withMeta } from '../lib/response.js'-export const paidRoutes = new OpenAPIHono()+export const paidRoutes = new OpenAPIHono({ defaultHook: apiValidationHook })const JsonBody = z.record(z.string(), z.unknown())const errorResponse = { content: { 'application/json': { schema: ErrorSchema } }, description: 'Error' } as constdiff --git a/robinhood/hood-api/test/api.test.ts b/robinhood/hood-api/test/api.test.tsindex 408cc77b3..a424dcddb 100644--- a/robinhood/hood-api/test/api.test.ts+++ b/robinhood/hood-api/test/api.test.ts@@ -87,7 +87,9 @@ describe('free endpoints (live)', () => {it('GET /v1/coins/not-an-address returns a structured 400', async () => {const { status, body } = await get('/v1/coins/not-an-address')expect(status).toBe(400)- expect(body.error).toBe('invalid_address')+ expect(body.error).toBe('invalid_request')+ expect(typeof body.hint).toBe('string')+ expect(typeof body.docs).toBe('string')})it('GET /v1/launches returns a well-formed (possibly empty) live list', async () => {diff --git a/robinhood/hood-cli/scripts/e2e.mjs b/robinhood/hood-cli/scripts/e2e.mjsnew file mode 100644index 000000000..c1a0b2bad--- /dev/null+++ b/robinhood/hood-cli/scripts/e2e.mjs@@ -0,0 +1,200 @@+#!/usr/bin/env node+/**+ * Real end-to-end test of the BUILT binary — no mocks, no fixtures. Drives+ * `dist/cli.js` as a subprocess against the live Robinhood Chain mainnet RPC+ * and (when a funded key is present) a real testnet write. Prints a PASS/FAIL+ * table and exits non-zero on any failure, so it can gate a release.+ *+ * Run: npm run build && npm run e2e+ * Testnet writes: export ROBINHOOD_CHAIN_PRIVATE_KEY=0x... (funded via the+ * faucet — see `hood faucet --network testnet`) before running.+ */+import { spawnSync } from 'node:child_process'+import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join, dirname } from 'node:path'+import { fileURLToPath } from 'node:url'++const here = dirname(fileURLToPath(import.meta.url))+const root = join(here, '..')+const bin = join(root, 'dist', 'cli.js')++if (!existsSync(bin)) {+ console.error(`dist/cli.js not found — run "npm run build" first.`)+ process.exit(1)+}++const workDir = mkdtempSync(join(tmpdir(), 'hood-cli-e2e-'))+// Strip ROBINHOOD_CHAIN_PRIVATE_KEY from the base env: env.wallet() checks it+// BEFORE the keystore, so leaving it set would silently satisfy the+// "refuses without a wallet" guard-rail test below even with no keystore+// configured. It's injected explicitly, only for the testnet section.+const { ROBINHOOD_CHAIN_PRIVATE_KEY: _testnetKeyFromEnv, ...restEnv } = process.env+const env = { ...restEnv, HOOD_CONFIG_DIR: join(workDir, 'config') }++const results = []++function run(label, args, { expectExit = 0, mustContain = [], mustNotContain = [], stdin, timeout = 60_000 } = {}) {+ const started = Date.now()+ const proc = spawnSync('node', [bin, ...args], {+ env,+ encoding: 'utf8',+ input: stdin,+ timeout,+ })+ const ms = Date.now() - started+ const output = `${proc.stdout ?? ''}${proc.stderr ?? ''}`+ const exit = proc.status ?? -1++ const failures = []+ if (Array.isArray(expectExit) ? !expectExit.includes(exit) : exit !== expectExit) {+ failures.push(`expected exit ${JSON.stringify(expectExit)}, got ${exit}`)+ }+ for (const needle of mustContain) {+ if (!output.includes(needle)) failures.push(`missing expected text: ${JSON.stringify(needle)}`)+ }+ for (const needle of mustNotContain) {+ if (output.includes(needle)) failures.push(`contains forbidden text: ${JSON.stringify(needle)}`)+ }++ const ok = failures.length === 0+ results.push({ label, ok, ms, failures, command: `hood ${args.join(' ')}`, output })+ process.stdout.write(`${ok ? '✓' : '✗'} ${label} (${ms}ms)\n`)+ if (!ok) for (const f of failures) process.stdout.write(` ${f}\n`)+ return proc+}++console.log(`\n== hood-cli E2E — real mainnet reads (RPC: public robinhood mainnet) ==\n`)++run('price: real mainnet AAPL quote', ['price', 'AAPL'], { mustContain: ['Oracle'] })+run('price --json: valid JSON with a live oracle number', ['price', 'AAPL', '--json'], {+ mustContain: ['"symbol": "AAPL"'],+})+run('stocks: full board renders', ['stocks', '--limit', '5'], { mustContain: ['Stock Tokens'] })+run('portfolio: real read on the known Uniswap deployer address', [+ 'portfolio',+ '0x9701fb0aDe1E269c8f64Ec0C7b3cfADB31A13A52',+], { mustContain: ['Portfolio'] })+run('token: AAPL metadata + oracle', ['token', 'AAPL'], { mustContain: ['Oracle'] })+run('launches: wide-window scan finds real NOXA launches', [+ 'launches',+ '--lookback',+ '2000000',+ '--limit',+ '3',+], { mustContain: ['Launches'] })+run('coins --new: newest launches screener', ['coins', '--new', '--lookback', '2000000', '--limit', '3'], {+ mustContain: ['New coins'],+})+run('tx: decodes a real historical NOXA launch transaction', [+ 'tx',+ '0x870a3bee3070f10e3c4f34271cfde70fd5aa0dc2eade6f07d01ae6c9a00285bd',+], { mustContain: ['Transaction', 'success'] })+run('swap: live quote on the real liquid USDG/WETH pool (no --execute)', [+ 'swap',+ '--sell',+ 'USDG',+ '--buy',+ 'WETH',+ '--amount',+ '100',+], { mustContain: ['Swap quote'] })++console.log(`\n== Guard rails ==\n`)++run('price: unknown ticker exits NOT_FOUND (5)', ['price', 'NOT_A_REAL_TICKER'], { expectExit: 5 })+run('portfolio: invalid address exits USAGE (2)', ['portfolio', 'not-an-address'], { expectExit: 2 })+run('config: unknown key exits USAGE (2)', ['config', 'set', 'bogus', 'x'], { expectExit: 2 })+run('deploy-token: dry-run plan without --execute never asks for a wallet', [+ 'deploy-token',+ '--config',+ writeTokenConfig(),+], { mustContain: ['Deploy plan'], mustNotContain: ['Wallet password'] })+run('transfer: refuses without a configured wallet (WALLET exit 6)', [+ 'transfer',+ '--to',+ '0x000000000000000000000000000000000000dEaD',+ '--amount',+ '1',+ '--yes',+], { expectExit: 6 })++console.log(`\n== Wallet-backed flows ==\n`)++run('config set wallet: generates + encrypts a new keystore', ['config', 'set', 'wallet'], {+ stdin: 'testpassword123\ntestpassword123\n',+ mustContain: ['Wallet generated'],+})+run('config get walletAddress: reads the generated address back', ['config', 'get', 'walletAddress'], {+ mustContain: ['0x'],+})+run('transfer: insufficient balance on the freshly generated (empty) wallet', [+ 'transfer',+ '--to',+ '0x000000000000000000000000000000000000dEaD',+ '--amount',+ '1',+ '--yes',+], {+ expectExit: 4,+ mustContain: ['Insufficient balance'],+})++console.log(`\n== Testnet write (gated on a funded key) ==\n`)++const testnetKey = process.env.ROBINHOOD_CHAIN_PRIVATE_KEY+if (!testnetKey) {+ console.log(+ '⊘ SKIPPED — ROBINHOOD_CHAIN_PRIVATE_KEY not set. The testnet faucet requires a browser session\n' ++ ' (Cloudflare Turnstile + Google Sign-In) and cannot be automated headlessly; this is an owner\n' ++ ' action, not a code gap. Fund a key at https://faucet.testnet.chain.robinhood.com/, export it,\n' ++ ' and re-run `npm run e2e` to exercise a REAL signed testnet transfer + swap.\n',+ )+ results.push({ label: 'testnet transfer + swap (real signed tx)', ok: null, skipped: true })+} else {+ const importEnv = { ...env, ROBINHOOD_CHAIN_IMPORT_KEY: testnetKey }+ const importProc = spawnSync('node', [bin, '--network', 'testnet', 'config', 'set', 'wallet'], {+ env: importEnv,+ encoding: 'utf8',+ input: 'testpassword123\ntestpassword123\n',+ })+ console.log(importProc.stdout, importProc.stderr)++ run('faucet --network testnet: real balance read for the imported key', ['--network', 'testnet', 'faucet'], {+ mustContain: ['ETH'],+ })+ run('transfer --network testnet --execute: REAL signed testnet transfer', [+ '--network',+ 'testnet',+ 'transfer',+ '--to',+ '0x000000000000000000000000000000000000dEaD',+ '--amount',+ '0.0001',+ '--execute',+ '--yes',+ ], {+ stdin: 'testpassword123\n',+ mustContain: ['confirmed'],+ timeout: 120_000,+ })+}++rmSync(workDir, { recursive: true, force: true })++console.log(`\n== Summary ==\n`)+const failed = results.filter((r) => r.ok === false)+const skipped = results.filter((r) => r.skipped)+const passed = results.filter((r) => r.ok === true)+console.log(`${passed.length} passed, ${failed.length} failed, ${skipped.length} skipped (owner-blocked)\n`)+if (failed.length > 0) {+ console.error('FAILED:')+ for (const f of failed) console.error(` - ${f.label}: ${f.failures.join('; ')}`)+ process.exit(1)+}++function writeTokenConfig() {+ const path = join(workDir, 'token.json')+ writeFileSync(path, JSON.stringify({ name: 'E2E Test Token', symbol: 'E2E', initialSupply: 1000 }))+ return path+}diff --git a/robinhood/hood-cli/src/cli.ts b/robinhood/hood-cli/src/cli.tsindex cbac5d59a..a2abd4244 100644--- a/robinhood/hood-cli/src/cli.ts+++ b/robinhood/hood-cli/src/cli.ts@@ -1,56 +1,7 @@-import { Command } from 'commander'-import { readFileSync } from 'node:fs'-import { fileURLToPath } from 'node:url'-import { dirname, join } from 'node:path'-import { priceCommand } from './commands/price.js'-import { stocksCommand } from './commands/stocks.js'-import { coinsCommand } from './commands/coins.js'-import { launchesCommand } from './commands/launches.js'-import { portfolioCommand } from './commands/portfolio.js'-import { txCommand } from './commands/tx.js'-import { tokenCommand } from './commands/token.js'-import { watchCommand } from './commands/watch.js'-import { swapCommand } from './commands/swap.js'-import { transferCommand } from './commands/transfer.js'-import { faucetCommand } from './commands/faucet.js'-import { deployTokenCommand } from './commands/deploy-token.js'-import { configCommand } from './commands/config.js'+import { createProgram } from './program.js'import { presentError } from './output.js'-const here = dirname(fileURLToPath(import.meta.url))-const pkg = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8')) as { version: string }--const program = new Command()--program- .name('hood')- .description('The command-line toolkit for Robinhood Chain (4663) — instant reads, guarded writes.')- .version(pkg.version, '-v, --version')- .option('--json', 'machine-readable JSON output')- .option('--network <net>', 'mainnet | testnet', 'mainnet')- .option('--rpc <url>', 'override the RPC endpoint')- .option('--verbose', 'show raw error causes')- .option('--yes', 'skip interactive confirmation on writes (still requires --execute)')- .option('--acknowledge-eligibility', 'affirm Stock Token acquisition eligibility (non-US/CA/UK/CH)')- .option('--no-color', 'disable ANSI colour')- .showHelpAfterError('(run `hood --help` for usage)')- .configureOutput({- outputError: (str, write) => write(str),- })--program.addCommand(priceCommand())-program.addCommand(stocksCommand())-program.addCommand(coinsCommand())-program.addCommand(launchesCommand())-program.addCommand(portfolioCommand())-program.addCommand(txCommand())-program.addCommand(tokenCommand())-program.addCommand(watchCommand())-program.addCommand(swapCommand())-program.addCommand(transferCommand())-program.addCommand(faucetCommand())-program.addCommand(deployTokenCommand())-program.addCommand(configCommand())+const program = createProgram()program.exitOverride((err) => {// commander's own usage/version/help exits — let them through as-is.diff --git a/robinhood/hood-cli/src/commands/swap.ts b/robinhood/hood-cli/src/commands/swap.tsindex dc4213a9c..54ffd20e6 100644--- a/robinhood/hood-cli/src/commands/swap.ts+++ b/robinhood/hood-cli/src/commands/swap.ts@@ -12,6 +12,9 @@ import { accent, bold, dim, gray, green, yellow } from '../ui/ansi.js'import { num, addr } from '../format.js'import { txUrl } from '../blockscout.js'import { guardError, usageError } from '../errors.js'+import { checkSpendCap } from '../spend-cap.js'+import { getDexPriceUsd } from '../prices.js'+import { warn } from '../output.js'export function swapCommand(): Command {return new Command('swap')@@ -69,6 +72,14 @@ async function swap(ctx: Context, opts: SwapOpts): Promise<void> {return}+ // maxSpendUsd guard rail: estimate what's being sold in USD (USDG is 1:1;+ // anything else prices off its own DEX quote) and refuse over the cap.+ const estimatedUsd = await estimateSpendUsd(client, tokenIn.symbol, tokenIn.address, tokenIn.decimals, Number(opts.amount))+ if (ctx.config.maxSpendUsd !== undefined && estimatedUsd === null) {+ warn(`Could not verify this swap against your $${ctx.config.maxSpendUsd} spend cap (no price route for ${tokenIn.symbol}) — proceeding.`)+ }+ checkSpendCap({ maxSpendUsd: ctx.config.maxSpendUsd, estimatedUsd })+// Write path: money-moving action — render the confirmation table and stop// for explicit yes/no before signing, per CLAUDE.md's irreversible-action gate.if (!ctx.json) process.stdout.write(renderQuote(summary, true) + '\n\n')@@ -103,6 +114,18 @@ async function swap(ctx: Context, opts: SwapOpts): Promise<void> {}}+async function estimateSpendUsd(+ client: Parameters<typeof getDexPriceUsd>[0],+ symbol: string,+ address: `0x${string}`,+ decimals: number,+ amount: number,+): Promise<number | null> {+ if (symbol === 'USDG') return amount+ const perToken = await getDexPriceUsd(client, address, decimals)+ return perToken !== null ? perToken * amount : null+}+function renderQuote(s: { network: string; sell: { symbol: string; amount: string }; buy: { symbol: string; amount: string; minimum: string }; rate: number; hops: number; slippageBps: number },confirming: boolean,diff --git a/robinhood/hood-cli/src/commands/transfer.ts b/robinhood/hood-cli/src/commands/transfer.tsindex b0a36c996..61d3a1afc 100644--- a/robinhood/hood-cli/src/commands/transfer.ts+++ b/robinhood/hood-cli/src/commands/transfer.ts@@ -12,6 +12,10 @@ import { bold, dim, gray, green, yellow } from '../ui/ansi.js'import { addr } from '../format.js'import { txUrl } from '../blockscout.js'import { guardError, usageError } from '../errors.js'+import { checkSpendCap } from '../spend-cap.js'+import { getDexPriceUsd } from '../prices.js'+import { MAINNET_ADDRESSES, TESTNET_ADDRESSES } from 'hoodchain'+import { warn } from '../output.js'export function transferCommand(): Command {return new Command('transfer')@@ -52,6 +56,15 @@ async function transfer(ctx: Context, opts: TransferOpts): Promise<void> {)}+ // maxSpendUsd guard rail: USDG is 1:1, native ETH/other tokens price off+ // their own DEX quote against USDG.+ const spendToken = isNative ? (ctx.network === 'testnet' ? TESTNET_ADDRESSES.weth : MAINNET_ADDRESSES.weth) : tokenInfo!.address+ const estimatedUsd = await estimateSpendUsd(client, symbol, spendToken, isNative ? 18 : tokenInfo!.decimals, Number(opts.amount))+ if (ctx.config.maxSpendUsd !== undefined && estimatedUsd === null) {+ warn(`Could not verify this transfer against your $${ctx.config.maxSpendUsd} spend cap (no price route for ${symbol}) — proceeding.`)+ }+ checkSpendCap({ maxSpendUsd: ctx.config.maxSpendUsd, estimatedUsd })+if (!ctx.json) {process.stdout.write(renderConfirm({ to, amount: opts.amount, symbol, network: ctx.network }) + '\n\n',@@ -74,6 +87,18 @@ async function transfer(ctx: Context, opts: TransferOpts): Promise<void> {if (receipt.status !== 'success') process.exitCode = 1}+async function estimateSpendUsd(+ client: Parameters<typeof getDexPriceUsd>[0],+ symbol: string,+ address: `0x${string}`,+ decimals: number,+ amount: number,+): Promise<number | null> {+ if (symbol === 'USDG') return amount+ const perToken = await getDexPriceUsd(client, address, decimals)+ return perToken !== null ? perToken * amount : null+}+function formatBalance(balance: bigint, isNative: boolean, decimals?: number): string {return isNative ? formatEther(balance) : formatUnits(balance, decimals ?? 18)}diff --git a/robinhood/hood-cli/src/program.ts b/robinhood/hood-cli/src/program.tsnew file mode 100644index 000000000..49dc797c6--- /dev/null+++ b/robinhood/hood-cli/src/program.ts@@ -0,0 +1,65 @@+/**+ * Program construction, separated from `cli.ts`'s execution so tests can+ * introspect the option/command wiring without triggering a real parse (and+ * its network calls) as a side effect of importing the module.+ */+import { Command } from 'commander'+import { readFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import { dirname, join } from 'node:path'+import { priceCommand } from './commands/price.js'+import { stocksCommand } from './commands/stocks.js'+import { coinsCommand } from './commands/coins.js'+import { launchesCommand } from './commands/launches.js'+import { portfolioCommand } from './commands/portfolio.js'+import { txCommand } from './commands/tx.js'+import { tokenCommand } from './commands/token.js'+import { watchCommand } from './commands/watch.js'+import { swapCommand } from './commands/swap.js'+import { transferCommand } from './commands/transfer.js'+import { faucetCommand } from './commands/faucet.js'+import { deployTokenCommand } from './commands/deploy-token.js'+import { configCommand } from './commands/config.js'++function readVersion(): string {+ const here = dirname(fileURLToPath(import.meta.url))+ const pkg = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8')) as { version: string }+ return pkg.version+}++/** Build the fully-wired `hood` commander program (does not parse or run). */+export function createProgram(): Command {+ const program = new Command()++ program+ .name('hood')+ .description('The command-line toolkit for Robinhood Chain (4663) — instant reads, guarded writes.')+ .version(readVersion(), '-v, --version')+ .option('--json', 'machine-readable JSON output')+ .option('--network <net>', 'mainnet | testnet', 'mainnet')+ .option('--rpc <url>', 'override the RPC endpoint')+ .option('--verbose', 'show raw error causes')+ .option('--yes', 'skip interactive confirmation on writes (still requires --execute)')+ .option('--acknowledge-eligibility', 'affirm Stock Token acquisition eligibility (non-US/CA/UK/CH)')+ .option('--no-color', 'disable ANSI colour')+ .showHelpAfterError('(run `hood --help` for usage)')+ .configureOutput({+ outputError: (str, write) => write(str),+ })++ program.addCommand(priceCommand())+ program.addCommand(stocksCommand())+ program.addCommand(coinsCommand())+ program.addCommand(launchesCommand())+ program.addCommand(portfolioCommand())+ program.addCommand(txCommand())+ program.addCommand(tokenCommand())+ program.addCommand(watchCommand())+ program.addCommand(swapCommand())+ program.addCommand(transferCommand())+ program.addCommand(faucetCommand())+ program.addCommand(deployTokenCommand())+ program.addCommand(configCommand())++ return program+}diff --git a/robinhood/hood-cli/src/spend-cap.ts b/robinhood/hood-cli/src/spend-cap.tsnew file mode 100644index 000000000..56e57a1f0--- /dev/null+++ b/robinhood/hood-cli/src/spend-cap.ts@@ -0,0 +1,32 @@+/**+ * The `maxSpendUsd` guard rail (`hood config set maxSpendUsd <n>`): a hard+ * ceiling on the USD value of a single swap or transfer. The USD-estimation+ * step is network-bound (oracle/DEX price lookups) and lives in the command+ * modules; this function is the pure decision so it is unit-testable without+ * a live RPC.+ */+import { guardError } from './errors.js'++export interface SpendCapCheck {+ /** The configured cap, or undefined when no cap is set (no-op). */+ maxSpendUsd: number | undefined+ /** Estimated USD value of the spend, or null when it could not be priced. */+ estimatedUsd: number | null+}++/**+ * Throws a GUARD error when `estimatedUsd` exceeds `maxSpendUsd`. A `null`+ * estimate (unpriceable token) never blocks — callers should surface a+ * warning instead, since refusing an unpriceable send would make the cap+ * unusable for memecoins with no oracle or liquid pool.+ */+export function checkSpendCap({ maxSpendUsd, estimatedUsd }: SpendCapCheck): void {+ if (maxSpendUsd === undefined) return+ if (estimatedUsd === null) return+ if (estimatedUsd > maxSpendUsd) {+ throw guardError(+ `This spends ~$${estimatedUsd.toFixed(2)}, which exceeds your configured cap of $${maxSpendUsd.toFixed(2)}.`,+ 'Raise the cap with `hood config set maxSpendUsd <n>`, or reduce --amount.',+ )+ }+}diff --git a/robinhood/hood-cli/tests/unit/ansi.test.ts b/robinhood/hood-cli/tests/unit/ansi.test.tsnew file mode 100644index 000000000..001f0e058--- /dev/null+++ b/robinhood/hood-cli/tests/unit/ansi.test.ts@@ -0,0 +1,56 @@+import { describe, expect, it } from 'vitest'+import { bold, dim, green, red, stripAnsi, width, padEnd, padStart, truncate, setColorEnabled, colorIsEnabled } from '../../src/ui/ansi.js'++describe('color toggling', () => {+ it('emits no escape codes when disabled', () => {+ setColorEnabled(false)+ expect(colorIsEnabled()).toBe(false)+ expect(bold('hi')).toBe('hi')+ expect(red('hi')).toBe('hi')+ })+ it('emits escape codes when enabled', () => {+ setColorEnabled(true)+ expect(bold('hi')).toContain('\x1b[1m')+ expect(green('hi')).toContain('\x1b[32m')+ setColorEnabled(false)+ })+})++describe('stripAnsi / width', () => {+ it('strips escape codes and measures visible width', () => {+ setColorEnabled(true)+ const styled = dim('hello')+ expect(stripAnsi(styled)).toBe('hello')+ expect(width(styled)).toBe(5)+ setColorEnabled(false)+ })+ it('measures plain text unchanged', () => {+ expect(width('hello')).toBe(5)+ })+})++describe('padEnd / padStart', () => {+ it('pads plain text to a target width', () => {+ expect(padEnd('ab', 5)).toBe('ab ')+ expect(padStart('ab', 5)).toBe(' ab')+ })+ it('pads ANSI-styled text by visible width, not raw length', () => {+ setColorEnabled(true)+ const styled = bold('ab') // raw length > 2 due to escape codes+ const padded = padEnd(styled, 5)+ expect(width(padded)).toBe(5)+ setColorEnabled(false)+ })+ it('does not truncate when already at/over width', () => {+ expect(padEnd('abcdef', 3)).toBe('abcdef')+ })+})++describe('truncate', () => {+ it('leaves short strings untouched', () => {+ expect(truncate('hi', 10)).toBe('hi')+ })+ it('truncates with an ellipsis', () => {+ expect(truncate('hello world', 8)).toBe('hello w…')+ })+})diff --git a/robinhood/hood-cli/tests/unit/commands.test.ts b/robinhood/hood-cli/tests/unit/commands.test.tsnew file mode 100644index 000000000..bbd3aac82--- /dev/null+++ b/robinhood/hood-cli/tests/unit/commands.test.ts@@ -0,0 +1,71 @@+/**+ * Guard-rail wiring tests at the commander parsing layer: writes must default+ * to a dry run (`--execute` required + defaults false), required flags must+ * actually be required, and the eligibility/confirmation flags must exist+ * with safe defaults. These check the parser contract without touching the+ * network — full execute-path behaviour is covered by the live E2E script.+ */+import { describe, expect, it } from 'vitest'+import type { Option } from 'commander'+import { swapCommand } from '../../src/commands/swap.js'+import { transferCommand } from '../../src/commands/transfer.js'+import { deployTokenCommand } from '../../src/commands/deploy-token.js'+import { faucetCommand } from '../../src/commands/faucet.js'++function findOption(options: Option[], flag: string): Option | undefined {+ return options.find((o) => o.long === flag || o.short === flag)+}++describe('swap command — execute gate', () => {+ const cmd = swapCommand()+ it('defaults --execute to false (quote-only by default)', () => {+ const opt = findOption(cmd.options, '--execute')+ expect(opt).toBeDefined()+ expect(opt!.defaultValue).toBe(false)+ })+ it('requires --sell, --buy, and --amount', () => {+ for (const flag of ['--sell', '--buy', '--amount']) {+ const opt = findOption(cmd.options, flag)+ expect(opt, `missing option ${flag}`).toBeDefined()+ expect(opt!.mandatory, `${flag} should be mandatory`).toBe(true)+ }+ })+ it('exposes --slippage with a conservative default', () => {+ const opt = findOption(cmd.options, '--slippage')+ expect(opt!.defaultValue).toBe('50') // 0.5%+ })+})++describe('transfer command — execute gate (implicit: no --execute flag, wallet + confirm always gate)', () => {+ const cmd = transferCommand()+ it('requires --to and --amount', () => {+ for (const flag of ['--to', '--amount']) {+ const opt = findOption(cmd.options, flag)+ expect(opt, `missing option ${flag}`).toBeDefined()+ expect(opt!.mandatory, `${flag} should be mandatory`).toBe(true)+ }+ })+ it('--token is optional (defaults to native ETH)', () => {+ const opt = findOption(cmd.options, '--token')+ expect(opt!.mandatory).toBe(false)+ })+})++describe('deploy-token command — execute gate', () => {+ const cmd = deployTokenCommand()+ it('defaults --execute to false (plan-only by default)', () => {+ const opt = findOption(cmd.options, '--execute')+ expect(opt!.defaultValue).toBe(false)+ })+ it('requires --config', () => {+ const opt = findOption(cmd.options, '--config')+ expect(opt!.mandatory).toBe(true)+ })+})++describe('faucet command', () => {+ it('takes no required arguments (pure instructions + balance read)', () => {+ const cmd = faucetCommand()+ expect(cmd.options.every((o) => !o.required)).toBe(true)+ })+})diff --git a/robinhood/hood-cli/tests/unit/config.test.ts b/robinhood/hood-cli/tests/unit/config.test.tsnew file mode 100644index 000000000..0c20c00bd--- /dev/null+++ b/robinhood/hood-cli/tests/unit/config.test.ts@@ -0,0 +1,56 @@+import { describe, expect, it } from 'vitest'+import { setConfigValue, redactedConfig, type HoodConfig } from '../../src/config.js'++describe('setConfigValue', () => {+ it('accepts a valid network', () => {+ const next = setConfigValue({}, 'network', 'testnet')+ expect(next.network).toBe('testnet')+ })++ it('rejects an invalid network value', () => {+ expect(() => setConfigValue({}, 'network', 'devnet')).toThrow(/mainnet.*testnet/)+ })++ it('parses maxSpendUsd as a number', () => {+ const next = setConfigValue({}, 'maxSpendUsd', '250.5')+ expect(next.maxSpendUsd).toBe(250.5)+ })++ it('rejects a negative maxSpendUsd', () => {+ expect(() => setConfigValue({}, 'maxSpendUsd', '-10')).toThrow(/non-negative/)+ })++ it('rejects a non-numeric maxSpendUsd', () => {+ expect(() => setConfigValue({}, 'maxSpendUsd', 'a lot')).toThrow(/non-negative/)+ })++ it('rejects an unknown key', () => {+ expect(() => setConfigValue({}, 'bogus', 'x')).toThrow(/Unknown config key/)+ })++ it('does not mutate the input config', () => {+ const original: HoodConfig = { network: 'mainnet' }+ const next = setConfigValue(original, 'network', 'testnet')+ expect(original.network).toBe('mainnet')+ expect(next.network).toBe('testnet')+ })+})++describe('redactedConfig', () => {+ it('masks the alchemy key', () => {+ const view = redactedConfig({ alchemyKey: 'abcdefghijklmnop' })+ expect(view.alchemyKey).toBe('abc…nop')+ expect(view.alchemyKey).not.toContain('def')+ })++ it('never leaks a private key field', () => {+ const view = redactedConfig({ walletAddress: '0xabc' })+ expect(JSON.stringify(view)).not.toMatch(/privateKey/i)+ })++ it('reports null for unset optional fields', () => {+ const view = redactedConfig({})+ expect(view.rpc).toBeNull()+ expect(view.walletAddress).toBeNull()+ })+})diff --git a/robinhood/hood-cli/tests/unit/errors.test.ts b/robinhood/hood-cli/tests/unit/errors.test.tsnew file mode 100644index 000000000..6522478e5--- /dev/null+++ b/robinhood/hood-cli/tests/unit/errors.test.ts@@ -0,0 +1,72 @@+import { describe, expect, it } from 'vitest'+import { CliError, EXIT, toCliError, usageError, guardError } from '../../src/errors.js'++describe('CliError', () => {+ it('defaults to the generic ERROR exit code', () => {+ const err = new CliError('boom')+ expect(err.exitCode).toBe(EXIT.ERROR)+ })+ it('carries a hint and cause through', () => {+ const cause = new Error('root cause')+ const err = new CliError('boom', { exitCode: EXIT.GUARD, hint: 'try X', cause })+ expect(err.hint).toBe('try X')+ expect(err.cause).toBe(cause)+ expect(err.exitCode).toBe(EXIT.GUARD)+ })+})++describe('constructors', () => {+ it('usageError uses the USAGE exit code', () => {+ expect(usageError('bad args').exitCode).toBe(EXIT.USAGE)+ })+ it('guardError uses the GUARD exit code', () => {+ expect(guardError('refused').exitCode).toBe(EXIT.GUARD)+ })+})++describe('toCliError', () => {+ it('passes an existing CliError through unchanged', () => {+ const original = guardError('already a CliError')+ expect(toCliError(original)).toBe(original)+ })++ it('maps StockTokenEligibilityError to a GUARD exit with an eligibility hint', () => {+ const sdkError = Object.assign(new Error('gated'), { name: 'StockTokenEligibilityError' })+ const mapped = toCliError(sdkError)+ expect(mapped.exitCode).toBe(EXIT.GUARD)+ expect(mapped.hint).toMatch(/acknowledge-eligibility/)+ })++ it('maps UnknownSymbolError to NOT_FOUND', () => {+ const sdkError = Object.assign(new Error('no such symbol'), { name: 'UnknownSymbolError' })+ expect(toCliError(sdkError).exitCode).toBe(EXIT.NOT_FOUND)+ })++ it('maps NoAccountError to WALLET with a config hint', () => {+ const sdkError = Object.assign(new Error('no account'), { name: 'NoAccountError' })+ const mapped = toCliError(sdkError)+ expect(mapped.exitCode).toBe(EXIT.WALLET)+ expect(mapped.hint).toMatch(/hood config set wallet/)+ })++ it('maps NoRouteError to NOT_FOUND', () => {+ const sdkError = Object.assign(new Error('no route'), { name: 'NoRouteError' })+ expect(toCliError(sdkError).exitCode).toBe(EXIT.NOT_FOUND)+ })++ it('maps a generic network failure message to NETWORK', () => {+ const err = new Error('fetch failed: ECONNREFUSED')+ expect(toCliError(err).exitCode).toBe(EXIT.NETWORK)+ })++ it('falls back to ERROR for an unrecognised failure', () => {+ const err = new Error('something unexpected')+ expect(toCliError(err).exitCode).toBe(EXIT.ERROR)+ })++ it('wraps a non-Error thrown value', () => {+ const mapped = toCliError('a plain string throw')+ expect(mapped.message).toBe('a plain string throw')+ expect(mapped.exitCode).toBe(EXIT.ERROR)+ })+})diff --git a/robinhood/hood-cli/tests/unit/format.test.ts b/robinhood/hood-cli/tests/unit/format.test.tsnew file mode 100644index 000000000..ed0e626b9--- /dev/null+++ b/robinhood/hood-cli/tests/unit/format.test.ts@@ -0,0 +1,97 @@+import { describe, expect, it } from 'vitest'+import { parseUnits } from 'viem'+import { usd, num, compact, pct, shortAddress, age, tokenAmount } from '../../src/format.js'+import { setColorEnabled } from '../../src/ui/ansi.js'++setColorEnabled(false)++describe('usd', () => {+ it('formats a normal price with 2 decimals', () => {+ expect(usd(315.5)).toBe('$315.50')+ })+ it('widens precision for sub-cent values', () => {+ expect(usd(0.0001234)).toBe('$0.000123')+ })+ it('uses 4 decimals under a dollar', () => {+ expect(usd(0.5)).toBe('$0.5000')+ })+ it('handles zero', () => {+ expect(usd(0)).toBe('$0.00')+ })+ it('returns an em dash for non-finite input', () => {+ expect(usd(NaN)).toBe('—')+ expect(usd(Infinity)).toBe('—')+ })+ it('groups thousands', () => {+ expect(usd(1234567.89)).toBe('$1,234,567.89')+ })+})++describe('num', () => {+ it('groups thousands with a bounded fraction', () => {+ expect(num(1234.56789, 2)).toBe('1,234.57')+ })+ it('defaults to 4 max fraction digits', () => {+ expect(num(1.123456789)).toBe('1.1235')+ })+})++describe('compact', () => {+ it('compacts large numbers', () => {+ expect(compact(1_234_567)).toBe('1.23M')+ })+})++describe('pct', () => {+ it('formats a positive ratio with a plus sign', () => {+ expect(pct(0.0123).replace(/\x1b\[[0-9;]*m/g, '')).toBe('+1.23%')+ })+ it('formats a negative ratio', () => {+ expect(pct(-0.05).replace(/\x1b\[[0-9;]*m/g, '')).toBe('-5.00%')+ })+ it('formats exact zero without a sign', () => {+ expect(pct(0)).toBe('0.00%')+ })+})++describe('shortAddress', () => {+ it('middle-truncates a 42-char address', () => {+ expect(shortAddress('0xaF3D76f1834A1d425780943C99Ea8A608f8a93f9')).toBe('0xaF3D…93f9')+ })+ it('leaves short strings untouched', () => {+ expect(shortAddress('0xabc')).toBe('0xabc')+ })+})++describe('age', () => {+ it('renders seconds under a minute', () => {+ expect(age(42)).toBe('42s')+ })+ it('renders minutes under an hour', () => {+ expect(age(125)).toBe('2m')+ })+ it('renders hours and minutes under a day', () => {+ expect(age(3 * 3600 + 5 * 60)).toBe('3h 5m')+ })+ it('renders days and hours', () => {+ expect(age(2 * 86400 + 4 * 3600)).toBe('2d 4h')+ })+ it('returns an em dash for negative input', () => {+ expect(age(-1)).toBe('—')+ })+})++describe('tokenAmount', () => {+ it('renders a whole-token amount with no trailing zeros', () => {+ expect(tokenAmount(parseUnits('1', 18), 18)).toBe('1')+ })+ it('trims trailing zeros in the fraction', () => {+ expect(tokenAmount(parseUnits('1.5', 18), 18)).toBe('1.5')+ })+ it('caps fractional precision', () => {+ expect(tokenAmount(parseUnits('1.123456789', 18), 18, 4)).toBe('1.1234')+ })+ it('formats USDG-style 6-decimal amounts', () => {+ expect(tokenAmount(parseUnits('100', 6), 6)).toBe('100')+ })+})diff --git a/robinhood/hood-cli/tests/unit/keystore.test.ts b/robinhood/hood-cli/tests/unit/keystore.test.tsnew file mode 100644index 000000000..299101b09--- /dev/null+++ b/robinhood/hood-cli/tests/unit/keystore.test.ts@@ -0,0 +1,87 @@+import { describe, expect, it, afterEach } from 'vitest'+import { mkdtempSync, rmSync, statSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'+import { writeKeystore, decryptKeystore, keystoreAddress, keystoreExists, passwordsMatch } from '../../src/keystore.js'++const dirs: string[] = []+function tmpKeystorePath(): string {+ const dir = mkdtempSync(join(tmpdir(), 'hood-cli-keystore-'))+ dirs.push(dir)+ return join(dir, 'keystore.json')+}+afterEach(() => {+ for (const d of dirs.splice(0)) rmSync(d, { recursive: true, force: true })+})++describe('keystore encrypt/decrypt round trip', () => {+ it('recovers the exact private key with the right password', () => {+ const path = tmpKeystorePath()+ const pk = generatePrivateKey()+ const account = privateKeyToAccount(pk)+ writeKeystore(path, pk, account.address, 'correct horse battery staple')++ const recovered = decryptKeystore(path, 'correct horse battery staple')+ expect(recovered.toLowerCase()).toBe(pk.toLowerCase())+ })++ it('refuses to decrypt with the wrong password', () => {+ const path = tmpKeystorePath()+ const pk = generatePrivateKey()+ const account = privateKeyToAccount(pk)+ writeKeystore(path, pk, account.address, 'correct horse battery staple')++ expect(() => decryptKeystore(path, 'wrong password entirely')).toThrow(/Wrong wallet password/)+ })++ it('rejects a password shorter than 8 characters', () => {+ const path = tmpKeystorePath()+ const pk = generatePrivateKey()+ const account = privateKeyToAccount(pk)+ expect(() => writeKeystore(path, pk, account.address, 'short')).toThrow(/at least 8 characters/)+ })++ it('exposes the address without needing the password', () => {+ const path = tmpKeystorePath()+ const pk = generatePrivateKey()+ const account = privateKeyToAccount(pk)+ writeKeystore(path, pk, account.address, 'correct horse battery staple')++ expect(keystoreAddress(path).toLowerCase()).toBe(account.address.toLowerCase())+ })++ it('writes the file with owner-only permissions (0600)', () => {+ const path = tmpKeystorePath()+ const pk = generatePrivateKey()+ const account = privateKeyToAccount(pk)+ writeKeystore(path, pk, account.address, 'correct horse battery staple')++ const mode = statSync(path).mode & 0o777+ expect(mode).toBe(0o600)+ })++ it('reports existence correctly', () => {+ const path = tmpKeystorePath()+ expect(keystoreExists(path)).toBe(false)+ const pk = generatePrivateKey()+ writeKeystore(path, pk, privateKeyToAccount(pk).address, 'correct horse battery staple')+ expect(keystoreExists(path)).toBe(true)+ })++ it('throws a clear error reading a missing keystore', () => {+ expect(() => keystoreAddress('/nonexistent/path/keystore.json')).toThrow(/No keystore/)+ })+})++describe('passwordsMatch', () => {+ it('matches identical strings', () => {+ expect(passwordsMatch('abc123', 'abc123')).toBe(true)+ })+ it('rejects different strings', () => {+ expect(passwordsMatch('abc123', 'abc124')).toBe(false)+ })+ it('rejects different-length strings', () => {+ expect(passwordsMatch('abc', 'abcdef')).toBe(false)+ })+})diff --git a/robinhood/hood-cli/tests/unit/program.test.ts b/robinhood/hood-cli/tests/unit/program.test.tsnew file mode 100644index 000000000..1c1111f6d--- /dev/null+++ b/robinhood/hood-cli/tests/unit/program.test.ts@@ -0,0 +1,49 @@+import { describe, expect, it } from 'vitest'+import type { Option } from 'commander'+import { createProgram } from '../../src/program.js'++function findOption(options: Option[], flag: string): Option | undefined {+ return options.find((o) => o.long === flag)+}++describe('global flags — eligibility + confirmation gates', () => {+ const program = createProgram()++ it('--acknowledge-eligibility defaults to unset (false)', () => {+ const opt = findOption(program.options, '--acknowledge-eligibility')+ expect(opt).toBeDefined()+ expect(!!opt!.defaultValue).toBe(false)+ })++ it('--yes defaults to unset (interactive confirm required by default)', () => {+ const opt = findOption(program.options, '--yes')+ expect(opt).toBeDefined()+ expect(!!opt!.defaultValue).toBe(false)+ })++ it('--network defaults to mainnet', () => {+ const opt = findOption(program.options, '--network')+ expect(opt!.defaultValue).toBe('mainnet')+ })++ it('registers every documented command', () => {+ const names = program.commands.map((c) => c.name()).sort()+ expect(names).toEqual(+ [+ 'coins',+ 'config',+ 'deploy-token',+ 'faucet',+ 'launches',+ 'portfolio',+ 'price',+ 'stocks',+ 'swap',+ 'token',+ 'transfer',+ 'tx',+ 'watch',+ ].sort(),+ )+ })+})diff --git a/robinhood/hood-cli/tests/unit/resolve.test.ts b/robinhood/hood-cli/tests/unit/resolve.test.tsnew file mode 100644index 000000000..2b19f6702--- /dev/null+++ b/robinhood/hood-cli/tests/unit/resolve.test.ts@@ -0,0 +1,56 @@+import { describe, expect, it } from 'vitest'+import { createHoodClient, MAINNET_ADDRESSES, TESTNET_ADDRESSES, TESTNET_STOCK_TOKENS } from 'hoodchain'+import { resolveToken } from '../../src/resolve.js'++describe('resolveToken (mainnet, offline-safe symbols)', () => {+ const client = createHoodClient()++ it('resolves USDG to the mainnet address with 6 decimals', async () => {+ const t = await resolveToken(client, 'usdg')+ expect(t.address.toLowerCase()).toBe(MAINNET_ADDRESSES.usdg.toLowerCase())+ expect(t.decimals).toBe(6)+ expect(t.isStock).toBe(false)+ })++ it('resolves WETH and ETH to the same address', async () => {+ const weth = await resolveToken(client, 'WETH')+ const eth = await resolveToken(client, 'eth')+ expect(weth.address).toBe(eth.address)+ expect(weth.address.toLowerCase()).toBe(MAINNET_ADDRESSES.weth.toLowerCase())+ })++ it('resolves a canonical Stock Token ticker case-insensitively', async () => {+ const t = await resolveToken(client, 'aapl')+ expect(t.symbol).toBe('AAPL')+ expect(t.isStock).toBe(true)+ expect(t.hasFeed).toBe(true)+ })++ it('rejects an invalid non-address, non-ticker string', async () => {+ await expect(resolveToken(client, 'NOT_A_REAL_TICKER')).rejects.toThrow(/Unknown token/)+ })++ it('rejects a malformed 0x-prefixed string as invalid, not unknown', async () => {+ await expect(resolveToken(client, '0xnotanaddress')).rejects.toThrow(/not a valid address/)+ })+})++describe('resolveToken (testnet)', () => {+ const client = createHoodClient({ chain: 'testnet' })++ it('resolves testnet USDG to the testnet address', async () => {+ const t = await resolveToken(client, 'USDG')+ expect(t.address.toLowerCase()).toBe(TESTNET_ADDRESSES.usdg.toLowerCase())+ })++ it('resolves a faucet-dripped testnet Stock Token', async () => {+ const t = await resolveToken(client, 'NFLX')+ expect(t.address.toLowerCase()).toBe(TESTNET_STOCK_TOKENS.NFLX.toLowerCase())+ expect(t.isStock).toBe(true)+ expect(t.hasFeed).toBe(false) // testnet tokens carry no Chainlink feed+ })++ it('does not resolve a mainnet-only ticker on testnet', async () => {+ await expect(resolveToken(client, 'AAPL')).rejects.toThrow(/Unknown token/)+ })+})diff --git a/robinhood/hood-cli/tests/unit/spend-cap.test.ts b/robinhood/hood-cli/tests/unit/spend-cap.test.tsnew file mode 100644index 000000000..d5333a364--- /dev/null+++ b/robinhood/hood-cli/tests/unit/spend-cap.test.ts@@ -0,0 +1,31 @@+import { describe, expect, it } from 'vitest'+import { checkSpendCap } from '../../src/spend-cap.js'+import { EXIT } from '../../src/errors.js'++describe('checkSpendCap (the --maxSpendUsd guard rail)', () => {+ it('is a no-op when no cap is configured', () => {+ expect(() => checkSpendCap({ maxSpendUsd: undefined, estimatedUsd: 1_000_000 })).not.toThrow()+ })++ it('is a no-op when the spend could not be priced (never blocks an unpriceable send)', () => {+ expect(() => checkSpendCap({ maxSpendUsd: 100, estimatedUsd: null })).not.toThrow()+ })++ it('allows a spend under the cap', () => {+ expect(() => checkSpendCap({ maxSpendUsd: 100, estimatedUsd: 99.99 })).not.toThrow()+ })++ it('allows a spend exactly at the cap', () => {+ expect(() => checkSpendCap({ maxSpendUsd: 100, estimatedUsd: 100 })).not.toThrow()+ })++ it('refuses a spend over the cap with a GUARD exit code', () => {+ try {+ checkSpendCap({ maxSpendUsd: 100, estimatedUsd: 100.01 })+ expect.unreachable('expected checkSpendCap to throw')+ } catch (err) {+ expect((err as { exitCode: number }).exitCode).toBe(EXIT.GUARD)+ expect((err as Error).message).toMatch(/exceeds your configured cap/)+ }+ })+})diff --git a/robinhood/hood-cli/tests/unit/table.test.ts b/robinhood/hood-cli/tests/unit/table.test.tsnew file mode 100644index 000000000..4b75abc6f--- /dev/null+++ b/robinhood/hood-cli/tests/unit/table.test.ts@@ -0,0 +1,70 @@+import { describe, expect, it } from 'vitest'+import { renderTable, renderKeyValue, type Column } from '../../src/ui/table.js'+import { setColorEnabled } from '../../src/ui/ansi.js'++setColorEnabled(false)++interface Row {+ symbol: string+ price: number+}++const rows: Row[] = [+ { symbol: 'AAPL', price: 315.5 },+ { symbol: 'TSLA', price: 1200 },+]++const columns: Column<Row>[] = [+ { header: 'SYMBOL', cell: (r) => r.symbol, priority: 100 },+ { header: 'PRICE', align: 'right', cell: (r) => String(r.price), priority: 90 },+]++describe('renderTable', () => {+ it('aligns a header and rule above the data rows', () => {+ const out = renderTable(rows, columns, { maxWidth: 80 })+ const lines = out.split('\n')+ expect(lines).toHaveLength(4) // header + rule + 2 rows+ expect(lines[0]).toContain('SYMBOL')+ expect(lines[1]).toMatch(/^─+$/)+ })++ it('right-aligns numeric columns', () => {+ const out = renderTable(rows, columns, { maxWidth: 80 })+ const priceLines = out.split('\n').slice(2)+ // "315.5" and "1200" should be right-padded so their right edges line up+ const col = columns[1]!+ expect(priceLines[0]!.trimEnd().endsWith('315.5')).toBe(true)+ expect(priceLines[1]!.trimEnd().endsWith('1200')).toBe(true)+ })++ it('drops low-priority columns before it would overflow', () => {+ const wideColumns: Column<Row>[] = [+ { header: 'SYMBOL', cell: (r) => r.symbol, priority: 100 },+ { header: 'A_VERY_LONG_LOW_PRIORITY_COLUMN_HEADER', cell: () => 'x'.repeat(60), priority: 1 },+ ]+ const out = renderTable(rows, wideColumns, { maxWidth: 20 })+ expect(out).not.toContain('A_VERY_LONG_LOW_PRIORITY_COLUMN_HEADER')+ expect(out).toContain('SYMBOL')+ })++ it('never drops the first column even under extreme width pressure', () => {+ const out = renderTable(rows, columns, { maxWidth: 1 })+ expect(out).toContain('SYMBOL')+ })++ it('handles an empty row set without throwing', () => {+ const out = renderTable([], columns)+ expect(out.split('\n')).toHaveLength(2) // header + rule, no body+ })+})++describe('renderKeyValue', () => {+ it('aligns values to a shared label width', () => {+ const out = renderKeyValue([['A', '1'], ['LongLabel', '2']])+ const lines = out.split('\n')+ // Both value columns should start at the same offset.+ const offsetA = lines[0]!.indexOf('1')+ const offsetB = lines[1]!.indexOf('2')+ expect(offsetA).toBe(offsetB)+ })+})diff --git a/robinhood/hood-launcher/src/rails/odyssey.ts b/robinhood/hood-launcher/src/rails/odyssey.tsindex 6d7b81f83..64476b18c 100644--- a/robinhood/hood-launcher/src/rails/odyssey.ts+++ b/robinhood/hood-launcher/src/rails/odyssey.ts@@ -28,6 +28,19 @@ import { explorerTxUrl, explorerTokenUrl } from '../core/explorer.js'* `0xcce7ec13`, and emits the SDK-documented `TokenCreated`/`Traded`* topics on the curve.*+ * A full survey of every historical `TokenCreated` emission on the bonding+ * factory (47 logs, `eth_getLogs` from block 0) found FOUR distinct create+ * selectors, not one: `0x8680ce63` (22 uses, an unexplained extra numeric+ * parameter with no consistent relationship to `msg.value`), `0x59a35641`+ * (20 uses, requires a 65-byte trailing ECDSA signature — an off-chain+ * backend co-signs each launch, which this rail has no way to produce),+ * `0xc56f3820` (3 uses, undecoded), and `0x56f698a3` (2 uses — the one this+ * rail ships). `0x56f698a3` is a minority path, but it is the ONLY variant+ * proven simple, unsigned, and byte-for-byte reproducible from real txs+ * without guessing a signature or an unverified parameter — see+ * `tests/unit/odyssey-calldata.test.ts`. It is still live and callable on+ * mainnet today (both sampled uses succeeded).+ ** `reflectionFactory` and `legacyFactory` were not sampled for creates during* this build and are intentionally NOT exposed by this rail — see the README* "Rails shipped vs excluded" section.@@ -74,8 +87,7 @@ export class OdysseyRail implements Rail {const preflight = await this.preflight(ctx, input)if (this.variant === 'instant') {- const data = ('0x' +- ODYSSEY_SELECTORS.instantCreate.slice(2) ++ const data = (ODYSSEY_SELECTORS.instantCreate +encodeAbiParameters([{ type: 'string' }, { type: 'string' }, { type: 'uint256' }],[input.name, input.symbol, input.initialBuyWei],@@ -96,8 +108,7 @@ export class OdysseyRail implements Rail {}// Bonding: create (value 0), then optional buy (value = initialBuyWei).- const createData = ('0x' +- ODYSSEY_SELECTORS.bondingCreate.slice(2) ++ const createData = (ODYSSEY_SELECTORS.bondingCreate +encodeAbiParameters([{ type: 'string' }, { type: 'string' }, { type: 'uint256' }, { type: 'uint256' }],[input.name, input.symbol, ODYSSEY_BONDING_CONSTANTS.threshold, ODYSSEY_BONDING_CONSTANTS.reserved],@@ -189,8 +200,7 @@ export class OdysseyRail implements Rail {// freshly-created curve the caller controls end-to-end in the same// launch; callers wanting slippage protection should call the buy// step separately with a quote.- const buyData = ('0x' +- ODYSSEY_SELECTORS.bondingBuy.slice(2) ++ const buyData = (ODYSSEY_SELECTORS.bondingBuy +encodeAbiParameters([{ type: 'address' }, { type: 'uint256' }], [token, 0n]).slice(2)) as `0x${string}`const buyHash = await client.wallet.sendTransaction({to: ODYSSEY.bondingCurveFactory,diff --git a/robinhood/hood-launcher/tests/live/rails-preflight.test.ts b/robinhood/hood-launcher/tests/live/rails-preflight.test.tsnew file mode 100644index 000000000..b8ddc4e56--- /dev/null+++ b/robinhood/hood-launcher/tests/live/rails-preflight.test.ts@@ -0,0 +1,64 @@+import { describe, it, expect } from 'vitest'+import { createHoodClient } from 'hoodchain'+import { createRail } from '../../src/rails/index.js'+import type { LaunchInput } from '../../src/rails/types.js'++const PROBE: LaunchInput = {+ name: 'Probe',+ symbol: 'PROBE',+ description: '',+ logoUri: '',+ socials: {},+ initialBuyWei: 0n,+}++describe('live rail preflight — mainnet 4663', () => {+ const client = createHoodClient({ chain: 'mainnet' })++ it('NOXA reports a real on-chain launch fee and enabled flag', async () => {+ const rail = createRail('noxa')+ const preflight = await rail.preflight({ client }, PROBE)+ expect(preflight.rail).toBe('noxa')+ expect(preflight.network).toBe('mainnet')+ // launchFee() was 0.0005 ETH when this rail was built — assert it's a+ // sane positive value rather than hardcoding the exact figure, since the+ // operator can change it on-chain.+ expect(preflight.protocolFeeWei).toBeGreaterThan(0n)+ expect(typeof preflight.ready).toBe('boolean')+ })++ it('Odyssey instant + bonding factories both have live code', async () => {+ for (const variant of ['instant', 'bonding'] as const) {+ const rail = createRail('odyssey', variant)+ const preflight = await rail.preflight({ client }, PROBE)+ expect(preflight.ready).toBe(true)+ expect(preflight.blockers).toEqual([])+ }+ })+})++describe('live rail preflight — testnet 46630', () => {+ const client = createHoodClient({ chain: 'testnet' })++ it('direct rail resolves the community Uniswap v3 deployment', async () => {+ const rail = createRail('direct')+ const preflight = await rail.preflight(+ { client, direct: { seedWethWei: 1n } }, // 1 wei — just enough to pass the >0 check, no signer needed for this read+ PROBE,+ )+ expect(preflight.network).toBe('testnet')+ expect(preflight.pairToken).toBeDefined()+ // No signer is configured in this read-only client, so this blocker is expected.+ expect(preflight.blockers.some((b) => b.includes('No signer'))).toBe(true)+ })++ it('NOXA and Odyssey correctly report unavailable on testnet (no deployment exists)', async () => {+ const noxa = await createRail('noxa').preflight({ client }, PROBE)+ expect(noxa.ready).toBe(false)+ expect(noxa.blockers[0]).toMatch(/mainnet/i)++ const odyssey = await createRail('odyssey').preflight({ client }, PROBE)+ expect(odyssey.ready).toBe(false)+ expect(odyssey.blockers[0]).toMatch(/mainnet/i)+ })+})diff --git a/robinhood/hood-launcher/tests/live/uniqueness-and-narratives.test.ts b/robinhood/hood-launcher/tests/live/uniqueness-and-narratives.test.tsnew file mode 100644index 000000000..88e43c5c6--- /dev/null+++ b/robinhood/hood-launcher/tests/live/uniqueness-and-narratives.test.ts@@ -0,0 +1,39 @@+import { describe, it, expect } from 'vitest'+import { checkTickerUniqueness } from '../../src/concept/uniqueness.js'+import { TickerTakenError } from '../../src/errors.js'+import { fetchTrendingNarratives, narrativeToTheme } from '../../src/auto/narratives.js'++describe('live ticker uniqueness — Blockscout token search', () => {+ it('rejects a ticker that is already live on mainnet ("BACK" — the NOXA launch used as the calldata proof)', async () => {+ await expect(checkTickerUniqueness('mainnet', 'BACK')).rejects.toThrow(TickerTakenError)+ })++ it('allows a ticker that has no plausible on-chain collision', async () => {+ await expect(+ checkTickerUniqueness('mainnet', `ZZZHOODLAUNCHERPROBE${Date.now()}`.slice(0, 40)),+ ).resolves.toBeUndefined()+ })+})++describe('live trending narratives — three.ws crypto news digest', () => {+ it('fetches real, non-empty narratives with titles, stances, and coverage counts', async () => {+ const narratives = await fetchTrendingNarratives(24, 5)+ expect(narratives.length).toBeGreaterThan(0)+ const first = narratives[0]+ expect(first).toBeDefined()+ expect(typeof first?.title).toBe('string')+ expect(first?.title.length).toBeGreaterThan(0)+ expect(typeof first?.coverage).toBe('number')+ expect(first?.coverage).toBeGreaterThan(0)+ })++ it('narrativeToTheme produces a non-empty, information-dense theme string', async () => {+ const narratives = await fetchTrendingNarratives(24, 1)+ const narrative = narratives[0]+ expect(narrative).toBeDefined()+ if (!narrative) return+ const theme = narrativeToTheme(narrative)+ expect(theme).toContain(narrative.title)+ expect(theme.length).toBeGreaterThan(narrative.title.length)+ })+})diff --git a/robinhood/hood-launcher/tests/unit/caps.test.ts b/robinhood/hood-launcher/tests/unit/caps.test.tsnew file mode 100644index 000000000..8f4430c6f--- /dev/null+++ b/robinhood/hood-launcher/tests/unit/caps.test.ts@@ -0,0 +1,112 @@+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'+import { mkdtempSync, rmSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join } from 'node:path'++// Mock hoodchain's swap quoting so estimateUsdgValue is deterministic and+// network-free in a unit test — the real quote is exercised in tests/live.+vi.mock('hoodchain', async () => {+ const actual = await vi.importActual<typeof import('hoodchain')>('hoodchain')+ return {+ ...actual,+ quoteSwap: vi.fn(async (_client: unknown, args: { amountIn: bigint }) => ({+ route: { fees: [10000], path: [], encodedPath: '0x' },+ amountIn: args.amountIn,+ // Fixed fake rate for the test: 1 ETH (1e18 wei) == 2000 USDG (2000e6).+ amountOut: (args.amountIn * 2000n * 1_000_000n) / 1_000_000_000_000_000_000n,+ gasEstimate: 0n,+ })),+ formatUsdg: (n: bigint) => (Number(n) / 1e6).toString(),+ }+})++const { estimateUsdgValue, enforceCaps } = await import('../../src/core/caps.js')+const { KillSwitch } = await import('../../src/core/kill-switch.js')+const { LaunchLedger } = await import('../../src/core/ledger.js')+const { CapExceededError, KilledError, ResponsibilityNotAffirmedError } = await import('../../src/errors.js')++let dataDir: string+beforeEach(() => {+ dataDir = mkdtempSync(join(tmpdir(), 'hood-launcher-caps-test-'))+})+afterEach(() => {+ rmSync(dataDir, { recursive: true, force: true })+})++const fakeClient = { network: 'mainnet' } as unknown as Parameters<typeof estimateUsdgValue>[0]++function baseConfig(overrides: Partial<Parameters<typeof enforceCaps>[0]> = {}) {+ return {+ network: 'mainnet' as const,+ live: true,+ maxLaunchesPerDay: 3,+ maxSeedUsdgEquivalent: 5000,+ acknowledgeLaunchResponsibility: true,+ ...overrides,+ }+}++describe('estimateUsdgValue', () => {+ it('returns 0 for a zero-wei amount with no network call', async () => {+ expect(await estimateUsdgValue(fakeClient, 0n)).toBe(0)+ })++ it('converts wei to a USDG estimate via the mocked quote', async () => {+ const usd = await estimateUsdgValue(fakeClient, 1_000_000_000_000_000_000n) // 1 ETH+ expect(usd).toBe(2000)+ })+})++describe('enforceCaps', () => {+ it('throws KilledError when the kill switch is engaged', async () => {+ const kill = new KillSwitch(dataDir)+ kill.engage('manual-test')+ const ledger = new LaunchLedger(dataDir)+ await expect(enforceCaps(baseConfig(), ledger, kill, fakeClient, 0n)).rejects.toThrow(KilledError)+ })++ it('throws ResponsibilityNotAffirmedError when live but not acknowledged', async () => {+ const kill = new KillSwitch(dataDir)+ const ledger = new LaunchLedger(dataDir)+ await expect(+ enforceCaps(baseConfig({ acknowledgeLaunchResponsibility: false }), ledger, kill, fakeClient, 0n),+ ).rejects.toThrow(ResponsibilityNotAffirmedError)+ })++ it('throws CapExceededError once MAX_LAUNCHES_PER_DAY is reached', async () => {+ const kill = new KillSwitch(dataDir)+ const ledger = new LaunchLedger(dataDir)+ const config = baseConfig({ maxLaunchesPerDay: 2 })+ for (let i = 0; i < 2; i++) {+ ledger.record({+ timestamp: Date.now(),+ rail: 'noxa',+ network: 'mainnet',+ symbol: `T${i}`,+ token: '0xabc',+ seedWei: '0',+ launchTx: '0xdead',+ status: 'launched',+ })+ }+ await expect(enforceCaps(config, ledger, kill, fakeClient, 0n)).rejects.toThrow(CapExceededError)+ })++ it('throws CapExceededError when the seed exceeds MAX_SEED_USDG', async () => {+ const kill = new KillSwitch(dataDir)+ const ledger = new LaunchLedger(dataDir)+ const config = baseConfig({ maxSeedUsdgEquivalent: 100 }) // cap at $100+ // 1 ETH ≈ $2000 per the mock — well over the $100 cap.+ await expect(enforceCaps(config, ledger, kill, fakeClient, 1_000_000_000_000_000_000n)).rejects.toThrow(+ CapExceededError,+ )+ })++ it('passes when under every cap', async () => {+ const kill = new KillSwitch(dataDir)+ const ledger = new LaunchLedger(dataDir)+ const config = baseConfig({ maxSeedUsdgEquivalent: 5000, maxLaunchesPerDay: 5 })+ const result = await enforceCaps(config, ledger, kill, fakeClient, 1_000_000_000_000_000_000n)+ expect(result.usdgEstimate).toBe(2000)+ })+})diff --git a/robinhood/hood-launcher/tests/unit/denylist.test.ts b/robinhood/hood-launcher/tests/unit/denylist.test.tsnew file mode 100644index 000000000..188995847--- /dev/null+++ b/robinhood/hood-launcher/tests/unit/denylist.test.ts@@ -0,0 +1,45 @@+import { describe, it, expect } from 'vitest'+import { checkDenylist } from '../../src/concept/denylist.js'+import { ConceptRejectedError } from '../../src/errors.js'++describe('checkDenylist', () => {+ it('rejects a name that impersonates a denylisted brand', () => {+ expect(() => checkDenylist({ name: 'Robinhood Coin', symbol: 'RHC', description: '' })).toThrow(+ ConceptRejectedError,+ )+ })++ it('rejects a symbol that exactly matches a denylisted term', () => {+ expect(() => checkDenylist({ name: 'Foo', symbol: 'NOXA', description: '' })).toThrow(ConceptRejectedError)+ })++ it('rejects a description that names a denylisted platform', () => {+ expect(() =>+ checkDenylist({ name: 'Foo', symbol: 'FOO', description: 'built to look exactly like uniswap' }),+ ).toThrow(ConceptRejectedError)+ })++ it('allows an unrelated word that merely contains a denylisted substring (word-boundary matching, not substring)', () => {+ // "noxaless" contains "noxa" as a substring but is not the word "noxa" —+ // this is exactly the false-positive class naive substring matching hit+ // elsewhere in this workspace (see denylist.ts doc comment).+ expect(() => checkDenylist({ name: 'Noxaless Dreams', symbol: 'NXD', description: '' })).not.toThrow()+ })++ it('allows a generic, unrelated coin concept', () => {+ expect(() => checkDenylist({ name: 'Sleepy Capybara', symbol: 'NAP', description: 'a very tired rodent' })).not.toThrow()+ })++ it('is case-insensitive', () => {+ expect(() => checkDenylist({ name: 'COINBASE Killer', symbol: 'CBK', description: '' })).toThrow(+ ConceptRejectedError,+ )+ })++ it('honors an operator-supplied person denylist via env', () => {+ const env = { HOOD_LAUNCHER_PERSON_DENYLIST: 'Jane Regular Person' } as NodeJS.ProcessEnv+ expect(() =>+ checkDenylist({ name: 'Jane Regular Person Coin', symbol: 'JRP', description: '' }, env),+ ).toThrow(ConceptRejectedError)+ })+})diff --git a/robinhood/hood-launcher/tests/unit/kill-switch-and-ledger.test.ts b/robinhood/hood-launcher/tests/unit/kill-switch-and-ledger.test.tsnew file mode 100644index 000000000..88eccd177--- /dev/null+++ b/robinhood/hood-launcher/tests/unit/kill-switch-and-ledger.test.ts@@ -0,0 +1,90 @@+import { describe, it, expect, beforeEach, afterEach } from 'vitest'+import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import { KillSwitch } from '../../src/core/kill-switch.js'+import { LaunchLedger } from '../../src/core/ledger.js'++let dataDir: string++beforeEach(() => {+ dataDir = mkdtempSync(join(tmpdir(), 'hood-launcher-test-'))+})++afterEach(() => {+ rmSync(dataDir, { recursive: true, force: true })+})++describe('KillSwitch', () => {+ it('starts disengaged', () => {+ const kill = new KillSwitch(dataDir)+ expect(kill.isEngaged().engaged).toBe(false)+ expect(kill.reasonIfEngaged()).toBeNull()+ })++ it('engages via explicit engage() and stays engaged', () => {+ const kill = new KillSwitch(dataDir)+ kill.engage('test-source')+ expect(kill.isEngaged()).toEqual({ engaged: true, source: 'test-source' })+ expect(kill.reasonIfEngaged()).toBe('test-source')+ // A second engage() call does not overwrite the original source.+ kill.engage('second-source')+ expect(kill.reasonIfEngaged()).toBe('test-source')+ })++ it('engages when a KILL sentinel file is dropped into the data dir', () => {+ const kill = new KillSwitch(dataDir)+ expect(kill.isEngaged().engaged).toBe(false)+ writeFileSync(join(dataDir, 'KILL'), 'stop')+ const status = kill.isEngaged()+ expect(status.engaged).toBe(true)+ expect(status.source).toContain('KILL file')+ })+})++describe('LaunchLedger', () => {+ it('records entries and counts launches within a rolling window', () => {+ const ledger = new LaunchLedger(dataDir)+ const now = Date.now()+ ledger.record({+ timestamp: now,+ rail: 'noxa',+ network: 'mainnet',+ symbol: 'FOO',+ token: '0xabc',+ seedWei: '0',+ launchTx: '0xdead',+ status: 'launched',+ })+ ledger.record({+ timestamp: now - 25 * 60 * 60 * 1000, // 25h ago — outside a 24h window+ rail: 'noxa',+ network: 'mainnet',+ symbol: 'BAR',+ token: '0xdef',+ seedWei: '0',+ launchTx: '0xbeef',+ status: 'launched',+ })+ ledger.record({+ timestamp: now,+ rail: 'noxa',+ network: 'mainnet',+ symbol: 'BAZ',+ token: null,+ seedWei: '0',+ launchTx: null,+ status: 'rejected',+ reason: 'dry-run',+ })++ expect(ledger.countLaunchedInWindow(24)).toBe(1) // only the fresh, status:'launched' entry+ expect(ledger.readAll()).toHaveLength(3)+ })++ it('starts empty for a fresh data dir', () => {+ const ledger = new LaunchLedger(dataDir)+ expect(ledger.readAll()).toEqual([])+ expect(ledger.countLaunchedInWindow(24)).toBe(0)+ })+})diff --git a/robinhood/hood-launcher/tests/unit/odyssey-calldata.test.ts b/robinhood/hood-launcher/tests/unit/odyssey-calldata.test.tsnew file mode 100644index 000000000..6b330a040--- /dev/null+++ b/robinhood/hood-launcher/tests/unit/odyssey-calldata.test.ts@@ -0,0 +1,81 @@+import { describe, it, expect } from 'vitest'+import { encodeAbiParameters } from 'viem'+import { ODYSSEY_BONDING_CONSTANTS, ODYSSEY_SELECTORS } from '../../src/rails/addresses.js'++/**+ * Proves the Odyssey rail's calldata against REAL historical transactions.+ * Neither Odyssey factory publishes a verified ABI on Blockscout, so every+ * selector and argument layout here was recovered by decoding real txs+ * (see `robinhood/hood-launcher`'s README "Rails shipped vs excluded" for+ * the full decode trail, including a survey of all 47 on-chain+ * `TokenCreated` emissions that found FOUR distinct create selectors on the+ * bonding factory — two of them requiring an off-chain backend ECDSA+ * signature this rail cannot produce). `0x56f698a3` is the only variant+ * proven simple, unsigned, and reproducible byte-for-byte from real txs, so+ * it's the one this rail ships. Every constant below was fetched directly+ * from `eth_getTransactionByHash` on mainnet 4663 during this build.+ */+describe('Odyssey instant-factory create calldata', () => {+ it('reproduces the real CeoCat (CEOCAT) instant-create tx, msg.value == buyAmount', () => {+ // Real tx: 0x8a21d7f33ed34422f7c68e138dbc3cf97f7e9185552f8e4497a83885a1245f8c+ // to: 0xD7601cEe401306fdea5833c6898181D9c770F800 (instantFactory), value 0.03 ETH+ const REAL_CALLDATA = '0x548eb31b000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000006a94d74f430000000000000000000000000000000000000000000000000000000000000000000643656f4361740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000643454f4341540000000000000000000000000000000000000000000000000000'+ const built =+ ODYSSEY_SELECTORS.instantCreate ++ encodeAbiParameters(+ [{ type: 'string' }, { type: 'string' }, { type: 'uint256' }],+ ['CeoCat', 'CEOCAT', 30000000000000000n],+ ).slice(2)+ expect(built.toLowerCase()).toBe(REAL_CALLDATA.toLowerCase())+ })++ it('reproduces the real Deadend (DEADEND) instant-create tx with a zero initial buy', () => {+ // Real tx: 0x4da9887c9634ed9c56aba2665cdfbac40ed8fd30d370f46fc6777cbd87df9e9e, value 0+ const REAL_CALLDATA = '0x548eb31b000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000744656164656e6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000744454144454e4400000000000000000000000000000000000000000000000000'+ const built =+ ODYSSEY_SELECTORS.instantCreate ++ encodeAbiParameters([{ type: 'string' }, { type: 'string' }, { type: 'uint256' }], ['Deadend', 'DEADEND', 0n]).slice(2)+ expect(built.toLowerCase()).toBe(REAL_CALLDATA.toLowerCase())+ })+})++describe('Odyssey bonding-factory create calldata', () => {+ it('reproduces the real "test ai" (TESTAI) bonding create tx', () => {+ // Real tx: 0xd1404ae204c947d8a3f2cbc516fdc4903d3097580e74501cdd2d1de74c386ff3+ // to: 0xEb3FeeD2716cF0eEAda05B22e67424794e1f5a80 (bondingCurveFactory), value 0+ const REAL_CALLDATA = '0x56f698a3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007746573742061690000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000065445535441490000000000000000000000000000000000000000000000000000'+ const built =+ ODYSSEY_SELECTORS.bondingCreate ++ encodeAbiParameters(+ [{ type: 'string' }, { type: 'string' }, { type: 'uint256' }, { type: 'uint256' }],+ ['test ai', 'TESTAI', ODYSSEY_BONDING_CONSTANTS.threshold, ODYSSEY_BONDING_CONSTANTS.reserved],+ ).slice(2)+ expect(built.toLowerCase()).toBe(REAL_CALLDATA.toLowerCase())+ })++ it('reproduces the real Sofia (SOFIA) bonding create tx — proves the trailing constants recur', () => {+ // Real tx: 0xd024b90b425e4eb7be45c96435d22fdeeef9d1a57ec90c95a635f39ef32ef971+ const REAL_CALLDATA = '0x56f698a3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005536f6669610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005534f464941000000000000000000000000000000000000000000000000000000'+ const built =+ ODYSSEY_SELECTORS.bondingCreate ++ encodeAbiParameters(+ [{ type: 'string' }, { type: 'string' }, { type: 'uint256' }, { type: 'uint256' }],+ ['Sofia', 'SOFIA', ODYSSEY_BONDING_CONSTANTS.threshold, ODYSSEY_BONDING_CONSTANTS.reserved],+ ).slice(2)+ expect(built.toLowerCase()).toBe(REAL_CALLDATA.toLowerCase())+ })+})++describe('Odyssey bonding-factory buy calldata shape', () => {+ it('matches the real buy tx argument layout: buy(address token, uint256 minTokensOut)', () => {+ // Real tx: 0xf3bd87ab66517420996e02b72c4c8c9401e8006af7b5b063aa0eb15481749afe, value 0.000439816283231174 ETH+ const REAL_CALLDATA = '0xcce7ec13000000000000000000000000edd60ab7a13b98233ef0d5d108215a88a9ab6fcd0000000000000000000000000000000000000000000000000000003f0a4252f6'+ const built =+ ODYSSEY_SELECTORS.bondingBuy ++ encodeAbiParameters(+ [{ type: 'address' }, { type: 'uint256' }],+ ['0xEdD60AB7a13B98233ef0D5D108215a88a9aB6fcd', 270_755_058_422n],+ ).slice(2)+ expect(built.toLowerCase()).toBe(REAL_CALLDATA.toLowerCase())+ })+})diff --git a/robinhood/hood-launcher/tests/unit/univ3-math.test.ts b/robinhood/hood-launcher/tests/unit/univ3-math.test.tsnew file mode 100644index 000000000..5732b6a74--- /dev/null+++ b/robinhood/hood-launcher/tests/unit/univ3-math.test.ts@@ -0,0 +1,76 @@+import { describe, it, expect } from 'vitest'+import { fullRangeTicks, isqrt, sortTokens, sqrtPriceX96FromAmounts } from '../../src/core/univ3-math.js'++describe('isqrt', () => {+ it('computes exact integer square roots', () => {+ expect(isqrt(0n)).toBe(0n)+ expect(isqrt(1n)).toBe(1n)+ expect(isqrt(4n)).toBe(2n)+ expect(isqrt(1_000_000n)).toBe(1_000n)+ })++ it('floors non-perfect squares', () => {+ expect(isqrt(2n)).toBe(1n)+ expect(isqrt(99n)).toBe(9n) // 9^2=81, 10^2=100+ expect(isqrt(24n)).toBe(4n) // 4^2=16, 5^2=25+ })++ it('handles very large numbers (2^192 scale, matching sqrtPriceX96 inputs)', () => {+ const n = 1n << 192n+ const root = isqrt(n)+ expect(root * root <= n).toBe(true)+ expect((root + 1n) * (root + 1n) > n).toBe(true)+ })+})++describe('sqrtPriceX96FromAmounts', () => {+ it('produces the canonical Q96 value for a 1:1 price', () => {+ const sqrtPriceX96 = sqrtPriceX96FromAmounts(1_000_000n, 1_000_000n)+ expect(sqrtPriceX96).toBe(1n << 96n)+ })++ it('scales correctly for a 4x price ratio (sqrt(4) = 2)', () => {+ const sqrtPriceX96 = sqrtPriceX96FromAmounts(1_000_000n, 4_000_000n)+ expect(sqrtPriceX96).toBe(2n * (1n << 96n))+ })++ it('throws on a zero amount0 (division by zero)', () => {+ expect(() => sqrtPriceX96FromAmounts(0n, 1n)).toThrow(RangeError)+ })+})++describe('fullRangeTicks', () => {+ it('produces ticks that are multiples of the spacing and within Uniswap v3 bounds', () => {+ for (const spacing of [1, 10, 60, 200]) {+ const { tickLower, tickUpper } = fullRangeTicks(spacing)+ expect(tickLower % spacing === 0).toBe(true)+ expect(tickUpper % spacing === 0).toBe(true)+ expect(tickLower).toBeGreaterThanOrEqual(-887272)+ expect(tickUpper).toBeLessThanOrEqual(887272)+ expect(tickLower).toBeLessThan(0)+ expect(tickUpper).toBeGreaterThan(0)+ }+ })++ it('matches the well-known full-range ticks for the 1% tier (spacing 200)', () => {+ const { tickLower, tickUpper } = fullRangeTicks(200)+ expect(tickLower).toBe(-887200)+ expect(tickUpper).toBe(887200)+ })+})++describe('sortTokens', () => {+ it('orders token0 < token1 by address regardless of input order', () => {+ const low = '0x0000000000000000000000000000000000000001'+ const high = '0xffffffffffffffffffffffffffffffffffffffff'+ const a = sortTokens({ address: high, amount: 100n }, { address: low, amount: 200n })+ expect(a.token0).toBe(low)+ expect(a.token1).toBe(high)+ expect(a.amount0).toBe(200n)+ expect(a.amount1).toBe(100n)++ const b = sortTokens({ address: low, amount: 200n }, { address: high, amount: 100n })+ expect(b.token0).toBe(low)+ expect(b.amount0).toBe(200n)+ })+})diff --git a/robinhood/hood-mcp/docs/safety.html b/robinhood/hood-mcp/docs/safety.htmlnew file mode 100644index 000000000..e2aaea361--- /dev/null+++ b/robinhood/hood-mcp/docs/safety.html@@ -0,0 +1,152 @@+<title>Safety model — hood-mcp</title>+<meta name="description" content="How hood-mcp-trading guards every fund-moving tool call: kill switch, eligibility gate, spend caps, confirm gate." />+<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">Overview</a>+ <a href="install.html">Install</a>+ <a href="tools.html">Tools</a>+ <a href="safety.html" aria-current="page">Safety model</a>+ <a href="https://github.com/nirholas/hood-mcp">GitHub</a>+ </div>+ </div>+</nav>++<main class="wrap">+ <section style="border-top:none; padding-top:48px;">+ <h2 style="font-size:30px;">Safety model</h2>+ <p class="section-lede">+ <code>hood-mcp</code> (the data server) never signs anything — every tool is read-only.+ <code>hood-mcp-trading</code> is a separate opt-in binary with four gates, in this order,+ before a single wei moves.+ </p>+ </section>++ <section>+ <h2>The four gates</h2>+ <ol class="gate-list">+ <li>+ <div class="num">1</div>+ <div>+ <h3>Kill switch — the process itself</h3>+ <p>+ <code>hood-mcp-trading</code> checks <code>HOOD_MCP_ENABLE_TRADING === "1"</code>+ before it even connects to the MCP transport. Set a wallet key without this and the+ process throws on startup and exits — it will not silently run read-only.+ </p>+ </div>+ </li>+ <li>+ <div class="num">2</div>+ <div>+ <h3>Eligibility gate — Stock Token acquisitions</h3>+ <p>+ Stock Tokens are tokenized debt securities (issuer: Robinhood Assets (Jersey) Ltd)+ and may not be offered, sold, or delivered to US persons (additional limits: Canada,+ UK, Switzerland). Any swap whose <em>output</em> is a canonical Stock Token throws+ unless <code>HOOD_MCP_ACKNOWLEDGE_ELIGIBILITY=1</code> — the operator's explicit+ affirmation of eligibility. Selling a Stock Token, and all memecoin trades, are never+ gated by this.+ </p>+ </div>+ </li>+ <li>+ <div class="num">3</div>+ <div>+ <h3>Spend caps — checked before signing</h3>+ <p>+ Every mutating call is valued in USD (via USDG) and checked against+ <code>HOOD_MCP_MAX_SPEND_USDG</code> (per single call, default $25) and+ <code>HOOD_MCP_MAX_SESSION_USDG</code> (cumulative for the process's lifetime,+ default $100). The check runs <strong>before</strong> anything is signed — a+ rejected call never reaches the wallet. On mainnet, a spend with no USDG price route+ is rejected outright rather than treated as zero-value.+ </p>+ </div>+ </li>+ <li>+ <div class="num">4</div>+ <div>+ <h3>Confirm gate — every mutating tool, every time</h3>+ <p>+ <code>execute_swap</code> and <code>transfer_usdg</code> always return a simulation+ (recipient, amount, token, minimum received, session budget remaining) on the first+ call. <strong>Nothing is broadcast</strong> until the exact same call is repeated+ with <code>confirm: true</code>. There is no "trust me" flag — an agent (or the+ human behind it) sees the concrete numbers before anything moves.+ </p>+ </div>+ </li>+ </ol>+ </section>++ <section>+ <h2>What a blocked call looks like</h2>+ <div class="flow">+ <div class="step">execute_swap(tokenOut: "AAPL")</div>+ <span class="arrow">→</span>+ <div class="step blocked">eligibility not acknowledged</div>+ <span class="arrow">→</span>+ <div class="step blocked">isError: true, nothing signed</div>+ </div>+ <div class="flow">+ <div class="step">execute_swap(amountIn: "1000 USDG")</div>+ <span class="arrow">→</span>+ <div class="step blocked">$1000 > $25 per-call cap</div>+ <span class="arrow">→</span>+ <div class="step blocked">isError: true, nothing signed</div>+ </div>+ <div class="flow">+ <div class="step">execute_swap(amountIn: "10 USDG")</div>+ <span class="arrow">→</span>+ <div class="step ok">under cap, simulation returned</div>+ <span class="arrow">→</span>+ <div class="step">confirm: true</div>+ <span class="arrow">→</span>+ <div class="step ok">broadcast, receipt returned</div>+ </div>+ <p style="color:var(--text-dim); font-size:13.5px;">+ Every path above is exercised by real tests against live network reads — see+ <code>tests/trading-guards.test.ts</code> in the repo.+ </p>+ </section>++ <section>+ <h2>What's NOT guarded</h2>+ <p class="section-lede" style="max-width:none;">+ Be precise about the boundary. These are true regardless of caps or gates:+ </p>+ <div class="grid cols-2">+ <div class="card">+ <h3>Slippage is your risk, not a cap</h3>+ <p><code>slippageBps</code> defaults to 50 (0.5%) but is caller-controlled up to 5000+ (50%). A high slippage tolerance can still result in a bad fill within your USD cap.</p>+ </div>+ <div class="card">+ <h3>The session cap resets on restart</h3>+ <p><code>HOOD_MCP_MAX_SESSION_USDG</code> is an in-memory counter. Restarting the+ trading server process resets it to zero — it is not a persistent ledger.</p>+ </div>+ <div class="card">+ <h3>The wallet key is the real boundary</h3>+ <p>Anyone with <code>ROBINHOOD_CHAIN_PRIVATE_KEY</code> can bypass this server entirely+ and sign directly. Treat the key with the same care you would give any hot wallet key.</p>+ </div>+ <div class="card">+ <h3>Testnet spends are unvalued, not uncapped</h3>+ <p>Testnet assets have no USD price, so their notional counts as $0 against the cap — the+ confirm gate is the real guard there, not the dollar limit.</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>+ </footer>+</main>diff --git a/robinhood/hood-mcp/docs/tools.html b/robinhood/hood-mcp/docs/tools.htmlnew file mode 100644index 000000000..bedbf2eee--- /dev/null+++ b/robinhood/hood-mcp/docs/tools.html@@ -0,0 +1,126 @@+<title>Tools — hood-mcp</title>+<meta name="description" content="Full tool reference for hood-mcp, generated from the servers' live registered schemas." />+<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">Overview</a>+ <a href="install.html">Install</a>+ <a href="tools.html" aria-current="page">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 style="border-top:none; padding-top:48px;">+ <h2 style="font-size:30px;">Tool reference</h2>+ <p class="section-lede">+ Generated directly from each server's live registered tool schemas — this page cannot+ drift from the actual tools. Regenerate with <code>node scripts/generate-tools-doc.mjs</code>.+ </p>+ </section>++ <section>+ <h2>hood-mcp — data server (9 tools)</h2>+ <p class="section-lede">Zero-config, read-only, no wallet required.</p>+ <div class="card" style="margin-bottom:14px;">+ <h3><code>get_chain_stats</code> <span class="pill free">free</span></h3>+ <p>Live Robinhood Chain overview: latest block, gas price, TVL, and network totals (blocks, addresses, transactions, block time). No inputs.</p>+ <p style="color:var(--text-faint);font-size:13px;">No parameters.</p>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>list_stock_tokens</code> <span class="pill free">free</span></h3>+ <p>The registry of tokenized-equity Stock Tokens on Robinhood Chain (ticker, name, contract, Chainlink feed). Set pricedOnly to return only tokens with a live feed.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>pricedOnly</code></td><td><code>boolean</code></td><td>Only tokens with a Chainlink price feed.</td></tr>+<tr><td><code>limit</code></td><td><code>integer</code></td><td>Max entries (default all).</td></tr>+<tr><td><code>offset</code></td><td><code>integer</code></td><td>Skip this many (pagination).</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>get_stock_quote</code> <span class="pill free">free</span></h3>+ <p>Price a Stock Token by ticker: the Chainlink oracle price, the on-chain Uniswap DEX mid price, the premium/discount between them, and the ERC-8056 multiplier (so you also get the underlying share price).</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>symbol</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Ticker, e.g. "AAPL" or "TSLA" (case-insensitive).</td></tr>+<tr><td><code>maxAgeSeconds</code></td><td><code>integer</code></td><td>Reject the Chainlink answer if older than this (default 3 days; 24/5 feeds).</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>get_portfolio</code> <span class="pill free">free</span></h3>+ <p>Multiplier-correct Stock Token portfolio for any address: per-position token balance, ERC-8056 share-equivalent, USD value, plus the USDG cash balance. Read-only.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>address</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Wallet address (0x…40 hex) to value.</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>get_coin</code> <span class="pill free">free</span></h3>+ <p>Detail for any Robinhood Chain token by contract address: price, 24h volume, liquidity, FDV, holder count, and whether it is a registered Stock Token.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>address</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Token contract address (0x…40 hex).</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>list_trending_coins</code> <span class="pill free">free</span></h3>+ <p>The trending pools on Robinhood Chain right now (memecoins and stocks) with price, 24h volume, price change, and liquidity — the pulse of the chain.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>limit</code></td><td><code>integer</code></td><td>How many (default 10, max 30).</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>get_recent_launches</code> <span class="pill free">free</span></h3>+ <p>Recently launched tokens on Robinhood Chain launchpads (NOXA and The Odyssey), newest first, scanned from on-chain logs.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>lookbackBlocks</code></td><td><code>integer</code></td><td>Blocks to scan back (~30k ≈ 1h; default 30000).</td></tr>+<tr><td><code>launchpad</code></td><td><code>string</code></td><td>Restrict to one launchpad.</td></tr>+<tr><td><code>limit</code></td><td><code>integer</code></td><td>Max launches to return (default 25).</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>watch_launches</code> <span class="pill free">free</span></h3>+ <p>Watch NOXA + The Odyssey live for new token launches, blocking up to waitSeconds (or until limit launches are seen), then returns what appeared. Falls back to the most recent launch if none fire in the window.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>waitSeconds</code></td><td><code>integer</code></td><td>How long to watch (default 20, max 120).</td></tr>+<tr><td><code>launchpad</code></td><td><code>string</code></td><td>Restrict to one launchpad.</td></tr>+<tr><td><code>limit</code></td><td><code>integer</code></td><td>Stop early after this many (default 20).</td></tr>+<tr><td><code>includeRecentIfEmpty</code></td><td><code>boolean</code></td><td>If nothing launches in the window, return the latest recent launch (default true).</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>search_token</code> <span class="pill free">free</span></h3>+ <p>Find tokens on Robinhood Chain by ticker, name, or contract address — searches the Stock Token registry and the Blockscout index together.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>query</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Ticker, name fragment, or 0x address.</td></tr>+<tr><td><code>limit</code></td><td><code>integer</code></td><td>Max results (default 20).</td></tr></tbody></table></div>+</div>+ </section>++ <section>+ <h2>hood-mcp-trading — wallet server (4 tools)</h2>+ <p class="section-lede">Requires <code>HOOD_MCP_ENABLE_TRADING=1</code> + a wallet key. See the <a href="safety.html">safety model</a>.</p>+ <div class="card" style="margin-bottom:14px;">+ <h3><code>get_my_portfolio</code> <span class="pill free">read-only</span></h3>+ <p>This wallet's holdings on Robinhood Chain: native ETH (gas), USDG cash, and every Stock Token position with multiplier-correct USD value. Read-only.</p>+ <p style="color:var(--text-faint);font-size:13px;">No parameters.</p>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>get_swap_quote</code> <span class="pill free">read-only</span></h3>+ <p>Quote a Uniswap swap on Robinhood Chain without signing: best route, expected output, minimum received at your slippage, and the USD value of the input. Tokens are addresses, Stock Token tickers, or USDG/WETH.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>tokenIn</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Input token: address, ticker (e.g. TSLA), or USDG/WETH.</td></tr>+<tr><td><code>tokenOut</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Output token: address, ticker, or USDG/WETH.</td></tr>+<tr><td><code>amountIn</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Human amount of tokenIn, e.g. "100" or "0.05".</td></tr>+<tr><td><code>slippageBps</code></td><td><code>integer</code></td><td>Slippage tolerance in bps (default 50 = 0.5%).</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>execute_swap</code> <span class="pill guarded">guarded</span></h3>+ <p>Swap tokens on Robinhood Chain. First call returns a SIMULATION and requires confirm=true to broadcast. Spend is hard-capped in USD; Stock Token BUYS require eligibility. Approves the router automatically if needed.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>tokenIn</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Input token: address, ticker, or USDG/WETH.</td></tr>+<tr><td><code>tokenOut</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Output token: address, ticker, or USDG/WETH.</td></tr>+<tr><td><code>amountIn</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Human amount of tokenIn to spend, e.g. "10".</td></tr>+<tr><td><code>slippageBps</code></td><td><code>integer</code></td><td>Slippage tolerance in bps (default 50).</td></tr>+<tr><td><code>confirm</code></td><td><code>boolean</code></td><td>Must be true to actually broadcast. Omit/false to preview.</td></tr></tbody></table></div>+</div>+<div class="card" style="margin-bottom:14px;">+ <h3><code>transfer_usdg</code> <span class="pill guarded">guarded</span></h3>+ <p>Send USDG to an address. First call returns a preview and requires confirm=true to broadcast. The amount is hard-capped in USD by the same spend limits.</p>+ <div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>to</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Recipient address (0x…40 hex).</td></tr>+<tr><td><code>amount</code> <span style="color:var(--down);font-size:11px;">required</span></td><td><code>string</code></td><td>Human USDG amount, e.g. "5.00".</td></tr>+<tr><td><code>confirm</code></td><td><code>boolean</code></td><td>Must be true to actually broadcast. Omit/false to preview.</td></tr></tbody></table></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>+ </footer>+</main>diff --git a/robinhood/hood-mcp/hood-mcp-0.1.0.tgz b/robinhood/hood-mcp/hood-mcp-0.1.0.tgznew file mode 100644index 000000000..4919e5303Binary files /dev/null and b/robinhood/hood-mcp/hood-mcp-0.1.0.tgz differdiff --git a/robinhood/hood-mcp/package.json b/robinhood/hood-mcp/package.jsonindex 5962ad3c4..f3545b534 100644--- a/robinhood/hood-mcp/package.json+++ b/robinhood/hood-mcp/package.json@@ -58,6 +58,7 @@"dev:data": "tsx src/data-server.ts","dev:trading": "tsx src/trading-server.ts","start": "node dist/data-server.js",+ "docs:tools": "tsx scripts/generate-tools-doc.mjs","test": "vitest run tests/schema.test.ts tests/trading-guards.test.ts","test:live": "vitest run -c vitest.live.config.ts tests/data-client.live.test.ts --testTimeout 120000","test:swap": "vitest run -c vitest.live.config.ts tests/trading-swap.live.test.ts --testTimeout 180000",@@ -65,7 +66,7 @@},"dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",- "hoodchain": "file:../robinhood-chain-sdk",+ "hoodchain": "^0.1.0","viem": "^2.55.1","ws": "^8.21.0","zod": "^3.25.76"diff --git a/robinhood/hood-mcp/scripts/generate-tools-doc.mjs b/robinhood/hood-mcp/scripts/generate-tools-doc.mjsnew file mode 100644index 000000000..69223dfb5--- /dev/null+++ b/robinhood/hood-mcp/scripts/generate-tools-doc.mjs@@ -0,0 +1,134 @@+#!/usr/bin/env node+/**+ * Generate docs/tools.html directly from the servers' real registered tool+ * schemas — never hand-duplicated, so the reference can't drift from the+ * actual tools. Run after any tool change: `npx tsx scripts/generate-tools-doc.mjs`+ * (or `node scripts/generate-tools-doc.mjs` after `npm run build`, importing+ * from `../src/*.js` which then resolves against `dist/`).+ */+import { writeFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import path from 'node:path'+import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'+import { Client } from '@modelcontextprotocol/sdk/client/index.js'+import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js'+import { privateKeyToAccount } from 'viem/accounts'+import { createHoodClient } from 'hoodchain'+import { registerDataTools } from '../src/register-data.js'+import { registerTradingTools } from '../src/register-trading.js'+import { readTradingConfig, SpendLedger } from '../src/shared/trading-env.js'++const __dirname = path.dirname(fileURLToPath(import.meta.url))+const DOCS_DIR = path.join(__dirname, '..', 'docs')++// Build-time only — never used to sign anything, just to satisfy the+// "requires a wallet" constructor check so tool schemas can be listed.+const BUILD_KEY = '0x4918baba5b953918b69687637b543e8943bd2d2b83893ca51643c89845b9d16d'++async function listTools(register) {+ const server = new McpServer({ name: 'docgen', version: '0.0.0' })+ register(server)+ const [serverT, clientT] = InMemoryTransport.createLinkedPair()+ const client = new Client({ name: 'docgen', version: '0.0.0' })+ await Promise.all([server.connect(serverT), client.connect(clientT)])+ const { tools } = await client.listTools()+ await client.close()+ return tools+}++function esc(s) {+ return String(s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c])+}++function paramsTable(tool) {+ const props = tool.inputSchema?.properties ?? {}+ const required = new Set(tool.inputSchema?.required ?? [])+ const names = Object.keys(props)+ if (names.length === 0) return '<p style="color:var(--text-faint);font-size:13px;">No parameters.</p>'+ const rows = names+ .map((name) => {+ const p = props[name]+ const type = p.type ?? (p.anyOf ? p.anyOf.map((x) => x.type).join(' | ') : 'any')+ return `<tr><td><code>${esc(name)}</code>${required.has(name) ? ' <span style="color:var(--down);font-size:11px;">required</span>' : ''}</td><td><code>${esc(type)}</code></td><td>${esc(p.description ?? '')}</td></tr>`+ })+ .join('\n')+ return `<div class="table-scroll"><table><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead><tbody>${rows}</tbody></table></div>`+}++function toolCard(tool, kind) {+ const badge =+ kind === 'data'+ ? '<span class="pill free">free</span>'+ : tool.annotations?.destructiveHint+ ? '<span class="pill guarded">guarded</span>'+ : '<span class="pill free">read-only</span>'+ return `<div class="card" style="margin-bottom:14px;">+ <h3><code>${esc(tool.name)}</code> ${badge}</h3>+ <p>${esc(tool.description)}</p>+ ${paramsTable(tool)}+</div>`+}++async function main() {+ const hoodData = createHoodClient() // mainnet, read-only+ const dataTools = await listTools((s) => registerDataTools(s, hoodData))++ const hoodTrading = createHoodClient({ chain: 'mainnet', account: privateKeyToAccount(BUILD_KEY) })+ const config = readTradingConfig({ HOOD_MCP_ENABLE_TRADING: '1' })+ const ledger = new SpendLedger(config)+ const tradingTools = await listTools((s) => registerTradingTools(s, hoodTrading, config, ledger))++ const html = `<title>Tools — hood-mcp</title>+<meta name="description" content="Full tool reference for hood-mcp, generated from the servers' live registered schemas." />+<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">Overview</a>+ <a href="install.html">Install</a>+ <a href="tools.html" aria-current="page">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 style="border-top:none; padding-top:48px;">+ <h2 style="font-size:30px;">Tool reference</h2>+ <p class="section-lede">+ Generated directly from each server's live registered tool schemas — this page cannot+ drift from the actual tools. Regenerate with <code>node scripts/generate-tools-doc.mjs</code>.+ </p>+ </section>++ <section>+ <h2>hood-mcp — data server (${dataTools.length} tools)</h2>+ <p class="section-lede">Zero-config, read-only, no wallet required.</p>+ ${dataTools.map((t) => toolCard(t, 'data')).join('\n')}+ </section>++ <section>+ <h2>hood-mcp-trading — wallet server (${tradingTools.length} tools)</h2>+ <p class="section-lede">Requires <code>HOOD_MCP_ENABLE_TRADING=1</code> + a wallet key. See the <a href="safety.html">safety model</a>.</p>+ ${tradingTools.map((t) => toolCard(t, 'trading')).join('\n')}+ </section>++ <footer>+ MIT © 2026 nirholas · Built by <a href="https://x.com/nichxbt">nirholas</a> ·+ <a href="https://three.ws">three.ws</a>+ </footer>+</main>+`+ writeFileSync(path.join(DOCS_DIR, 'tools.html'), html)+ console.log(`Wrote docs/tools.html — ${dataTools.length} data tools, ${tradingTools.length} trading tools`)+}++main().catch((e) => {+ console.error(e)+ process.exit(1)+})diff --git a/robinhood/hood-mcp/src/data-server.ts b/robinhood/hood-mcp/src/data-server.tsindex c6d348be7..fd9ab5757 100644--- a/robinhood/hood-mcp/src/data-server.ts+++ b/robinhood/hood-mcp/src/data-server.ts@@ -18,6 +18,7 @@ import { readOnlyClient, resolveNetwork } from './shared/client.js'import { registerDataTools } from './register-data.js'import { SERVER_NAME, SERVER_VERSION } from './version.js'import { loadPaywallMiddleware, readPaywallConfig } from './x402-seam.js'+import { isMainModule } from './shared/is-main.js'const INSTRUCTIONS = `Read-only market data for Robinhood Chain (chain ID 4663), the permissionlessArbitrum Orbit L2 with tokenized-equity "Stock Tokens", the USDG stablecoin, and the NOXA / The@@ -122,8 +123,8 @@ async function main(): Promise<void> {}}-// Only run when executed as a binary, not when imported.-if (import.meta.url === `file://${process.argv[1]}`) {+// Only run when executed as a binary (handles npm's bin symlinks), not when imported.+if (isMainModule(import.meta.url)) {main().catch((e) => {process.stderr.write(`[${SERVER_NAME}] fatal: ${e instanceof Error ? e.stack : String(e)}\n`)process.exit(1)diff --git a/robinhood/hood-mcp/src/shared/is-main.ts b/robinhood/hood-mcp/src/shared/is-main.tsnew file mode 100644index 000000000..579e99620--- /dev/null+++ b/robinhood/hood-mcp/src/shared/is-main.ts@@ -0,0 +1,23 @@+/**+ * Robust "is this module the entry point" check for a dual bin+import package.+ *+ * `import.meta.url === file://${process.argv[1]}` breaks the moment the binary+ * is invoked through a symlink — which is exactly how npm installs `bin`+ * entries (`node_modules/.bin/hood-mcp -> ../hood-mcp/dist/data-server.js`).+ * Node resolves `import.meta.url` to the symlink's REAL path but leaves+ * `process.argv[1]` as the invoked (symlink) path, so the naive string+ * comparison silently fails and main() never runs — verified by actually+ * running the packed tarball through `node_modules/.bin/hood-mcp` during+ * this package's own E2E test, not a hypothetical.+ */+import { realpathSync } from 'node:fs'+import { fileURLToPath } from 'node:url'++export function isMainModule(moduleUrl: string): boolean {+ if (!process.argv[1]) return false+ try {+ return realpathSync(process.argv[1]) === fileURLToPath(moduleUrl)+ } catch {+ return false+ }+}diff --git a/robinhood/hood-mcp/src/trading-server.ts b/robinhood/hood-mcp/src/trading-server.tsindex f7f409404..20ec523c7 100644--- a/robinhood/hood-mcp/src/trading-server.ts+++ b/robinhood/hood-mcp/src/trading-server.ts@@ -18,6 +18,7 @@ import { walletClientFromEnv } from './shared/client.js'import { readTradingConfig, SpendLedger } from './shared/trading-env.js'import { registerTradingTools } from './register-trading.js'import { SERVER_NAME, SERVER_VERSION } from './version.js'+import { isMainModule } from './shared/is-main.js'const NAME = `${SERVER_NAME}-trading`@@ -56,7 +57,7 @@ async function main(): Promise<void> {)}-if (import.meta.url === `file://${process.argv[1]}`) {+if (isMainModule(import.meta.url)) {main().catch((e) => {process.stderr.write(`[${NAME}] fatal: ${e instanceof Error ? e.message : String(e)}\n`)process.exit(1)diff --git a/robinhood/hood-traders/docs/architecture.html b/robinhood/hood-traders/docs/architecture.htmlnew file mode 100644index 000000000..ac76e257e--- /dev/null+++ b/robinhood/hood-traders/docs/architecture.html@@ -0,0 +1,145 @@+<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>Architecture — hood-traders</title>+ <meta name="description" content="The observe → decide → simulate → risk-check → execute → journal loop behind every hood-traders agent." />+ <link rel="stylesheet" href="style.css" />+</head>+<body>+ <nav class="topnav">+ <div class="brand"><span class="dot"></span>hood-traders</div>+ <div class="links">+ <a href="index.html">Overview</a>+ <a href="architecture.html" class="active">Architecture</a>+ <a href="strategies.html">Strategies</a>+ <a href="quickstart.html">Quickstart</a>+ <a href="https://github.com/nirholas/hood-traders" target="_blank" rel="noopener">GitHub ↗</a>+ </div>+ </nav>++ <div class="wrap">+ <h1>Architecture</h1>+ <p class="lede">+ An agent is a strategy plugged into a fixed pipeline. The strategy only ever proposes —+ every risk cap is enforced by the agent, after simulation, before anything executes. A+ strategy cannot skip the gate, in paper mode or live.+ </p>++ <h2>The pipeline</h2>+ <div class="flow-diagram">+ <div class="flow-step">+ <div class="flow-num">1</div>+ <div class="flow-body">+ <h3>Observe — <code>Market</code> (<code>src/framework/market.ts</code>)</h3>+ <p>+ Every number a strategy sees comes from a live RPC call through the <code>hoodchain</code>+ SDK: Chainlink <code>latestRoundData()</code> for Stock Token quotes, Uniswap v3+ <code>QuoterV2</code> simulated calls for spot prices, and the live sequencer/log+ watchers for new launches. Nothing here is cached beyond a few seconds (ETH/USD, 30s)+ and nothing is fabricated — nulls propagate instead of invented numbers.+ </p>+ </div>+ </div>+ <div class="flow-step">+ <div class="flow-num">2</div>+ <div class="flow-body">+ <h3>Decide — <code>Strategy.tick()</code></h3>+ <p>+ Pure function of the current market view and open positions to a <code>Decision</code>:+ a list of <code>Intent</code>s (buy/sell proposals) and <code>Alert</code>s. Strategies+ never touch the wallet, the risk engine, or the journal directly — they cannot.+ </p>+ </div>+ </div>+ <div class="flow-step">+ <div class="flow-num">3</div>+ <div class="flow-body">+ <h3>Simulate — a real <code>eth_call</code></h3>+ <p>+ Every intent is re-quoted against live liquidity via <code>QuoterV2</code> before+ anything else happens — this is a real simulation against the current pool state, the+ same call type Uniswap's own frontend uses, not a cached or stale price.+ </p>+ </div>+ </div>+ <div class="flow-step">+ <div class="flow-num">4</div>+ <div class="flow-body">+ <h3>Risk-check — <code>RiskEngine.check()</code> (fails CLOSED)</h3>+ <p>+ Kill switch → zero/negative amount → cooldown → slippage bound → position cap → agent+ daily cap → fleet daily cap, in that order, so the journaled refusal reason is always+ the most specific true one. Any check the engine cannot satisfy refuses the trade —+ there is no default-allow path. See the full table below.+ </p>+ </div>+ </div>+ <div class="flow-step">+ <div class="flow-num">5</div>+ <div class="flow-body">+ <h3>Execute</h3>+ <p>+ <strong>Paper:</strong> the simulated fill is recorded as the trade — same code path,+ same accounting, no signature. <strong>Live:</strong> <code>buildSwapTx</code> →+ <code>ensureApproval</code> → <code>sendTransaction</code> → wait for receipt, using+ <code>hoodchain</code>'s router-flavor-aware swap builder (mainnet SwapRouter02 vs.+ testnet's classic SwapRouter).+ </p>+ </div>+ </div>+ <div class="flow-step">+ <div class="flow-num">6</div>+ <div class="flow-body">+ <h3>Journal — SQLite (<code>src/framework/journal.ts</code>)</h3>+ <p>+ Every trade AND every refusal is written, with the strategy's reason string, the risk+ verdict, and an equity mark. bigints are stored as decimal TEXT (SQLite's native+ integer is 64-bit signed; token amounts routinely exceed that). The dashboard reads+ straight from this table — nothing is held only in memory.+ </p>+ </div>+ </div>+ </div>++ <h2>Risk rails</h2>+ <p>Every rail applies identically in paper and live mode. Sells are exempt from the position/spend caps — they reduce risk, and refusing a de-risking sell because of a spend cap would trap an agent in a losing position.</p>+ <table class="risk-table">+ <thead><tr><th>Rail</th><th>Env var</th><th>Enforced where</th></tr></thead>+ <tbody>+ <tr><td>Per-position cap</td><td><code>AGENT_MAX_POSITION_USDG</code></td><td>Before any buy — projected position value must stay under the cap</td></tr>+ <tr><td>Per-agent daily spend cap</td><td><code>AGENT_MAX_DAILY_SPEND_USDG</code></td><td>Before any buy — UTC-day rolling spend</td></tr>+ <tr><td>Fleet-wide daily spend cap</td><td><code>FLEET_MAX_DAILY_SPEND_USDG</code></td><td>Before any buy, across every agent</td></tr>+ <tr><td>Slippage bound</td><td><code>AGENT_MAX_SLIPPAGE_BPS</code></td><td>Every order, buy or sell</td></tr>+ <tr><td>Cooldown</td><td><code>AGENT_COOLDOWN_SECONDS</code></td><td>Every order, buy or sell</td></tr>+ <tr><td>Kill switch</td><td><code>KILL_FILE</code> / SIGINT / <code>POST /api/kill</code></td><td>Every order — halts new risk immediately, never force-sells</td></tr>+ </tbody>+ </table>++ <h2>Paper vs. live</h2>+ <p>+ Paper mode runs the <em>identical</em> pipeline against <em>identical</em> live data — the+ only difference is step 5: paper records the QuoterV2-simulated fill as the trade, live+ signs and broadcasts it. This means a strategy validated in paper mode behaves the same way+ in live mode, modulo real-world slippage/MEV the simulation can't see. Live mode requires+ <strong>both</strong> <code>HOOD_TRADERS_LIVE=1</code> <strong>and</strong> a valid+ <code>ROBINHOOD_CHAIN_PRIVATE_KEY</code> — missing either falls back to paper, so there is no+ accidental-live path.+ </p>++ <h2>Why a fresh framework and not hoodkit</h2>+ <p>+ This package's prompt called for building on <code>hoodkit</code> (the wave-2 advanced+ SDK wrapper) if it existed. At build time it had not shipped, so <code>hood-traders</code>+ talks to <code>hoodchain</code> (the core SDK) directly through <code>src/framework/market.ts</code>+ — a thin adapter that is the only place a future <code>hoodkit</code> swap-in would touch.+ </p>++ <footer class="footer">+ <span>hood-traders · Robinhood Chain autonomous trading fleet</span>+ <span>Built by <a href="https://x.com/nichxbt" target="_blank" rel="noopener">nirholas</a> · <a href="https://three.ws" target="_blank" rel="noopener">three.ws</a></span>+ </footer>+ </div>+</body>+</html>diff --git a/robinhood/hood-traders/docs/index.html b/robinhood/hood-traders/docs/index.htmlnew file mode 100644index 000000000..4bf5e71ec--- /dev/null+++ b/robinhood/hood-traders/docs/index.html@@ -0,0 +1,115 @@+<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>hood-traders — autonomous trading agents for Robinhood Chain</title>+ <meta name="description" content="A framework and runnable fleet of autonomous agents that trade Robinhood Chain memecoins and watch Stock Token premium/discount. Real risk caps, real signed swaps, live decision journal." />+ <link rel="stylesheet" href="style.css" />+</head>+<body>+ <nav class="topnav">+ <div class="brand"><span class="dot"></span>hood-traders</div>+ <div class="links">+ <a href="index.html" class="active">Overview</a>+ <a href="architecture.html">Architecture</a>+ <a href="strategies.html">Strategies</a>+ <a href="quickstart.html">Quickstart</a>+ <a href="https://github.com/nirholas/hood-traders" target="_blank" rel="noopener">GitHub ↗</a>+ </div>+ </nav>++ <div class="wrap">+ <section class="hero">+ <div class="hero-badges">+ <span class="badge paper">◆ paper mode by default</span>+ <span class="badge">Robinhood Chain 4663 / 46630</span>+ <span class="badge">MIT licensed</span>+ </div>+ <h1>Autonomous agents that trade Robinhood Chain — with real risk caps and a live decision journal.</h1>+ <p class="lede">+ A framework + runnable fleet: strategy + wallet + risk budget + journal. Every tick observes+ live market data, simulates the fill with a real Uniswap v3 <code>eth_call</code>, checks+ every risk cap before anything executes, and journals the decision — trade or refusal —+ into SQLite. Three honest strategies ship out of the box.+ </p>+ <div class="cta-row">+ <a class="btn primary" href="quickstart.html">Run your own fleet →</a>+ <a class="btn secondary" href="architecture.html">See how it works</a>+ </div>+ </section>++ <section aria-live="polite">+ <h2>Live from Robinhood Chain mainnet</h2>+ <p>+ This ticker calls the public RPC directly from your browser right now — no server, no+ SDK bundle, just a raw JSON-RPC POST. It's the same chain the fleet trades on.+ </p>+ <div id="live-ticker" class="stat-grid">+ <div class="stat-tile"><div class="stat-label">Loading…</div><div class="stat-value">—</div></div>+ </div>+ </section>++ <section>+ <h2>A captured paper session</h2>+ <p>+ The numbers below are a real ≥30-minute paper-mode run against live mainnet data — not a+ mockup. <strong>Paper mode</strong>: every fill is simulated against the real Uniswap v3+ quote, no funds moved. See the full methodology in <a href="architecture.html">Architecture</a>.+ </p>+ <div id="session-summary" class="stat-grid">+ <div class="state-block">Session data loads from <code>session.json</code> after a captured run — see the repo's <code>tests/e2e/</code> for the harness.</div>+ </div>+ <h3>Decision journal excerpt</h3>+ <div id="session-journal" class="journal-feed"></div>+ </section>++ <section>+ <h2>Three strategies, honestly documented</h2>+ <div class="card-grid">+ <div class="card">+ <h3>launch-sniper</h3>+ <p class="edge">Enter new launchpad coins that clear round-trip + deployer-concentration filters, exit on TP/stop/time.</p>+ <ul>+ <li>Most new launches go to zero — negative-carry unless winners cover losers</li>+ <li>Honeypots can toggle a sell tax after entry</li>+ </ul>+ </div>+ <div class="card">+ <h3>momentum</h3>+ <p class="edge">Volume+price breakouts on already-graduated (liquid) tokens, trailing-stop exits.</p>+ <ul>+ <li>Breakouts on thin pools are trivially fakeable</li>+ <li>No edge in a flat or declining market — trend-only by design</li>+ </ul>+ </div>+ <div class="card">+ <h3>premium-watch</h3>+ <p class="edge">Tracks Chainlink-vs-DEX spread on Stock Tokens. <strong>Alerts-only by default</strong> — trading needs explicit eligibility.</p>+ <ul>+ <li>A premium can be correct — fading it loses on purpose</li>+ <li>No shorting primitive — only discounts are ever tradeable</li>+ </ul>+ </div>+ </div>+ <p><a href="strategies.html">Full strategy docs with live examples →</a></p>+ </section>++ <div class="callout danger">+ <strong>⚠ Risk disclaimer.</strong> This software can autonomously sign and broadcast real+ transactions with real funds in live mode. Trading is risky — most new memecoin launches go+ to zero. Paper mode is the default and touches no funds. Read the full disclaimer in the+ <a href="https://github.com/nirholas/hood-traders#readme" target="_blank" rel="noopener">README</a>+ before funding a wallet.+ </div>++ <footer class="footer">+ <span>hood-traders · Robinhood Chain autonomous trading fleet</span>+ <span>Built by <a href="https://x.com/nichxbt" target="_blank" rel="noopener">nirholas</a> · <a href="https://three.ws" target="_blank" rel="noopener">three.ws</a></span>+ </footer>+ </div>++ <script src="live-ticker.js" type="module"></script>+ <script src="session-loader.js" type="module"></script>+</body>+</html>diff --git a/robinhood/hood-traders/docs/live-ticker.js b/robinhood/hood-traders/docs/live-ticker.jsnew file mode 100644index 000000000..b9c144808--- /dev/null+++ b/robinhood/hood-traders/docs/live-ticker.js@@ -0,0 +1,60 @@+// Live ticker — raw JSON-RPC calls straight from the browser to the public+// Robinhood Chain mainnet RPC. No SDK bundle, no server: this is the same+// read-only capability any client of the chain has. Two calls:+// 1. eth_blockNumber — chain liveness+// 2. eth_call latestRoundData — AAPL's Chainlink feed, decoded by hand++const RPC_URL = 'https://rpc.mainnet.chain.robinhood.com'+const AAPL_FEED = '0x6B22A786bAa607d76728168703a39Ea9C99f2cD0'+// keccak256("latestRoundData()")[:4] — Chainlink AggregatorV3Interface selector.+const LATEST_ROUND_DATA_SELECTOR = '0xfeaf968c'++async function rpc(method, params) {+ const res = await fetch(RPC_URL, {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),+ })+ const json = await res.json()+ if (json.error) throw new Error(json.error.message)+ return json.result+}++function decodeLatestRoundData(hex) {+ // Five ABI-encoded words: roundId(uint80) answer(int256) startedAt(uint256) updatedAt(uint256) answeredInRound(uint80)+ const data = hex.slice(2)+ const words = []+ for (let i = 0; i < 5; i++) words.push(data.slice(i * 64, i * 64 + 64))+ const answer = BigInt('0x' + words[1])+ const updatedAt = Number(BigInt('0x' + words[3]))+ return { answer, updatedAt }+}++function tile(label, value) {+ return `<div class="stat-tile"><div class="stat-label">${label}</div><div class="stat-value">${value}</div></div>`+}++async function refresh() {+ const el = document.getElementById('live-ticker')+ try {+ const [blockHex] = await Promise.all([rpc('eth_blockNumber', [])])+ const blockNumber = BigInt(blockHex).toLocaleString('en-US')++ const callResult = await rpc('eth_call', [{ to: AAPL_FEED, data: LATEST_ROUND_DATA_SELECTOR }, 'latest'])+ const { answer, updatedAt } = decodeLatestRoundData(callResult)+ const priceUsd = (Number(answer) / 1e8).toFixed(2)+ const ageMin = Math.max(0, Math.floor(Date.now() / 1000 - updatedAt) / 60).toFixed(0)++ el.innerHTML = [+ tile('Mainnet block (4663)', blockNumber),+ tile('AAPL token (Chainlink)', `$${priceUsd}`),+ tile('Feed age', `${ageMin}m`),+ tile('RPC', 'rpc.mainnet.chain.robinhood.com'),+ ].join('')+ } catch (err) {+ el.innerHTML = `<div class="state-block">Couldn't reach the public RPC from your browser: ${err.message}</div>`+ }+}++refresh()+setInterval(refresh, 15_000)diff --git a/robinhood/hood-traders/docs/session-loader.js b/robinhood/hood-traders/docs/session-loader.jsnew file mode 100644index 000000000..2bbfb24f9--- /dev/null+++ b/robinhood/hood-traders/docs/session-loader.js@@ -0,0 +1,53 @@+// Loads a captured paper-session summary (session.json, written by+// `npm run test:e2e` / the 30-minute paper-mode soak run) and renders it.+// Designed-empty state when no session has been captured into docs/ yet.++function fmtUsd(n) {+ const sign = n < 0 ? '-' : ''+ return `${sign}$${Math.abs(n).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`+}++function tile(label, value, cls = '') {+ return `<div class="stat-tile"><div class="stat-label">${label}</div><div class="stat-value ${cls}">${value}</div></div>`+}++function escapeHtml(s) {+ return String(s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]))+}++async function render() {+ const summaryEl = document.getElementById('session-summary')+ const journalEl = document.getElementById('session-journal')+ try {+ const res = await fetch('session.json', { cache: 'no-store' })+ if (!res.ok) throw new Error('no session.json yet')+ const s = await res.json()++ summaryEl.innerHTML = [+ tile('Mode', s.mode === 'live' ? 'LIVE' : 'PAPER'),+ tile('Duration', `${s.durationMinutes} min`),+ tile('Network', s.network),+ tile('Agents', String(s.agents)),+ tile('Trades executed', String(s.trades)),+ tile('Refusals (risk gate working)', String(s.refusals)),+ tile('Fleet equity', fmtUsd(s.equityUsd), s.equityUsd >= 0 ? 'pos' : 'neg'),+ tile('Captured', new Date(s.capturedAt).toUTCString()),+ ].join('')++ journalEl.innerHTML = (s.journalExcerpt || [])+ .map(+ (j) =>+ `<div class="journal-row kind-${j.kind}"><span class="journal-time">${new Date(j.ts).toLocaleTimeString('en-US', { hour12: false })}</span>${escapeHtml(j.detail)}</div>`,+ )+ .join('') || '<div class="state-block">No journal rows in this excerpt.</div>'+ } catch {+ summaryEl.innerHTML = `<div class="state-block">+ No captured session yet. Run <code>npm run test:e2e</code> (a ≥30-minute live-data paper+ soak, see <a href="architecture.html">Architecture</a>) and copy its <code>session.json</code>+ output into <code>docs/</code> to populate this section.+ </div>`+ journalEl.innerHTML = ''+ }+}++render()diff --git a/robinhood/hood-traders/docs/strategies.html b/robinhood/hood-traders/docs/strategies.htmlnew file mode 100644index 000000000..c776eebb5--- /dev/null+++ b/robinhood/hood-traders/docs/strategies.html@@ -0,0 +1,122 @@+<!doctype html>+<html lang="en">+<head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>Strategies — hood-traders</title>+ <meta name="description" content="Honest edge hypotheses and failure modes for launch-sniper, momentum, and premium-watch." />+ <link rel="stylesheet" href="style.css" />+</head>+<body>+ <nav class="topnav">+ <div class="brand"><span class="dot"></span>hood-traders</div>+ <div class="links">+ <a href="index.html">Overview</a>+ <a href="architecture.html">Architecture</a>+ <a href="strategies.html" class="active">Strategies</a>+ <a href="quickstart.html">Quickstart</a>+ <a href="https://github.com/nirholas/hood-traders" target="_blank" rel="noopener">GitHub ↗</a>+ </div>+ </nav>++ <div class="wrap">+ <h1>Strategies</h1>+ <p class="lede">+ Three simple, honestly documented strategies. No ML theater — every entry/exit rule is+ readable in one file, and every strategy's <code>meta.edge</code> / <code>meta.failureModes</code>+ is a live object on the class, not a comment that can drift from the code.+ </p>++ <h2>launch-sniper</h2>+ <p><code>src/strategies/launch-sniper.ts</code> · quote token: WETH</p>+ <p><strong>Edge hypothesis:</strong> the first minutes after a NOXA instant-listing are the+ most information-rich and most volatile window a memecoin ever has. A disciplined buyer who+ only touches round-trippable, non-deployer-heavy launches, and exits mechanically instead of+ falling in love, harvests a slice of that opening volatility. The edge is speed + discipline,+ not prediction.</p>+ <h3>Entry filters (all must clear)</h3>+ <ul>+ <li><strong>Liquid route exists</strong> — a real QuoterV2 quote must resolve; un-graduated Odyssey bonding-curve tokens have no Uniswap pool yet and are skipped.</li>+ <li><strong>Round-trip retention</strong> — buy then immediately quote a sell-back; a honeypot or thin pool that loses more than <code>maxRoundTripLossPct</code> (default 35%) of value is rejected.</li>+ <li><strong>Deployer concentration</strong> — the launching wallet must hold under <code>maxDeployerPct</code> (default 15%) of total supply.</li>+ <li><strong>Freshness</strong> — only launches seen within <code>maxLaunchAgeSeconds</code> (default 5 min) are considered.</li>+ </ul>+ <h3>Exits (mechanical, first match wins)</h3>+ <ul>+ <li>Take-profit: <code>takeProfitPct</code> (default +60%)</li>+ <li>Stop-loss: <code>stopLossPct</code> (default −35%)</li>+ <li>Time exit: <code>maxHoldSeconds</code> (default 30 min), regardless of PnL</li>+ </ul>+ <h3>Failure modes</h3>+ <ul>+ <li>Most new launches trend to zero — the stop loss fires often; profitability depends on winners covering losers.</li>+ <li>Honeypots can enable a sell tax <em>after</em> entry — the entry-time round-trip check cannot see that.</li>+ <li>Odyssey bonding-curve tokens are skipped pre-graduation — this is effectively a NOXA sniper.</li>+ <li>Paper fills use the QuoterV2 mid; live, faster bots win the best fills and you eat worse slippage.</li>+ </ul>++ <h2>momentum</h2>+ <p><code>src/strategies/momentum.ts</code> · quote token: USDG</p>+ <p><strong>Edge hypothesis:</strong> a token that has already graduated to a locked Uniswap v3+ pool survived the highest-mortality phase. A subsequent breakout — price up sharply over a+ short lookback — reflects real incoming demand rather than launch-day noise, and trend-+ following it with a trailing stop captures the middle of the move while giving back only+ the tail.</p>+ <h3>Entry</h3>+ <p>Price gain over <code>lookbackSamples</code> ticks (default 6) exceeds <code>breakoutPct</code>+ (default 15%) → buy <code>entryUsdg</code> (default $10) worth.</p>+ <h3>Exits</h3>+ <ul>+ <li>Trailing stop: <code>trailingStopPct</code> (default 20%) off the post-entry peak</li>+ <li>Time exit: <code>maxHoldSeconds</code> (default 60 min)</li>+ </ul>+ <h3>Failure modes</h3>+ <ul>+ <li>Breakouts on illiquid tokens are trivially fakeable by one wallet round-tripping the pool — this is a price-only signal with no depth check.</li>+ <li>Trailing stops whipsaw in choppy markets — expect a string of small losses between real trends.</li>+ <li>Discovery scans a bounded block lookback; a breakout on a token outside that window is missed until the next pass.</li>+ <li>No edge in a flat or declining market — this is a trend-only strategy by design.</li>+ </ul>++ <h2>premium-watch</h2>+ <p><code>src/strategies/premium-watch.ts</code> · quote token: USDG · <strong>alerts-only by default</strong></p>+ <p><strong>Edge hypothesis:</strong> Stock Token pools are much thinner than the underlying+ equity market, so DEX price can drift from the Chainlink oracle when flow is one-sided. If+ the drift is a liquidity artifact, buying the discount and later selling back at fair+ captures the reversion as the pool re-equilibrates.</p>++ <div class="callout warn">+ <strong>Trading is gated, on purpose.</strong> Stock Tokens are tokenized debt securities+ (issuer: Robinhood Assets (Jersey) Ltd) and may not be offered to US/Canada/UK/Switzerland+ persons. This strategy trades convergence only when <strong>both</strong>+ <code>enableTrading: true</code> in its params <strong>and</strong>+ <code>HOOD_STOCK_TOKEN_ELIGIBLE=true</code> in the environment. Missing either keeps it+ strictly alerts-only, which is the default and the recommended mode. Displaying spread data+ and alerting are never gated.+ </div>++ <h3>Signal</h3>+ <p>Spread <code>= (dexPrice - oracle) / oracle</code>, in bps. Alerts when+ <code>|spread| >= alertThresholdBps</code> (default 50bps). Trades a discount (DEX cheap)+ when <code>spread <= -tradeThresholdBps</code> (default 150bps) — only in eligible+opted-in+ configuration.</p>+ <h3>Exits</h3>+ <ul>+ <li>Convergence: spread reverts within <code>exitThresholdBps</code> (default 20bps)</li>+ <li>Time exit: <code>maxHoldSeconds</code> (default 2h)</li>+ </ul>+ <h3>Failure modes</h3>+ <ul>+ <li>A premium/discount can be <em>correct</em> — DEX price may reflect information the ≤24h Chainlink heartbeat hasn't caught up to yet; fading it then loses on purpose.</li>+ <li>Stock Token pools are thin; the probe price doesn't reflect real trade-size slippage, and the trade itself moves the spread being arbitraged.</li>+ <li>No shorting primitive exists — only discounts are ever tradeable; premiums are alert-only by construction, not by choice.</li>+ <li>Chainlink staleness (weekend gap, feed outage) can masquerade as a discount when the oracle, not the pool, is stale.</li>+ </ul>++ <footer class="footer">+ <span>hood-traders · Robinhood Chain autonomous trading fleet</span>+ <span>Built by <a href="https://x.com/nichxbt" target="_blank" rel="noopener">nirholas</a> · <a href="https://three.ws" target="_blank" rel="noopener">three.ws</a></span>+ </footer>+ </div>+</body>+</html>diff --git a/robinhood/hood-traders/docs/style.css b/robinhood/hood-traders/docs/style.cssnew file mode 100644index 000000000..c9f62f398--- /dev/null+++ b/robinhood/hood-traders/docs/style.css@@ -0,0 +1,192 @@+:root {+ color-scheme: dark;+ --bg: #0a0a0d;+ --bg-elevated: #111116;+ --bg-card: #16161d;+ --border: #26262f;+ --border-hover: #34343f;+ --text: #eaeaf0;+ --text-dim: #9a9aa8;+ --text-faint: #66666f;+ --accent-a: #6d5ef8;+ --accent-b: #2fd0e0;+ --green: #34d399;+ --red: #f87171;+ --amber: #fbbf24;+ --radius: 12px;+ --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;+ --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;+}++* { box-sizing: border-box; }++html, body { margin: 0; padding: 0; }++body {+ background: var(--bg);+ background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(109, 94, 248, 0.14), transparent);+ color: var(--text);+ font-family: var(--font-sans);+ line-height: 1.6;+}++a { color: var(--accent-b); text-decoration: none; }+a:hover { text-decoration: underline; }+a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-b); outline-offset: 2px; }++code, pre { font-family: var(--font-mono); }+code {+ background: var(--bg-card);+ border: 1px solid var(--border);+ border-radius: 4px;+ padding: 2px 6px;+ font-size: 0.9em;+}+pre {+ background: var(--bg-card);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ padding: 16px 18px;+ overflow-x: auto;+ font-size: 13px;+ line-height: 1.5;+}+pre code { background: none; border: none; padding: 0; }++nav.topnav {+ position: sticky;+ top: 0;+ z-index: 10;+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 16px 24px;+ border-bottom: 1px solid var(--border);+ background: rgba(10, 10, 13, 0.85);+ backdrop-filter: blur(10px);+ flex-wrap: wrap;+ gap: 12px;+}+.topnav .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.01em; }+.topnav .brand .dot {+ width: 8px; height: 8px; border-radius: 50%;+ background: linear-gradient(135deg, var(--accent-a), var(--accent-b));+ box-shadow: 0 0 12px rgba(109, 94, 248, 0.6);+}+.topnav .links { display: flex; gap: 20px; font-size: 14px; }+.topnav .links a { color: var(--text-dim); }+.topnav .links a:hover, .topnav .links a.active { color: var(--text); text-decoration: none; }++.wrap { max-width: 920px; margin: 0 auto; padding: 48px 24px 96px; }+.wrap.wide { max-width: 1200px; }++h1 { font-size: 40px; letter-spacing: -0.03em; margin: 0 0 12px; }+h2 { font-size: 26px; letter-spacing: -0.02em; margin: 48px 0 16px; }+h3 { font-size: 18px; letter-spacing: -0.01em; margin: 28px 0 10px; }+p { color: var(--text-dim); margin: 0 0 16px; }+.lede { font-size: 18px; color: var(--text-dim); max-width: 640px; }++.badge {+ display: inline-flex; align-items: center; gap: 6px;+ padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;+ border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-dim);+}+.badge.paper { color: var(--accent-b); border-color: rgba(47, 208, 224, 0.3); background: rgba(47, 208, 224, 0.08); }++.hero {+ display: flex; flex-direction: column; gap: 24px;+ padding: 64px 0 40px;+ border-bottom: 1px solid var(--border);+}+.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }+.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }+.btn {+ display: inline-flex; align-items: center; gap: 8px;+ padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;+ border: 1px solid var(--border);+}+.btn.primary { background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: #0a0a0d; border: none; }+.btn.primary:hover { text-decoration: none; opacity: 0.92; }+.btn.secondary { color: var(--text); background: var(--bg-card); }+.btn.secondary:hover { text-decoration: none; border-color: var(--border-hover); }++.stat-grid {+ display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));+ gap: 12px; margin: 32px 0;+}+.stat-tile {+ background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);+ padding: 16px 18px;+}+.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 6px; }+.stat-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; }+.stat-value.pos { color: var(--green); }+.stat-value.neg { color: var(--red); }++.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 24px 0; }+.card {+ background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);+ padding: 20px;+ transition: border-color 0.15s;+}+.card:hover { border-color: var(--border-hover); }+.card h3 { margin-top: 0; }+.card .edge { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }+.card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-faint); }+.card ul li { margin-bottom: 6px; }++.journal-feed { display: flex; flex-direction: column; gap: 6px; margin: 20px 0; }+.journal-row {+ font-family: var(--font-mono); font-size: 12px; padding: 8px 12px; border-radius: 6px;+ background: var(--bg-elevated); border: 1px solid var(--border);+}+.journal-row.kind-alert { border-color: rgba(251, 191, 36, 0.3); color: #fcd34d; }+.journal-row.kind-refused { border-color: rgba(248, 113, 113, 0.3); color: #fca5a5; }+.journal-row.kind-trade { border-color: rgba(52, 211, 153, 0.3); color: #6ee7b7; }+.journal-time { color: var(--text-faint); margin-right: 8px; }++.flow-diagram {+ display: flex; flex-direction: column; gap: 0; margin: 32px 0;+}+.flow-step {+ display: flex; align-items: flex-start; gap: 16px;+ padding: 16px 0; border-bottom: 1px dashed var(--border);+}+.flow-step:last-child { border-bottom: none; }+.flow-num {+ flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;+ background: var(--bg-card); border: 1px solid var(--border);+ display: flex; align-items: center; justify-content: center;+ font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent-b);+}+.flow-body h3 { margin: 0 0 4px; font-size: 15px; }+.flow-body p { margin: 0; font-size: 13px; }++.risk-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }+.risk-table th, .risk-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }+.risk-table th { color: var(--text-faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }+.risk-table td { color: var(--text-dim); }+.risk-table code { font-size: 12px; }++.callout {+ border-radius: var(--radius); padding: 16px 20px; margin: 24px 0;+ border: 1px solid var(--border); background: var(--bg-card);+}+.callout.warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }+.callout.warn strong { color: var(--amber); }+.callout.danger { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.06); }+.callout.danger strong { color: var(--red); }++.footer {+ margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border);+ font-size: 13px; color: var(--text-faint);+ display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;+}++.state-block { text-align: center; padding: 40px 20px; color: var(--text-faint); border: 1px dashed var(--border); border-radius: var(--radius); }++@media (max-width: 640px) {+ h1 { font-size: 30px; }+ .stat-grid { grid-template-columns: repeat(2, 1fr); }+ .topnav .links { gap: 12px; font-size: 13px; }+}diff --git a/robinhood/hood-traders/scripts/testnet-trade.ts b/robinhood/hood-traders/scripts/testnet-trade.tsnew file mode 100644index 000000000..7bfc60bd4--- /dev/null+++ b/robinhood/hood-traders/scripts/testnet-trade.ts@@ -0,0 +1,100 @@+/**+ * Execute ONE real testnet-46630 trade through the full hood-traders pipeline+ * (Market.quoteBuy -> Agent-equivalent risk math -> real signed swap), using+ * hoodchain's executeSwap under the hood. Requires a funded testnet wallet:+ *+ * 1. Get testnet ETH + test Stock Tokens from+ * https://faucet.testnet.chain.robinhood.com/ (Turnstile + Google+ * Sign-In in a real browser — cannot be automated headlessly; this is a+ * documented upstream blocker, see _shared.md and robinhood-chain-sdk's+ * own tests/live/testnet-swap.test.ts, which hits the same wall).+ * 2. export ROBINHOOD_CHAIN_PRIVATE_KEY=0x...+ * 3. npm run testnet-trade+ */+import { formatEther, parseEther } from 'viem'+import { privateKeyToAccount } from 'viem/accounts'+import {+ createHoodClient,+ ensureApproval,+ executeSwap,+ quoteSwap,+ TESTNET_ADDRESSES,+ TESTNET_STOCK_TOKENS,+ erc20Abi,+ weth9Abi,+} from 'hoodchain'++const AMOUNT_IN = parseEther('0.0001')++async function main() {+ const pk = process.env.ROBINHOOD_CHAIN_PRIVATE_KEY as `0x${string}` | undefined+ if (!pk) {+ console.error(+ 'ROBINHOOD_CHAIN_PRIVATE_KEY is not set.\n\n' ++ 'This trade needs a testnet-46630 wallet funded via ' ++ 'https://faucet.testnet.chain.robinhood.com/ — that faucet requires ' ++ 'Cloudflare Turnstile + Google Sign-In in a real browser and cannot be ' ++ 'automated headlessly (same blocker hit by robinhood-chain-sdk\'s own ' ++ 'tests/live/testnet-swap.test.ts). Fund a wallet there, export the key, ' ++ 'and re-run: npm run testnet-trade',+ )+ process.exit(1)+ }++ const account = privateKeyToAccount(pk)+ const hood = createHoodClient({ chain: 'testnet', account })+ console.log(`wallet: ${account.address}`)++ const ethBalance = await hood.public.getBalance({ address: account.address })+ console.log(`ETH balance: ${formatEther(ethBalance)}`)+ if (ethBalance < parseEther('0.001')) {+ console.error(`Insufficient testnet ETH (need >= 0.001, have ${formatEther(ethBalance)}). Claim the faucet first.`)+ process.exit(1)+ }++ console.log(`quoting ${formatEther(AMOUNT_IN)} WETH -> NFLX on testnet 46630...`)+ const quote = await quoteSwap(hood, {+ tokenIn: TESTNET_ADDRESSES.weth,+ tokenOut: TESTNET_STOCK_TOKENS.NFLX,+ amountIn: AMOUNT_IN,+ })+ console.log(`quote: ${AMOUNT_IN} wei WETH -> ${quote.amountOut} wei NFLX (route: ${quote.route.fees.join('/')}bps)`)++ const wethBalance = await hood.public.readContract({+ address: TESTNET_ADDRESSES.weth,+ abi: erc20Abi,+ functionName: 'balanceOf',+ args: [account.address],+ })+ if (wethBalance < AMOUNT_IN) {+ console.log(`wrapping ${formatEther(AMOUNT_IN)} ETH -> WETH...`)+ const wrapHash = await hood.wallet!.writeContract({+ address: TESTNET_ADDRESSES.weth,+ abi: weth9Abi,+ functionName: 'deposit',+ value: AMOUNT_IN,+ })+ await hood.public.waitForTransactionReceipt({ hash: wrapHash })+ console.log(`wrapped: ${wrapHash}`)+ }++ console.log('executing swap...')+ const result = await executeSwap(hood, {+ tokenIn: TESTNET_ADDRESSES.weth,+ tokenOut: TESTNET_STOCK_TOKENS.NFLX,+ amountIn: AMOUNT_IN,+ })++ console.log('\n✓ REAL TESTNET TRADE EXECUTED')+ console.log(` tx hash: ${result.hash}`)+ console.log(` status: ${result.receipt.status}`)+ console.log(` block: ${result.receipt.blockNumber}`)+ console.log(` gas used: ${result.receipt.gasUsed}`)+ console.log(` amountOutMin: ${result.amountOutMinimum}`)+ console.log(` explorer: https://explorer.testnet.chain.robinhood.com/tx/${result.hash}`)+}++main().catch((err) => {+ console.error('testnet trade failed:', err)+ process.exit(1)+})diff --git a/robinhood/hood-traders/src/framework/fleet.ts b/robinhood/hood-traders/src/framework/fleet.tsindex 19eba7c55..66d5ac69b 100644--- a/robinhood/hood-traders/src/framework/fleet.ts+++ b/robinhood/hood-traders/src/framework/fleet.ts@@ -107,6 +107,11 @@ export class Fleet {for (const a of this.agents) a.stop()}+ /** Run exactly one tick per agent, in parallel, without arming the interval scheduler. Used by E2E tests. */+ async tickAllOnce(): Promise<void> {+ await Promise.all(this.agents.map((a) => a.tick()))+ }+/** Trip the kill switch — halts new orders across the fleet. */tripKill(reason: string): void {this.kill.trip(reason)diff --git a/robinhood/hood-traders/tests/e2e/live.test.ts b/robinhood/hood-traders/tests/e2e/live.test.tsnew file mode 100644index 000000000..6dbb4e780--- /dev/null+++ b/robinhood/hood-traders/tests/e2e/live.test.ts@@ -0,0 +1,72 @@+/**+ * Real E2E — no mocks. Talks to live Robinhood Chain mainnet RPC through the+ * full Market → Agent → Journal pipeline. This is the fast confirmation that+ * every layer wires to a real chain; the ≥30-minute paper soak (see README /+ * docs/architecture.html) is run separately as a long-lived process because a+ * 30-minute `it()` block is a poor fit for a CI-style test run.+ *+ * Run: npm run test:e2e+ */+import { afterEach, describe, expect, it } from 'vitest'+import { loadFleetConfig } from '../../src/framework/config.js'+import { Fleet } from '../../src/framework/fleet.js'+import { Market } from '../../src/framework/market.js'+import { LaunchSniper } from '../../src/strategies/launch-sniper.js'+import { Momentum } from '../../src/strategies/momentum.js'+import { PremiumWatch } from '../../src/strategies/premium-watch.js'++describe('live: mainnet reads through the Market adapter', () => {+ const market = new Market(loadFleetConfig({ HOOD_NETWORK: 'mainnet' } as NodeJS.ProcessEnv))++ it('reads the current mainnet block number', async () => {+ const bn = await market.blockNumber()+ expect(bn).toBeGreaterThan(7_000_000n) // mainnet launched 2026-07-01; sanity floor+ })++ it('reads a live Chainlink stock quote (AAPL)', async () => {+ const quote = await market.stockChainlinkPrice('AAPL')+ expect(quote).not.toBeNull()+ expect(quote!.priceUsd).toBeGreaterThan(0)+ })++ it('resolves a real ETH/USD reference from the on-chain USDG/WETH pool', async () => {+ const eth = await market.ethUsd(0) // force a fresh read, bypass cache+ expect(eth).not.toBeNull()+ expect(eth!).toBeGreaterThan(0)+ })++ it('quotes a real Uniswap v3 route (USDG -> WETH)', async () => {+ const q = await market.quoteBuy(market.usdg, market.weth, 10_000_000n) // 10 USDG+ expect(q).not.toBeNull()+ expect(q!.amountOut).toBeGreaterThan(0n)+ })+})++describe('live: a full fleet boots against mainnet and ticks without error', () => {+ let fleet: Fleet++ afterEach(() => {+ fleet?.close()+ })++ it('runs one real tick per agent against live data with zero errors', async () => {+ const config = loadFleetConfig({ HOOD_NETWORK: 'mainnet', HOOD_TRADERS_DB: ':memory:' } as NodeJS.ProcessEnv)+ fleet = new Fleet(config)+ fleet.addAgents([+ { id: 'e2e-sniper', strategy: new LaunchSniper(), tickIntervalMs: 999_999_999 },+ { id: 'e2e-momentum', strategy: new Momentum(), tickIntervalMs: 999_999_999 },+ { id: 'e2e-premium', strategy: new PremiumWatch(), tickIntervalMs: 999_999_999 },+ ])+ fleet.kill.arm()+ // One real pass through observe/decide/simulate/journal per agent, against+ // live mainnet data, without arming fleet.start()'s interval scheduler.+ await fleet.tickAllOnce()++ const statuses = fleet.agentStatuses()+ expect(statuses).toHaveLength(3)+ for (const s of statuses) {+ expect(s.ticks).toBe(1)+ expect(s.lastError).toBeNull()+ }+ }, 60_000)+})diff --git a/robinhood/hood402/INTEGRATION.md b/robinhood/hood402/INTEGRATION.mdnew file mode 100644index 000000000..d7e9b248d--- /dev/null+++ b/robinhood/hood402/INTEGRATION.md@@ -0,0 +1,153 @@+# Integrating hood402 into three.ws's x402 catalog++This describes exactly how to add `network: robinhood-chain` as an accepted rail in+three.ws's existing x402 catalog (`api/_lib/x402-spec.js` + `api/_lib/x402-paid-endpoint.js`),+using this package. **No changes were made to three.ws in this prompt** — this is the plan+for the agent that does that work.++## The two protocol mismatches to reconcile first++three.ws's catalog and hood402 both implement `exact`/EIP-3009, but they encode it+differently on the wire. An integration has to bridge these, not paper over them:++| | three.ws (`x402-spec.js`) | hood402 |+|---|---|---|+| `x402Version` | `2` (`X402_VERSION = 2`, line 81) | `1` |+| Network id | CAIP-2 (`eip155:8453`, `eip155:56`, `solana:5eykt4...`) | Plain string (`robinhood`, `robinhood-testnet`) |+| Price field | `amount` (v2; per `paymentRequirements()`, line 169) | `maxAmountRequired` (v1) |+| Envelope shape | `resource`/`description`/`mimeType` top-level, not per-`accepts` entry | Per-`accepts` entry (v1) |+| Headers | `X-PAYMENT` / `X-PAYMENT-RESPONSE` (+ a `PAYMENT-REQUIRED` mirror for older clients) | `X-PAYMENT` / `X-PAYMENT-RESPONSE` — **same headers, no change needed here** |++The header names already match — that's the easy part. The version number, network id+format, and price field name don't, and three.ws's own facilitator-capability probe+(`x402-spec.js` ~line 716) hard-checks `(k.x402Version ?? 1) === X402_VERSION` — a v1+facilitator's `/supported` response fails that check as written. **This is exactly the kind+of per-network special-case three.ws's code already has a seam for**: see+`DIRECT_NETWORKS = new Set([NETWORK_BSC_MAINNET])` (line 120) and the `selfFacilitatorEnabled()`+/ `selfFacilitatorUrl()` pair — BSC already gets bespoke handling instead of going through+the generic v2 facilitator path. Robinhood Chain should get the same treatment: a small,+explicit special case, not a generic-path retrofit.++## Recommended integration: hood402 as a library, not a second service++three.ws runs one Cloud Run container serving all of `api/**` (see the root `CLAUDE.md`+stack notes). Rather than deploying a separate `hood402-facilitator` process, **import+hood402's `verifyPayment`/`settlePayment`/`buildRequirements` directly** and call them from+a new `api/_lib/x402-robinhood.js` — this is the same shape as three.ws's existing+`selfFacilitatorEnabled()` self-settle path, just using hood402's implementation instead of+reimplementing EIP-3009 verification a second time.++```bash+npm install hood402 viem+```++```js+// api/_lib/x402-robinhood.js — new file, not a modification of x402-spec.js+import {+ buildRequirements,+ verifyPayment,+ settlePayment,+ requireNetwork,+} from 'hood402';+import { createPublicClient, createWalletClient, http } from 'viem';+import { privateKeyToAccount } from 'viem/accounts';+import { env } from './env.js';++const net = requireNetwork(env.ROBINHOOD_CHAIN_NETWORK ?? 'robinhood'); // or 'robinhood-testnet'+const transport = http(env.ROBINHOOD_CHAIN_RPC_URL ?? net.rpcUrl);+const reader = createPublicClient({ chain: net.chain, transport });++const account = privateKeyToAccount(env.ROBINHOOD_FACILITATOR_PRIVATE_KEY);+const wallet = createWalletClient({ account, chain: net.chain, transport });++export function robinhoodRequirements(resourceUrl, amountAtomic) {+ return buildRequirements({+ price: { atomic: String(amountAtomic) },+ payTo: env.X402_PAY_TO_ROBINHOOD,+ resource: resourceUrl,+ network: net.id,+ });+}++export async function verifyRobinhoodPayment(paymentPayload, requirements) {+ return verifyPayment({ payload: paymentPayload, requirements, reader });+}++export async function settleRobinhoodPayment(paymentPayload, requirements) {+ return settlePayment({+ payload: paymentPayload,+ requirements,+ wallet,+ account: account.address,+ reader,+ });+}+```++Then in `x402-spec.js`, add a Robinhood Chain branch alongside the existing Base/BSC/Solana+ones — modeled directly on the `env.X402_PAY_TO_BASE` block (line 208) and the+`DIRECT_NETWORKS` special case (line 120):++- Add `NETWORK_ROBINHOOD_MAINNET = 'eip155:4663'` and `NETWORK_ROBINHOOD_TESTNET = 'eip155:46630'`+ next to the existing `NETWORK_*` constants (hood402's `networks.ts` already recognizes+ both of these CAIP-2 strings as aliases for its own `'robinhood'`/`'robinhood-testnet'`+ ids, so passing either form into `buildRequirements`/`requireNetwork` works).+- Add Robinhood Chain to `DIRECT_NETWORKS` (or an equivalent new set) so the generic v2+ facilitator-probe path (`/supported` with the `x402Version === 2` check) is skipped for+ it — verification and settlement route to `verifyRobinhoodPayment`/`settleRobinhoodPayment`+ above instead, exactly like BSC's direct-settlement path.+- In `paymentRequirements()`, push a Robinhood Chain accept entry when+ `env.X402_PAY_TO_ROBINHOOD` is set, translating the v2 `amount` into hood402's+ `maxAmountRequired` via `robinhoodRequirements(resourceUrl, amount).maxAmountRequired`+ rather than duplicating the price-atomics math.+- In the incoming-payment dispatch (wherever `x402-spec.js` currently branches on+ `paymentPayload.network` to route Base vs. BSC vs. Solana verification), add a branch+ for `NETWORK_ROBINHOOD_MAINNET`/`NETWORK_ROBINHOOD_TESTNET` calling+ `verifyRobinhoodPayment`/`settleRobinhoodPayment`.++## Alternative: point at a standalone hood402-facilitator++If isolating the Robinhood Chain gas key from the main API container is preferred, deploy+[`facilitator/`](./facilitator) as its own Cloud Run service instead (see+`facilitator/README.md`) and call its HTTP `/verify` + `/settle` endpoints from+`x402-robinhood.js` in place of the direct `verifyPayment`/`settlePayment` calls — same+`DIRECT_NETWORKS` wiring in `x402-spec.js`, just with an HTTP hop instead of an in-process+call. Use hood402's own `FacilitatorClient` for this:++```js+import { FacilitatorClient } from 'hood402';+const facilitator = new FacilitatorClient({ url: env.ROBINHOOD_FACILITATOR_URL });+// facilitator.verify(paymentPayload, requirements) / facilitator.settle(...)+```++This still bypasses the generic v2 `/supported`-probe path (`DIRECT_NETWORKS`) since the+facilitator's `/supported` reports `x402Version: 1`.++## Environment variables to add++| Variable | Where it's read | Purpose |+|---|---|---|+| `X402_PAY_TO_ROBINHOOD` | `x402-spec.js`, `payTo` on the accept entry | The address that receives USDG payments. |+| `ROBINHOOD_CHAIN_NETWORK` | `x402-robinhood.js` | `robinhood` (mainnet 4663) or `robinhood-testnet` (46630). |+| `ROBINHOOD_CHAIN_RPC_URL` | `x402-robinhood.js` | Optional RPC override (defaults to the public endpoint). |+| `ROBINHOOD_FACILITATOR_PRIVATE_KEY` | `x402-robinhood.js` (library mode only) | The gas wallet that broadcasts settlement. Never holds user funds. |+| `ROBINHOOD_FACILITATOR_URL` | `x402-robinhood.js` (standalone-facilitator mode only) | Base URL of a deployed `hood402-facilitator`. |++## Settlement wallet++Either mode needs one funded EVM key with a small amount of ETH on Robinhood Chain for+gas (USDG settlement itself is gasless for the *payer* — EIP-3009 — but the relayer/+facilitator still pays gas to broadcast). Store it the same way three.ws stores its other+chain keys: a Secret Manager-backed env var on the Cloud Run service, never in code or+`.env` files with real values (`.gitignore` already covers `.env*` — see the root+`CLAUDE.md` "Known traps" section for the existing env-var handling conventions on this+project).++## What this buys three.ws++Once wired, `network: robinhood-chain` becomes a normal entry in the existing+`paymentRequirements()` `accepts[]` array — any agent that already knows how to pay a+three.ws x402 endpoint (Base, BSC, Solana) sees a fourth option with no client-side changes+needed on their end for the ones that already speak generic v1 `exact`/EIP-3009 (most+x402 SDKs do, since it's the original scheme). Agents using hood402's own client, or any+other v1-speaking x402 client, can pay a three.ws endpoint in USDG directly.diff --git a/robinhood/hood402/README.md b/robinhood/hood402/README.mdnew file mode 100644index 000000000..e4591c5b7--- /dev/null+++ b/robinhood/hood402/README.md@@ -0,0 +1,169 @@+# hood402++**The x402 payment rail for USDG on [Robinhood Chain](https://docs.robinhood.com/chain/) (chain ID 4663).**++Spec-conformant `exact`/EIP-3009 server middleware, a paying client, and a self-hostable+facilitator. Gasless USDG micropayments over plain HTTP 402 — no accounts, no API keys, no+subscriptions. hood402 follows the standard [x402 protocol](https://github.com/coinbase/x402)+wire format exactly, so it interoperates with the wider x402 client ecosystem, not just its+own client.++Docs: **https://nirholas.github.io/hood402/**++## Why EIP-3009, and how we know++USDG (Paxos Global Dollar) is a facet/diamond-router stablecoin. Its base implementation+doesn't expose EIP-3009 directly, but `getFacet(bytes4)` proves the facet is registered —+verified live against both networks:++```bash+npm run verify:usdg+```++```+robinhood (chain 4663) — USDG 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168+ getFacet(transferWithAuthorization) -> 0x780d30b6a89BC9Eef953a543aA288c3B05b01309 [OK]+ getFacet(receiveWithAuthorization) -> 0x780d30b6a89BC9Eef953a543aA288c3B05b01309 [OK]+ getFacet(authorizationState) -> 0x780d30b6a89BC9Eef953a543aA288c3B05b01309 [OK]+ DOMAIN_SEPARATOR() -> 0x7a3d7400b27830f4f91c2c16a082486d67c1befecaec2f53b33f1f35d5b62036+ Expected domain: name="Global Dollar", version="1"++robinhood-testnet (chain 46630) — USDG 0x7E955252E15c84f5768B83c41a71F9eba181802F+ getFacet(transferWithAuthorization) -> 0x08f560a85db40a7d4ac49b4F44f1D38e5B8aB811 [OK]+ ...++PASS: USDG EIP-3009 facet registration confirmed on both networks.+```++The EIP-712 domain separator was reconstructed offline (`name="Global Dollar"`,+`version="1"`) and matches the live `DOMAIN_SEPARATOR()` on both chains exactly. This is+the load-bearing decision behind hood402: settlement is the standard, gasless+`transferWithAuthorization` path — the same mechanism USDC uses, and the one x402's `exact`+scheme is designed around. No custom scheme, no proxy contract, no Permit2 fallback needed.++See [Blockscout — mainnet USDG](https://robinhoodchain.blockscout.com/address/0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168)+and [`docs/index.html`](./docs/index.html#conformance) for the full write-up.++## Install++```bash+npm install hood402 viem+```++Node ≥ 20. Until the package is on npm, install from a checkout: `npm i ../hood402`.++## Packages in this repo++| Path | What it is |+|---|---|+| `hood402` (this package) | Protocol types, the `exact`/EIP-3009 scheme, `verifyPayment`/`settlePayment`, and the `hood402/server` + `hood402/client` subpath exports |+| [`facilitator/`](./facilitator) | A standalone, self-hostable facilitator service — `/verify`, `/settle`, `/supported`, `/metrics`, an idempotent SQLite ledger, and a Dockerfile |++## Quickstart — server++```ts+import express from 'express'+import { paywall } from 'hood402/server'++const app = express()++app.get('/premium', paywall({+ price: '0.01', // USDG+ payTo: '0xYourReceivingAddress',+ network: 'robinhood', // or 'robinhood-testnet'+ facilitator: 'https://your-facilitator.example.com',+}), (req, res) => {+ res.json({ data: 'unlocked after a settled USDG payment' })+})+```++No facilitator? Pass `wallet` (a viem `WalletClient` holding a gas key), `account`, and+`reader` (a viem `PublicClient`) instead — the server verifies and settles locally:++```ts+import { createPublicClient, createWalletClient, http } from 'viem'+import { privateKeyToAccount } from 'viem/accounts'+import { robinhood } from 'viem/chains'+import { paywall } from 'hood402/server'++const account = privateKeyToAccount(process.env.FACILITATOR_PRIVATE_KEY as `0x${string}`)+const transport = http('https://rpc.mainnet.chain.robinhood.com')++app.get('/premium', paywall({+ price: '0.01',+ payTo: '0xYourReceivingAddress',+ network: 'robinhood',+ wallet: createWalletClient({ account, chain: robinhood, transport }),+ account: account.address,+ reader: createPublicClient({ chain: robinhood, transport }),+}), (req, res) => res.json({ data: 'unlocked' }))+```++Hono works too — use `honoPaywall` from `hood402/server` with the same options.++## Quickstart — client++```ts+import { Hood402Client, fromAccount } from 'hood402/client'+import { privateKeyToAccount } from 'viem/accounts'++const account = privateKeyToAccount(process.env.ROBINHOOD_CHAIN_PRIVATE_KEY as `0x${string}`)+const client = new Hood402Client({+ signer: fromAccount(account),+ maxSpendPerOrigin: '1.00', // hard cap in USDG — refuses to sign above it+})++const res = await client.fetch('https://api.example.com/premium')+console.log(await res.json()) // the 402 was paid automatically+```++`client.fetchWithReceipt(url)` returns the response *and* the decoded+`X-PAYMENT-RESPONSE` settlement receipt (transaction hash, network, payer). In the+browser, build a `Signer` from an injected wallet with `fromWalletClient` instead of+`fromAccount`.++## Quickstart — facilitator++See [`facilitator/README.md`](./facilitator/README.md).++## Security model++- **The facilitator never holds user funds.** It relays signed EIP-3009 authorizations —+ the payer's signature fixes the amount and recipient; the facilitator can only choose+ *whether* to broadcast, not *what*.+- **Replay protection is two-layered.** Every authorization carries a random 32-byte nonce+ checked against on-chain `authorizationState` before verification passes, and the+ facilitator's SQLite ledger claims an idempotency slot on `(network, payer, nonce)`+ before broadcasting — a retried `/settle` for the same signed payment returns the+ original transaction instead of double-spending gas.+- **Validity windows are short by default** (`client.fetch`'s signer sets a 300-second+ window) — a leaked signature has a narrow blast radius.+- **The client enforces a hard spend cap per origin** (`maxSpendPerOrigin`) — it refuses to+ sign a payment that would exceed the cap, before any network call.+- **Keys are env vars only.** `FACILITATOR_PRIVATE_KEY` (the gas wallet) and+ `ROBINHOOD_CHAIN_PRIVATE_KEY` (a payer) are never hardcoded or logged. See+ [`.env.example`](./.env.example).++## Development++```bash+npm install+npm run build+npm test # vitest — the exact/EIP-3009 state machine, 65 tests+npm run verify:usdg # live on-chain proof of the EIP-3009 facet + domain separator+npm run e2e # full interop proof — see examples/e2e.ts++cd facilitator && npm install && npm test # 18 more tests: ledger idempotency + HTTP endpoints+```++`npm run e2e` proves the whole flow against live chain state: real mainnet reads, a real+HTTP 402 → sign → pay round trip over an actual socket, a real testnet RPC verify call, and+a real `eth_call` simulation of the settlement transaction. It states plainly which parts+are live broadcast vs. simulation — see the script's own header comment for the full+rationale.++## License++MIT © 2026 nirholas++Built by [nirholas](https://x.com/nichxbt) · [three.ws](https://three.ws)diff --git a/robinhood/hood402/facilitator/Dockerfile b/robinhood/hood402/facilitator/Dockerfileindex fe8a24211..4361781ea 100644--- a/robinhood/hood402/facilitator/Dockerfile+++ b/robinhood/hood402/facilitator/Dockerfile@@ -2,16 +2,22 @@# depends on the sibling `hood402` package:# docker build -f facilitator/Dockerfile -t hood402-facilitator .FROM node:22-slim AS build-WORKDIR /repo# 1. Build the core protocol package and pack it into a tarball so the# facilitator installs a real copy (not a symlink out of the build context).+# Isolated under /core, sibling to (not nested inside) /app below — the root+# package.json declares `"workspaces": ["facilitator"]` for local dev, and+# npm auto-detects any ANCESTOR directory with a `workspaces` field, even+# without `-w`. Nesting the facilitator's own install under that ancestor+# silently hoists its deps to the wrong node_modules; a disjoint directory+# tree avoids the false workspace detection entirely.+WORKDIR /coreCOPY package.json tsconfig.json tsup.config.ts ./COPY src ./srcRUN npm install && npm run build && npm pack --pack-destination /tmp-# 2. Build the facilitator against that tarball.-WORKDIR /repo/facilitator+# 2. Build the facilitator against that tarball, in its own directory tree.+WORKDIR /appCOPY facilitator/package.json facilitator/tsconfig.json ./RUN CORE_TARBALL=$(ls /tmp/hood402-*.tgz) && npm pkg set dependencies.hood402="file:$CORE_TARBALL"RUN npm install@@ -23,8 +29,8 @@ FROM node:22-slim AS runtimeENV NODE_ENV=productionWORKDIR /app-COPY --from=build /repo/facilitator/node_modules ./node_modules-COPY --from=build /repo/facilitator/dist ./dist+COPY --from=build /app/node_modules ./node_modules+COPY --from=build /app/dist ./distCOPY facilitator/package.json ./package.jsonRUN mkdir -p /app/data && useradd --system --uid 10001 hood402 && chown -R hood402 /appdiff --git a/robinhood/hood402/facilitator/README.md b/robinhood/hood402/facilitator/README.mdnew file mode 100644index 000000000..05f1407c4--- /dev/null+++ b/robinhood/hood402/facilitator/README.md@@ -0,0 +1,126 @@+# hood402-facilitator++A self-hostable x402 facilitator for USDG on Robinhood Chain. Verifies and settles+`exact`/EIP-3009 payments per the [x402 spec](https://github.com/coinbase/x402), backed by an+idempotent SQLite ledger. This is what `hood402/server`'s `paywall({ facilitator })` option+talks to — and any other x402-speaking resource server can use it too, since it implements+the standard `/verify` and `/settle` HTTP contract.++Built on the [`hood402`](..) protocol package. Part of the [hood402](..) repo.++## Why run your own facilitator++- **No vendor lock-in.** Point `paywall({ facilitator })` at your own instance instead of a+ third party's — you control uptime, key custody, and settlement policy.+- **Idempotent by construction.** A `(network, payer, nonce)` unique key in the SQLite+ ledger means a retried `/settle` call for the same signed payment returns the original+ transaction instead of broadcasting (and paying gas) twice.+- **Zero native dependencies.** The ledger uses Node's built-in `node:sqlite` — no+ `better-sqlite3`, no native compilation step, trivial Docker builds.++## Install & run++```bash+git clone https://github.com/nirholas/hood402.git+cd hood402 && npm install && npm run build # build the core `hood402` package first+cd facilitator && npm install && npm run build++cp ../.env.example .env # fill in FACILITATOR_PRIVATE_KEY at minimum+npm start+```++```+hood402-facilitator listening on :4021 — signer 0x... — networks: robinhood, robinhood-testnet+```++### Environment variables++| Variable | Required | Default | Meaning |+|---|---|---|---|+| `FACILITATOR_PRIVATE_KEY` | yes | — | The gas wallet that broadcasts settlement transactions. Needs ETH on every network it settles. Never holds user funds — it only relays signed EIP-3009 authorizations. |+| `FACILITATOR_NETWORKS` | no | `robinhood,robinhood-testnet` | Comma-separated networks to settle on. |+| `ROBINHOOD_RPC_URL` | no | public mainnet RPC | Override the mainnet RPC (e.g. an Alchemy endpoint for higher rate limits). |+| `ROBINHOOD_TESTNET_RPC_URL` | no | public testnet RPC | Override the testnet RPC. |+| `PORT` | no | `4021` | HTTP port. |+| `LEDGER_PATH` | no | `./data/hood402-ledger.sqlite` | SQLite ledger file path. |++## API++### `GET /healthz`+```json+{ "ok": true, "signer": "0x...", "networks": ["robinhood", "robinhood-testnet"] }+```++### `GET /supported`+The `(x402Version, scheme, network)` triples this facilitator settles — per spec, so any+x402 client can discover compatibility before paying.+```json+{ "kinds": [{ "x402Version": 1, "scheme": "exact", "network": "robinhood" }, ...] }+```++### `POST /verify`+```json+{ "paymentPayload": { "...": "the decoded X-PAYMENT payload" }, "paymentRequirements": { "...": "the 402 challenge's requirement" } }+```+Runs the full state machine: structure → EIP-3009 signature recovery → on-chain replay check+(`authorizationState`) → on-chain balance check (`balanceOf`). Returns+`{ "isValid": true, "payer": "0x..." }` or `{ "isValid": false, "invalidReason": "..." }`.++### `POST /settle`+Same request shape as `/verify`. Re-verifies, then broadcasts+`transferWithAuthorization` and awaits the receipt.+```json+{ "success": true, "transaction": "0x...", "network": "robinhood", "payer": "0x..." }+```+Idempotent: calling `/settle` again with the *same* `(payer, nonce)` returns the original+result instead of re-broadcasting. A concurrent duplicate mid-flight gets `409` with+`errorReason: "authorization_already_used"`.++### `GET /metrics`+Prometheus text format — settlement counts by status and total USDG settled (atomic units).++## Deploying to Google Cloud Run++```bash+# from robinhood/hood402/ (the repo root — the facilitator depends on the sibling package)+docker build -f facilitator/Dockerfile -t hood402-facilitator .++gcloud run deploy hood402-facilitator \+ --image hood402-facilitator \+ --region us-central1 \+ --port 4021 \+ --set-env-vars FACILITATOR_NETWORKS=robinhood,robinhood-testnet \+ --set-secrets FACILITATOR_PRIVATE_KEY=hood402-facilitator-key:latest \+ --min-instances 1+```++The SQLite ledger lives at `/app/data` inside the container. Cloud Run's filesystem is+ephemeral per-instance — for production durability, either mount a Cloud Storage FUSE+volume at `/app/data`, or point `LEDGER_PATH` at a persistent disk. A lost ledger only+risks re-broadcasting an already-settled nonce, which the on-chain+`authorizationState` check catches before any gas is spent — the ledger is an+optimization for skipping a wasted RPC round trip, not the sole source of truth for+double-spend prevention.++## Docker build locally++```bash+docker build -f facilitator/Dockerfile -t hood402-facilitator .+docker run --rm -p 4021:4021 \+ -e FACILITATOR_PRIVATE_KEY=0x... \+ -e FACILITATOR_NETWORKS=robinhood-testnet \+ hood402-facilitator+```++## Publishing++This package's `hood402` dependency is `file:..` for local development inside the monorepo.+Before `npm publish`, change it to a real semver range (e.g. `"hood402": "^0.1.0"`) matching+the version actually published to the registry — `npm pack` succeeds either way, but a+`file:` dependency does not resolve for an external installer.++## License++MIT © 2026 nirholas++Built by [nirholas](https://x.com/nichxbt) · [three.ws](https://three.ws)diff --git a/robinhood/hoodkit/examples/react-demo/index.html b/robinhood/hoodkit/examples/react-demo/index.htmlnew file mode 100644index 000000000..02e61943a--- /dev/null+++ b/robinhood/hoodkit/examples/react-demo/index.html@@ -0,0 +1,12 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>hoodkit — live dashboard demo</title>+ </head>+ <body>+ <div id="root"></div>+ <script type="module" src="/src/main.tsx"></script>+ </body>+</html>diff --git a/robinhood/hoodkit/examples/react-demo/package.json b/robinhood/hoodkit/examples/react-demo/package.jsonnew file mode 100644index 000000000..1233d7b83--- /dev/null+++ b/robinhood/hoodkit/examples/react-demo/package.json@@ -0,0 +1,26 @@+{+ "name": "hoodkit-react-demo",+ "private": true,+ "version": "0.1.0",+ "description": "Live dashboard demo: streaming Stock Token prices + a real-time NOXA/Odyssey launch feed, built with hoodkit/react.",+ "type": "module",+ "scripts": {+ "dev": "vite",+ "build": "vite build",+ "preview": "vite preview"+ },+ "dependencies": {+ "hoodchain": "file:../../../robinhood-chain-sdk",+ "hoodkit": "file:../..",+ "react": "^19.0.0",+ "react-dom": "^19.0.0",+ "viem": "^2.55.0"+ },+ "devDependencies": {+ "@types/react": "^19.0.0",+ "@types/react-dom": "^19.0.0",+ "@vitejs/plugin-react": "^4.3.0",+ "typescript": "^5.9.0",+ "vite": "^6.0.0"+ }+}diff --git a/robinhood/hoodkit/examples/react-demo/src/main.tsx b/robinhood/hoodkit/examples/react-demo/src/main.tsxnew file mode 100644index 000000000..3f34c0571--- /dev/null+++ b/robinhood/hoodkit/examples/react-demo/src/main.tsx@@ -0,0 +1,10 @@+import { StrictMode } from 'react'+import { createRoot } from 'react-dom/client'+import { App } from './App.js'+import './style.css'++createRoot(document.getElementById('root')!).render(+ <StrictMode>+ <App />+ </StrictMode>,+)diff --git a/robinhood/hoodkit/examples/react-demo/tsconfig.json b/robinhood/hoodkit/examples/react-demo/tsconfig.jsonnew file mode 100644index 000000000..3444bd2dd--- /dev/null+++ b/robinhood/hoodkit/examples/react-demo/tsconfig.json@@ -0,0 +1,16 @@+{+ "compilerOptions": {+ "target": "ES2022",+ "module": "ESNext",+ "moduleResolution": "Bundler",+ "lib": ["ES2023", "DOM", "DOM.Iterable"],+ "jsx": "react-jsx",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "resolveJsonModule": true,+ "isolatedModules": true,+ "noEmit": true+ },+ "include": ["src"]+}diff --git a/robinhood/hoodkit/examples/react-demo/vite.config.ts b/robinhood/hoodkit/examples/react-demo/vite.config.tsnew file mode 100644index 000000000..736c0f3de--- /dev/null+++ b/robinhood/hoodkit/examples/react-demo/vite.config.ts@@ -0,0 +1,9 @@+import { defineConfig } from 'vite'+import react from '@vitejs/plugin-react'++export default defineConfig({+ plugins: [react()],+ optimizeDeps: {+ exclude: ['hoodkit', 'hoodchain'],+ },+})diff --git a/robinhood/hoodkit/src/indexer/index.ts b/robinhood/hoodkit/src/indexer/index.tsindex ea863fc8a..04288dd9b 100644--- a/robinhood/hoodkit/src/indexer/index.ts+++ b/robinhood/hoodkit/src/indexer/index.ts@@ -14,11 +14,11 @@ type Database = BetterSqlite3.Databaseconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))/**- * Retry a public-RPC `getLogs` call with exponential backoff on transient- * failures (rate limiting is common on public endpoints during a full-history+ * Retry a public-RPC call with exponential backoff on transient failures+ * (rate limiting is common on public endpoints during a full-history* backfill — a bare call would abort the whole sync on the first 429).*/-async function getLogsWithRetry<T>(fn: () => Promise<T>, attempts = 5, baseDelayMs = 400): Promise<T> {+async function withRetry<T>(fn: () => Promise<T>, attempts = 5, baseDelayMs = 1000): Promise<T> {let lastError: unknownfor (let attempt = 0; attempt < attempts; attempt++) {try {@@ -76,6 +76,13 @@ export interface IndexerOptions {chunkSize?: bigint/** Concurrent `getBlock` timestamp fetches. @defaultValue `8` */timestampConcurrency?: number+ /**+ * Delay between successive backfill chunk requests in ms. A full-history+ * sync issues many sequential `eth_getLogs` calls; public RPC endpoints+ * commonly rate-limit bursty clients, so a small delay is the difference+ * between a clean backfill and a wall of 429s. @defaultValue `50`+ */+ throttleMs?: number}/** Progress callback payload during {@link Indexer.sync}. */@@ -119,6 +126,7 @@ export class Indexer {private readonly tokens: Address[]private readonly chunkSize: bigintprivate readonly timestampConcurrency: number+ private readonly throttleMs: numberprivate poolsByToken = new Map<string, PoolInfo[]>()/** @internal Use {@link createIndexer}. */@@ -128,6 +136,7 @@ export class Indexer {this.tokens = options.tokens.map((t) => getAddress(t))this.chunkSize = options.chunkSize ?? 5000nthis.timestampConcurrency = options.timestampConcurrency ?? 8+ this.throttleMs = options.throttleMs ?? 50this.db.pragma('journal_mode = WAL')this.db.exec(SCHEMA)this.db.prepare('INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)').run('chainId', String(this.client.chain.id))@@ -197,7 +206,7 @@ export class Indexer {let from = options.fromBlock ?? this.getCursor(tKey, head)for (let start = from; start <= head; start += this.chunkSize) {const to = start + this.chunkSize - 1n > head ? head : start + this.chunkSize - 1n- const logs = await getLogsWithRetry(() =>+ const logs = await withRetry(() =>this.client.public.getLogs({ address: token, event: TRANSFER_EVENT, fromBlock: start, toBlock: to }),)const tx = this.db.transaction((rows: typeof logs) => {@@ -211,6 +220,7 @@ export class Indexer {tx(logs)this.setCursor(tKey, to + 1n)options.onProgress?.({ kind: 'transfers', target: token, fromBlock: start, toBlock: to, head, inserted: logs.length })+ if (to < head && this.throttleMs > 0) await sleep(this.throttleMs)}// --- Swaps (per pool) ---@@ -220,7 +230,7 @@ export class Indexer {from = (options.swapFromBlock ?? options.fromBlock) ?? this.getCursor(sKey, head)for (let start = from; start <= head; start += this.chunkSize) {const to = start + this.chunkSize - 1n > head ? head : start + this.chunkSize - 1n- const logs = await getLogsWithRetry(() =>+ const logs = await withRetry(() =>this.client.public.getLogs({ address: pool.pool, event: uniswapV3SwapEvent, fromBlock: start, toBlock: to }),)const tx = this.db.transaction((rows: typeof logs) => {@@ -238,6 +248,7 @@ export class Indexer {tx(logs)this.setCursor(sKey, to + 1n)options.onProgress?.({ kind: 'swaps', target: pool.pool, fromBlock: start, toBlock: to, head, inserted: logs.length })+ if (to < head && this.throttleMs > 0) await sleep(this.throttleMs)}}}@@ -254,7 +265,7 @@ export class Indexer {let fetched = 0for (let i = 0; i < missing.length; i += this.timestampConcurrency) {const slice = missing.slice(i, i + this.timestampConcurrency)- const results = await Promise.all(slice.map((b) => this.client.public.getBlock({ blockNumber: b })))+ const results = await Promise.all(slice.map((b) => withRetry(() => this.client.public.getBlock({ blockNumber: b }))))const tx = this.db.transaction(() => {results.forEach((block, j) => {insert.run(Number(slice[j]), Number(block.timestamp))@@ -262,6 +273,7 @@ export class Indexer {})})tx()+ if (i + this.timestampConcurrency < missing.length && this.throttleMs > 0) await sleep(this.throttleMs)}if (onProgress && missing.length > 0) {onProgress({ kind: 'timestamps', target: getAddress('0x0000000000000000000000000000000000000000'), fromBlock: 0n, toBlock: 0n, head: 0n, inserted: fetched })@@ -279,38 +291,30 @@ export class Indexer {const t = getAddress(token)const minBalance = options.minBalance ?? 1nconst decimals = getStockTokenByAddress(t)?.decimals ?? 18- const rows = this.db- .prepare(- `SELECT DISTINCT addr FROM (- SELECT to_addr AS addr FROM transfers WHERE token = ?- UNION SELECT from_addr AS addr FROM transfers WHERE token = ?- )`,- )- .all(t, t) as Array<{ addr: string }>++ // Two full-table (indexed on `token`) scans total, aggregated in JS+ // bigints in one pass — NOT one query per candidate address (that was+ // O(distinct addresses × rows) and times out past a few thousand+ // transfers). SQLite SUM() is avoided entirely because 18-decimal token+ // values routinely exceed both its 64-bit integer range and float64+ // precision.+ const balances = new Map<string, bigint>()+ const inbound = this.db.prepare('SELECT to_addr AS addr, value FROM transfers WHERE token = ?').all(t) as Array<{ addr: string; value: string }>+ for (const row of inbound) balances.set(row.addr, (balances.get(row.addr) ?? 0n) + BigInt(row.value))+ const outbound = this.db.prepare('SELECT from_addr AS addr, value FROM transfers WHERE token = ?').all(t) as Array<{ addr: string; value: string }>+ for (const row of outbound) balances.set(row.addr, (balances.get(row.addr) ?? 0n) - BigInt(row.value))const holders: Holder[] = []const divisor = 10 ** decimals- for (const row of rows) {- if (row.addr === '0x0000000000000000000000000000000000000000') continue- // Net balance recomputed exactly in JS bigints (SQLite SUM would lose- // precision on 18-decimal token values).- const balance = this.exactBalance(t, row.addr)+ for (const [addr, balance] of balances) {+ if (addr === '0x0000000000000000000000000000000000000000') continueif (balance >= minBalance) {- holders.push({ address: getAddress(row.addr as Address), balance, balanceFormatted: Number(balance) / divisor })+ holders.push({ address: getAddress(addr as Address), balance, balanceFormatted: Number(balance) / divisor })}}return holders.sort((a, b) => (b.balance > a.balance ? 1 : b.balance < a.balance ? -1 : 0))}- private exactBalance(token: Address, address: string): bigint {- const inbound = this.db.prepare('SELECT value FROM transfers WHERE token = ? AND to_addr = ?').all(token, address) as Array<{ value: string }>- const outbound = this.db.prepare('SELECT value FROM transfers WHERE token = ? AND from_addr = ?').all(token, address) as Array<{ value: string }>- let bal = 0n- for (const r of inbound) bal += BigInt(r.value)- for (const r of outbound) bal -= BigInt(r.value)- return bal- }-/** Number of holders with a positive balance (see {@link Indexer.holders} accuracy note). */holderCount(token: Address): number {return this.holders(token).lengthdiff --git a/robinhood/hoodkit/tests/live/mainnet.test.ts b/robinhood/hoodkit/tests/live/mainnet.test.tsindex 7d0638f62..c5cbfc86a 100644--- a/robinhood/hoodkit/tests/live/mainnet.test.ts+++ b/robinhood/hoodkit/tests/live/mainnet.test.ts@@ -119,6 +119,7 @@ describe('live: Indexer — full holder-history backfill vs Blockscout', () => {path: dbPath,tokens: [WEN_TOKEN],chunkSize: 50_000n,+ throttleMs: 120,})try {const head = await hood.public.getBlockNumber()diff --git a/scripts/rh-biome-check.mjs b/scripts/rh-biome-check.mjsnew file mode 100644index 000000000..d850e6eac--- /dev/null+++ b/scripts/rh-biome-check.mjs@@ -0,0 +1,15 @@+import { chromium } from 'playwright';+const BASE = 'http://localhost:8080';+const RH_COIN = '0x6b21b4567EfAd992B65f8a92457B45a74ed59486';+const browser = await chromium.launch({ headless: true });+const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });+await page.goto(`${BASE}/temporary?coin=${RH_COIN}&name=BiomeCheck`, { waitUntil: 'domcontentloaded', timeout: 45000 });+await page.waitForTimeout(5000);+// Dismiss the controls overlay if present (Esc closes it per the HUD legend).+await page.keyboard.press('Escape').catch(() => {});+await page.waitForTimeout(500);+const biomeId = await page.evaluate(() => window.__CC__?.env?.biome?.id || null);+const biomeLabel = await page.evaluate(() => window.__CC__?.env?.biome?.label || null);+console.log('biome.id =', biomeId, '| label =', biomeLabel);+await page.screenshot({ path: '/tmp/claude-1000/-workspaces-three-ws/bbd67923-b6d3-4593-92c8-9acb04d85900/scratchpad/rh-world-clean.png' });+await browser.close();diff --git a/scripts/rh-play-e2e-control.mjs b/scripts/rh-play-e2e-control.mjsnew file mode 100644index 000000000..411c86f93--- /dev/null+++ b/scripts/rh-play-e2e-control.mjs@@ -0,0 +1,11 @@+import { chromium } from 'playwright';+const BASE = 'http://localhost:8080';+// A real, well-known pump.fun-style mint format (not necessarily live) just to+// compare error surface with a Solana-chain world — control group.+const CONTROL_MINT = '7GCihgDB8fe6KNjn2MYtkzZcRjQy3t9GHdC8uHYmW2hr';+const browser = await chromium.launch({ headless: true });+const page = await browser.newPage();+page.on('response', (res) => { if (res.status() >= 400) console.log(res.status(), res.url()); });+await page.goto(`${BASE}/temporary?coin=${CONTROL_MINT}&name=CtrlTester`, { waitUntil: 'domcontentloaded', timeout: 45000 });+await page.waitForTimeout(6000);+await browser.close();diff --git a/scripts/rh-play-e2e-demo.mjs b/scripts/rh-play-e2e-demo.mjsnew file mode 100644index 000000000..2591aeabd--- /dev/null+++ b/scripts/rh-play-e2e-demo.mjs@@ -0,0 +1,58 @@+// One-off evidence script for prompts/robinhood-chain/13-threews-play.md.+// Drives a real headless Chromium against the local server/index.mjs (built+// dist/ + real api/** handlers, no mocks) to verify the Robinhood Chain /play+// integration end to end: the /worlds lobby renders the Robinhood Chain tab,+// and /temporary?coin=<real RH coin address> renders the world with zero+// console errors.++import { chromium } from 'playwright';++const BASE = process.env.BASE_URL || 'http://localhost:8080';+// Real Odyssey bonding-curve coin captured live during development.+const RH_COIN = process.argv[2] || '0x6b21b4567EfAd992B65f8a92457B45a74ed59486';++const errors = [];+const warnings = [];++async function run() {+ const browser = await chromium.launch({ headless: true });+ const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });+ page.on('console', (msg) => {+ if (msg.type() === 'error') errors.push(`[${page.url()}] ${msg.text()}`);+ if (msg.type() === 'warning') warnings.push(`[${page.url()}] ${msg.text()}`);+ });+ page.on('pageerror', (err) => errors.push(`[pageerror ${page.url()}] ${err.message}`));++ console.log('--- /worlds lobby ---');+ await page.goto(`${BASE}/worlds`, { waitUntil: 'domcontentloaded', timeout: 30000 });+ await page.waitForTimeout(1500);+ const tabsVisible = await page.locator('#wl-tabs').isVisible().catch(() => false);+ const rhTabText = await page.locator('.wl-tab[data-chain="robinhood-chain"]').textContent().catch(() => null);+ console.log('tabs visible:', tabsVisible, '| RH tab label:', rhTabText);+ await page.locator('.wl-tab[data-chain="robinhood-chain"]').click().catch(() => {});+ await page.waitForTimeout(800);+ const worldsCount = await page.locator('#wl-worlds-count').textContent().catch(() => '');+ console.log('Robinhood tab world count text:', worldsCount);+ await page.screenshot({ path: '/tmp/claude-1000/-workspaces-three-ws/bbd67923-b6d3-4593-92c8-9acb04d85900/scratchpad/rh-worlds-lobby.png' });++ console.log('--- /temporary?coin=' + RH_COIN + ' (Robinhood world) ---');+ await page.goto(`${BASE}/temporary?coin=${RH_COIN}&name=E2ETester`, { waitUntil: 'domcontentloaded', timeout: 45000 });+ await page.waitForTimeout(6000); // let the scene boot + first trade poll land+ await page.screenshot({ path: '/tmp/claude-1000/-workspaces-three-ws/bbd67923-b6d3-4593-92c8-9acb04d85900/scratchpad/rh-world.png' });++ // Confirm the biome actually resolved to 'hoodchain' by checking the fog+ // color three.js applied to the scene (proves createWorldEnvironment ran+ // with our biome, not a generic fallback) — read it straight off the+ // window's exposed three.js scene if the app exposes one, else skip.+ const canvasPresent = await page.locator('canvas').first().isVisible().catch(() => false);+ console.log('world canvas visible:', canvasPresent);++ await browser.close();++ console.log('\n=== console errors:', errors.length, '===');+ for (const e of errors.slice(0, 30)) console.log(e);+ console.log('\n=== console warnings:', warnings.length, '(showing first 10) ===');+ for (const w of warnings.slice(0, 10)) console.log(w);+}++run().catch((err) => { console.error('FATAL', err); process.exit(1); });diff --git a/scripts/rh-play-e2e-verbose.mjs b/scripts/rh-play-e2e-verbose.mjsnew file mode 100644index 000000000..681b2ff8b--- /dev/null+++ b/scripts/rh-play-e2e-verbose.mjs@@ -0,0 +1,11 @@+import { chromium } from 'playwright';+const BASE = 'http://localhost:8080';+const RH_COIN = '0x6b21b4567EfAd992B65f8a92457B45a74ed59486';+const browser = await chromium.launch({ headless: true });+const page = await browser.newPage();+page.on('response', (res) => {+ if (res.status() >= 400) console.log(res.status(), res.url());+});+await page.goto(`${BASE}/temporary?coin=${RH_COIN}&name=E2ETester`, { waitUntil: 'domcontentloaded', timeout: 45000 });+await page.waitForTimeout(6000);+await browser.close();diff --git a/src/robinhood-coin.js b/src/robinhood-coin.jsnew file mode 100644index 000000000..ec553f6c0--- /dev/null+++ b/src/robinhood-coin.js@@ -0,0 +1,195 @@+// /markets/robinhood/coin/:address — Robinhood Chain memecoin detail page.+//+// DexScreener market data (price, mcap, FDV, liquidity, volume, pools) ++// Blockscout holders/transfers/contract links, and the real buy panel+// (wallet connect, chain-switch to 4663, live Uniswap v3 quote + swap).+// Non-security token — no eligibility gate.++import { formatUsd, formatPercent, escapeHtml as esc } from './shared/coin-format.js';+import { mountBuyPanel } from './robinhood-purchase.js';++const $ = (id) => document.getElementById(id);+const ADDR_RE = /^\/markets\/robinhood\/coin\/(0x[0-9a-fA-F]{40})\/?$/;++function addressFromPath() {+ const m = location.pathname.match(ADDR_RE);+ return m ? m[1] : 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 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-stats').innerHTML = '<div class="cv-stats-grid">' + Array.from({ length: 6 }, () => '<div class="cv-skel" style="height:5rem"></div>').join('') + '</div>';+ $('rh-buy-rail').innerHTML = '<div class="rh-buy-panel"><div class="cv-skel" style="height:200px"></div></div>';+}++function renderHead(c) {+ const symbol = c.symbol || 'Unknown';+ document.getElementById('rh-doc-title').textContent = `${symbol} — Robinhood Chain coin · three.ws`;+ document.getElementById('rh-doc-desc').setAttribute('content', `Live price, liquidity, holders, and a real buy flow for ${c.name || symbol} on Robinhood Chain.`);+ document.getElementById('rh-crumb-symbol').textContent = symbol;++ const pct = c.market?.priceChange?.h24;+ $('rh-head').innerHTML = `+ <div class="ch-hero">+ <div class="ch-title-row">+ ${c.iconUrl ? `<img src="${esc(c.iconUrl)}" alt="" width="48" height="48" style="border-radius:50%" data-no-dark-filter />` : ''}+ <h1 class="ch-title">${esc(c.name || symbol)}</h1>+ <span class="cv-rank-badge">${esc(symbol)}</span>+ </div>+ <div class="cv-price-row" style="margin-top:0.75rem">+ <span class="cv-price cv-mono">${esc(formatUsd(c.market?.priceUsd))}</span>+ ${pct != null ? `<span class="cv-chip ${pct >= 0 ? 'up' : 'down'}"><span class="win">24h</span>${esc(formatPercent(pct))}</span>` : ''}+ </div>+ </div>`;+}++function renderStats(c) {+ $('rh-stats').innerHTML = `+ <div class="cv-stats-grid">+ <div class="cv-mini-stat"><div class="label">Market Cap</div><div class="value">${esc(formatUsd(c.market?.marketCapUsd))}</div></div>+ <div class="cv-mini-stat"><div class="label">FDV</div><div class="value">${esc(formatUsd(c.market?.fdvUsd))}</div></div>+ <div class="cv-mini-stat"><div class="label">Liquidity</div><div class="value">${esc(formatUsd(c.market?.liquidityUsd))}</div></div>+ <div class="cv-mini-stat"><div class="label">24h Volume</div><div class="value">${esc(formatUsd(c.market?.volume24hUsd))}</div></div>+ <div class="cv-mini-stat"><div class="label">Holders</div><div class="value cv-mono">${c.holdersCount != null ? c.holdersCount.toLocaleString('en-US') : '—'}</div></div>+ <div class="cv-mini-stat"><div class="label">24h Txns</div><div class="value cv-mono">${c.market?.txns24h ? `${(c.market.txns24h.buys || 0) + (c.market.txns24h.sells || 0)}` : '—'}</div></div>+ </div>`;+}++function renderPools(c) {+ const el = $('rh-pools');+ const pools = c.pools || [];+ if (!pools.length) {+ el.innerHTML = '<h2 class="cv-h2">Pools</h2><div class="cv-empty"><p>No live pool found for this token yet.</p></div>';+ return;+ }+ el.innerHTML = `+ <h2 class="cv-h2">Pools</h2>+ <div class="cv-table-wrap">+ <table class="cv-table">+ <thead><tr><th class="left">DEX</th><th class="left">Pair</th><th>Price</th><th class="hide-md">Liquidity</th><th class="hide-lg">24h Vol</th></tr></thead>+ <tbody>${pools+ .map(+ (p) => `+ <tr>+ <td class="left">${esc(p.dexId)}</td>+ <td class="left cv-mono">${esc(p.quoteSymbol || '')}</td>+ <td class="cv-mono">${esc(formatUsd(p.priceUsd))}</td>+ <td class="hide-md">${esc(formatUsd(p.liquidityUsd))}</td>+ <td class="hide-lg">${esc(formatUsd(p.volume24hUsd))}</td>+ </tr>`,+ )+ .join('')}</tbody>+ </table>+ </div>`;+}++function renderHolders(c) {+ const el = $('rh-holders');+ const holders = c.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(c) {+ const el = $('rh-transfers');+ const transfers = c.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(c) {+ $('rh-links').innerHTML = `+ <h2 class="cv-h2">Links</h2>+ <div class="cv-pills">+ <a class="cv-pill" href="${esc(c.links.explorer)}" target="_blank" rel="noopener noreferrer">Contract ↗</a>+ ${c.links.dex ? `<a class="cv-pill" href="${esc(c.links.dex)}" target="_blank" rel="noopener noreferrer">DEX Pool ↗</a>` : ''}+ </div>`;+}++function renderNotFound(address) {+ document.getElementById('rh-main').removeAttribute('aria-busy');+ $('rh-head').innerHTML = `<div class="cv-empty"><p>No market or token record found for ${esc(address)}.</p><a class="cv-load-more" href="/markets/robinhood">Back to Robinhood Chain →</a></div>`;+ ['rh-pools', '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 coin.')}</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 address = addressFromPath();+ if (!address) return;+ renderSkeletons();+ let c;+ try {+ c = await getJson(`/api/v1/robinhood/coins-detail?address=${encodeURIComponent(address)}`);+ } catch (err) {+ if (err.status === 404) renderNotFound(address);+ else renderError(err.message);+ return;+ }+ document.getElementById('rh-main').removeAttribute('aria-busy');+ renderHead(c);+ renderPools(c);+ renderStats(c);+ renderHolders(c);+ renderTransfers(c);+ renderLinks(c);+ mountBuyPanel($('rh-buy-rail'), { address, symbol: c.symbol, decimals: c.decimals ?? 18 });+}++main();