hoodkit

The power-user toolkit for Robinhood Chain (chain ID 4663) — built on top of hoodchain.
hoodchain gives you typed reads and writes. hoodkit gives you what a production trading
bot, a live dashboard, or an on-chain analytics service actually needs on top of that:
- Real-time streams with reconnect gap-fill — Chainlink price ticks, Uniswap v3 swaps,
NOXA/Odyssey launches, and wallet portfolio changes, all as a backpressure-safe
Stream<T>
that survives a dropped RPC connection without silently losing an event.
- Read-through caching with request coalescing — collapse N concurrent identical reads
into one upstream call, cached per-datatype TTL.
- Multicall batching —
plan() for one-shot bulk reads, createBatcher() for a
DataLoader-style batcher that coalesces reads from unrelated code paths automatically.
- A local SQLite indexer — holders, OHLCV candles, and rolling 24h volume, computed from
indexed
Transfer/Swap events with zero RPC at query time.
- Agent strategy primitives — weighted-average-cost PnL tracking, price-cross triggers, a
dry-run-by-default TWAP executor, and hard spend caps.
- SSR-safe React hooks —
hoodkit/react wraps the streaming and read layers in hooks that
render inert on the server and hydrate on the client.
Who it's for: anyone building a bot, dashboard, indexer, or agent against Robinhood Chain who
doesn't want to hand-roll reconnect logic, cache invalidation, or multicall batching on top of
the base SDK.
Install
npm install hoodkit hoodchain viem
pnpm add hoodkit hoodchain viem
hoodchain and viem are required peer dependencies — hoodkit never bundles them, so your
app controls the exact versions. Two more peers are optional and only needed if you use the
feature that requires them:
| Peer | Required for | Optional? |
|---|
hoodchain ^0.1.0 | every module — HoodClient is the shared entry point | required |
viem ^2.55.0 | every module | required |
react >=18 <20 | hoodkit/react hooks only | optional |
better-sqlite3 >=11 <14 | Indexer/createIndexer only | optional |
ws ^8.18.0 | kept external for environments that need it alongside hoodchain | optional |
Node ≥ 20. If a peer is missing at runtime for the feature you're using, hoodkit throws a
clear error telling you which package to install (see createIndexer for an
example) rather than failing silently.
Quickstart
import { createHoodClient } from 'hoodchain'
import { streamPrices, createHoodCache, plan } from 'hoodkit'
const hood = createHoodClient() // mainnet 4663, public RPC, multicall batching on
// Live Chainlink prices — emits only when a feed's round actually advances
const prices = streamPrices(hood, ['AAPL', 'TSLA', 'NVDA'])
for await (const tick of prices) {
console.log(`${tick.symbol}: $${tick.priceUsd} (round #${tick.roundId})`)
break // for await naturally supports `break` to stop consuming
}
// Read-through cache — 100 concurrent calls collapse into ~1 RPC round-trip
const cache = createHoodCache(hood)
await Promise.all(Array.from({ length: 100 }, () => cache.getQuote('AAPL')))
console.log(cache.stats) // { hits, misses, coalesced }
// Batch many independent multicall reads
import { erc20Abi, listStockTokens } from 'hoodchain'
const results = await plan(
hood,
listStockTokens().map((t) => ({ address: t.address, abi: erc20Abi, functionName: 'totalSupply' })),
)
Four more runnable, end-to-end scripts plus a full React dashboard live in
examples/ — see Examples below.
API reference
hoodkit has two entry points: the default export (hoodkit) with everything below except the
React hooks, and hoodkit/react for the hook layer. Every export below is a real, verified
export from src/index.ts and src/react/index.ts —
nothing here is aspirational.
Stream