
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
TypeScript SDK for Robinhood Chain (chain ID 4663): Stock Tokens, Chainlink quotes, multiplier-correct portfolios, Uniswap v3 swaps, USDG, launchpad watchers, and the sequencer firehose.
The TypeScript SDK for Robinhood Chain (chain ID 4663).
Typed, tree-shakeable, viem-native. Stock Tokens with multiplier-correct math, Chainlink quotes with staleness guards, Uniswap v3 swaps, USDG, launchpad watchers for NOXA & The Odyssey, and the raw sequencer firehose.
Stock beacon, shipped as checked-in data you can regenerate and re-verify
with one command.latestRoundData() at generation time.balanceOfUI() in the live test suite.viem is a peer; ws is an optional peer (Node ≤ 21
firehose only).Docs: https://nirholas.github.io/robinhood-chain-sdk/ · API reference: /api on the docs site
npm install hoodchain viem
Node ≥ 20. Until the package is on npm, install from a checkout: npm i ../robinhood-chain-sdk.
import { createHoodClient, getQuote, getPortfolio } from 'hoodchain'
const hood = createHoodClient() // mainnet 4663, public RPC, multicall batching on
// Chainlink quote — the answer is the multiplier-adjusted price of one TOKEN
const aapl = await getQuote(hood, 'AAPL')
console.log(`AAPL: $${aapl.priceUsd}`)
// Multiplier-correct portfolio for any address
const portfolio = await getPortfolio(hood, '0xYourAddress')
console.log(`total: $${portfolio.totalUsd.toFixed(2)}`)
for (const p of portfolio.positions) {
console.log(`${p.symbol}: ${p.balanceTokens} tokens = ${p.shareEquivalent} shares → $${p.valueUsd}`)
}
Stock Tokens implement ERC-8056: uiMultiplier() is the 1e18-scaled shares-per-token
ratio, and it rises with splits and reinvested dividends instead of rebasing balances.
balance × feed price — nothing else. Robinhood's Chainlink feeds
already return the multiplier-adjusted token price. Multiplying by the multiplier again
double-counts every corporate action.balance × uiMultiplier ÷ 1e18. hoodchain computes both numbers per position, and its
live tests assert the share math equals the token contract's own balanceOfUI().| Module | What you get |
|---|---|
client | createHoodClient({ chain, rpcUrl?, transport?, account? }) over viem's official robinhood/robinhoodTestnet chain defs |
stocks | getQuote (staleness-guarded), getMultiplier, getPosition, getPortfolio |
| registry | listStockTokens, getStockToken('TSLA'), getRegistry() — 95 verified entries, JSON also exported at hoodchain/registry/stock-tokens.json |
swap | quoteSwap (all fee tiers + two-hop via WETH/USDG), buildSwapTx, executeSwap, ensureApproval |
usdg | parseUsdg/formatUsdg (6 decimals), balances, transfers, approvals |
launchpads | getRecentLaunches, watchLaunches, watchCurveTrades, watchGraduations for NOXA + The Odyssey |
feed | subscribeFeed — the sequencer firehose, transactions decoded pre-RPC; watchTransfers for simple confirmed events |
errors | typed hierarchy under HoodchainError (StaleFeedError, NoRouteError, …) |
import { parseEther } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { createHoodClient, executeSwap, TESTNET_ADDRESSES, TESTNET_STOCK_TOKENS } from 'hoodchain'
const hood = createHoodClient({
chain: 'testnet',
account: privateKeyToAccount(process.env.ROBINHOOD_CHAIN_PRIVATE_KEY as `0x${string}`),
})
const { hash, receipt, quote } = await executeSwap(hood, {
tokenIn: TESTNET_ADDRESSES.weth,
tokenOut: TESTNET_STOCK_TOKENS.NFLX,
amountIn: parseEther('0.0001'),
}) // quotes → approves if needed → sends → waits for the receipt
Routing probes every v3 fee tier directly plus two-hop routes through WETH and USDG and
takes the best output. Zero-liquidity pools (common for Stock Token pairs) are skipped;
if nothing fills you get a typed NoRouteError.
Stock Token eligibility. 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). The restriction is legal/front-end, not contract-level. Reads and sells are never gated, but any swap that acquires a canonical Stock Token throws
StockTokenEligibilityErroruntil the operator passesacknowledgeStockTokenEligibility: truetocreateHoodClient, affirming eligibility.
import { createHoodClient, watchLaunches } from 'hoodchain'
const hood = createHoodClient()
const unwatch = watchLaunches(hood, (launch) => {
// NOXA launches list instantly with a pool; Odyssey launches start on a bonding curve
console.log(`[${launch.launchpad}] ${launch.token} by ${launch.creator}`)
})
import { subscribeFeed } from 'hoodchain'
const sub = await subscribeFeed((msg) => {
for (const tx of msg.transactions) console.log(tx.hash, tx.transaction.to)
}) // every sequenced tx, ~100–300ms before it's queryable over RPC
sub.close()
Uses the global WebSocket on Node ≥ 22 and browsers; on Node 20/21 install the optional
ws peer.
src/registry/stock-tokens.json is generated and checked in. Regenerate + re-verify:
npm run refresh-registry
The pipeline discovers canonical <Name> • Robinhood Token entries on Blockscout,
verifies on-chain that every token's EIP-1967 beacon slot points at the one shared
Stock beacon, reads back symbol/name/decimals/multiplier via multicall, maps Chainlink's
official feed directory by ticker, verifies every feed answers with a positive 8-decimal
price, and refuses to write on any mismatch. Provenance (block number, counts, sources)
is embedded in the JSON.
Five runnable scripts in examples/ — quotes, portfolio, a real testnet
swap, launchpad watching, and the firehose. npm run build first (they import the built
package by name), then e.g. npx tsx examples/quote.ts.
npm test # unit: registry integrity, quote/multiplier math, calldata, feed decoding
npm run test:live # integration: real mainnet reads + (env-gated) real testnet swap
test:live hits the public RPC: Chainlink quotes for every priced token, USDG supply,
QuoterV2 quotes both directions, launchpad log scans, 30s of live firehose, and the
balanceOfUI() cross-check. The testnet swap E2E runs when ROBINHOOD_CHAIN_PRIVATE_KEY
holds a funded testnet key — fund one at
faucet.testnet.chain.robinhood.com
(browser-only: Cloudflare Turnstile + Google Sign-In; drips 0.01 ETH + five of each test
Stock Token per 24 h).
Wallet keys live in env vars only. Never commit .env (already gitignored).
The static site in docs/ works by opening docs/index.html locally — the
landing page reads live Stock Token prices from the public RPC in your browser. One-time
Pages setup: Settings → Pages → Deploy from a branch → main → /docs. Regenerate
the API reference with npm run docs:api.
npm run build && npm test
npm publish --access public
Apache-2.0 © 2026 nirholas
FAQs
TypeScript SDK for Robinhood Chain (chain ID 4663): Stock Tokens, Chainlink quotes, multiplier-correct portfolios, Uniswap v3 swaps, USDG, launchpad watchers, and the sequencer firehose.
The npm package hoodchain receives a total of 68 weekly downloads. As such, hoodchain popularity was classified as not popular.
We found that hoodchain demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.