A production-grade monorepo for building real-time, interactive 3D visualizations of on-chain activity. Ships as reusable npm packages, a design system, and a full reference application.
Live demo: The
/worldroute connects to live Solana PumpFun data with zero configuration.
visualize-web3-realtime/
├── packages/
│ ├── core/ # Pure TS — types, engine, categories, plugins, themes
│ ├── providers/ # Data providers (PumpFun, Ethereum, CEX, Agent, Mock, Custom)
│ ├── react-graph/ # React Three Fiber force-directed 3D graph component
│ ├── ui/ # Design system — tokens, theme, primitives, composed components
│ ├── utils/ # Shared utilities (screenshot, share URL, formatters)
│ ├── mcp/ # MCP server (DeFi Llama, cookie.fun, proof registry)
│ ├── executor/ # Agent execution server (WebSocket + REST, Claude SDK)
│ ├── engine/ # Framework-agnostic force simulation engine
│ ├── react/ # React wrapper for swarming engine
│ ├── vue/ # Vue 3 wrapper
│ ├── svelte/ # Svelte wrapper
│ ├── react-native/ # React Native + Expo wrapper
│ ├── swarming/ # CDN/UMD bundle
│ ├── swarming-physics/ # Rust/WASM Barnes-Hut simulation (3-5x faster)
│ ├── swarming-collab-server/ # WebSocket relay for multiplayer
│ ├── agent-bridge/ # CLI for connecting external AI agents
│ ├── create-swarming-app/ # Project scaffolder CLI
│ ├── create-swarming-plugin/ # Plugin scaffolder CLI
│ ├── tsconfig/ # Shared TypeScript configs
│ └── tailwind-config/ # Shared Tailwind CSS config
├── apps/
│ ├── playground/ # Standalone Next.js demo app
│ └── mobile-demo/ # Expo React Native demo
├── app/ # Main Next.js 14 app (live data)
├── features/ # Feature modules (World, Agents, Scrollytelling, Landing, Demos, Tools)
├── hooks/ # Custom React hooks (useAgentEvents, useAgentProvider)
└── turbo.json # Turborepo pipeline config
Pure TypeScript foundation — zero React dependencies.
- Types:
Token,Trade,Claim,TopToken,TraderEdge,GraphNode,GraphEdge,ShareColors,GraphHandle,Vec3,DataProviderEvent,MergedStats - Agent Types:
AgentIdentity,AgentTask,AgentToolCall,AgentEvent,AgentFlowTrace,ExecutorState - Engine:
ForceGraphSimulation(configurable d3-force-3d manager),SpatialHash(O(1) 3D neighbor lookups) - Categories: 34 built-in categories across 6 sources. Extensible via
CategoryConfig. - Plugins:
PluginManagerwith source, theme, and renderer plugin types. Built-in: ethereum, solana, mock, websocket. - Themes:
darkTheme,lightThemepresets with chain/protocol color mappings. - Providers:
DataProviderinterface, registry (registerProvider,getProvider), factory (createProvider)
import { ForceGraphSimulation, CATEGORIES, type Token } from '@web3viz/core';Data provider implementations and aggregation hooks.
PumpFunProvider— Solana token launches, trades, bonding curves, whale/sniper detection, claimsEthereumProvider— Uniswap V2/V3 swaps, ERC-20 transfers, mints via RPC WebSocketCexVolumeProvider— Binance spot trades (10 pairs, >$50K filter) and liquidationsAgentProvider— Meta-provider detecting AI agent activity + cookie.fun API pollingMockProvider— Generates synthetic events for development/testingCustomStreamProvider— User-defined WebSocket, REST, SSE, or callback streamsuseProviders()— React hook aggregating events from all active providers- Shared:
WebSocketManager(exponential backoff, heartbeat),BoundedMap/BoundedSet(LRU caches),validate.ts(runtime validators)
import { useProviders, PumpFunProvider, MockProvider } from '@web3viz/providers';React Three Fiber 3D force-directed graph component.
- Instanced rendering (InstancedMesh) for thousands of nodes at 60fps
- Configurable hub layout, spring physics, mouse repulsion
- Imperative
GraphHandleAPI (focusHub,animateCameraTo,takeSnapshot,setOrbitEnabled,getCanvasElement) PostProcessingcomponent (bloom, depth-of-field)SwarmingProvidercontext for plugin system- WebGPU support with auto-detection fallback to WebGL
- Full TypeScript props API
import { ForceGraph, SwarmingProvider } from '@web3viz/react-graph';Full design system with dark/light theming.
- Tokens: Colors (CSS custom properties), typography (IBM Plex Mono), spacing scale, shadows, z-index, transitions, agent-specific colors
- Theme:
ThemeProvider,useTheme(),createTheme(),lightTheme/darkThemepresets - Primitives:
Button,Pill,StatPill,Badge,StatusDot,TextInput,HexInput,Dialog,Panel,ColorControl,SwatchPicker - Composed:
FilterSidebar,StatsBar,LiveFeed,SharePanel,ShareOverlay,InfoPopover,JourneyOverlay,StartJourneyButton,ConnectionIndicator,WorldHeader
import { ThemeProvider, Button, LiveFeed, StatsBar } from '@web3viz/ui';Shared utility functions.
captureWebGLSnapshot()/downloadWebGLSnapshot()— WebGL canvas capturesnapshotToBlob()— Canvas to Blob conversionbuildShareUrl()/parseShareParams()— Share URL encodingbuildShareText()— Generate share text (title + stats)shareOnX()/shareOnLinkedIn()— Social sharing intentsformatNumber()/formatSol()/truncateAddress()— Display formattingdebounce()/clamp()/lerp()— Math/timing helpersdownloadBlob()/timestampedFilename()— File download helpers
import { captureWebGLSnapshot, formatSol, truncateAddress } from '@web3viz/utils';Model Context Protocol server for AI agents.
- Resources:
protocol_stats(DeFi Llama TVL),recent_trades(live trade feed),agent_activity(cookie.fun rankings),proof_status(LuminAIR STARK proofs) - API:
fetchResource(name, params?),listResources(),registerRecentEventsSource(),addProofResult() - Protocols tracked: Aave, Uniswap, Compound, MakerDAO, Lido
import { fetchResource, listResources } from '@web3viz/mcp';Agent execution server for autonomous DeFi tasks.
- ExecutorServer — HTTP server + WebSocket broadcaster (port 8765 default)
- AgentManager — Agent lifecycle (spawn, status transitions, task assignment)
- ClaudeAgentClient — Claude SDK wrapper with MCP tool integration
- TaskQueue — FIFO task queue with state tracking
- EventBroadcaster — WebSocket broadcast (snapshot, event, heartbeat messages)
- StateStore — SQLite persistence (better-sqlite3)
- HealthMonitor — CPU, memory, connection tracking
- Agent roles: coder, researcher, planner
- REST endpoints: /api/status, /api/agents, /api/tasks, /api/events
Note: Currently broken — missing
wsdependency.
| Package | Description |
|---|---|
@swarming/engine |
Framework-agnostic force simulation engine (vanilla JS API) |
@swarming/react |
React wrapper |
@swarming/vue |
Vue 3 wrapper |
@swarming/svelte |
Svelte wrapper |
@swarming/react-native |
React Native + Expo with GL renderer |
swarming |
CDN/UMD bundle — zero-build embed via <script> tag |
| Package | Description |
|---|---|
swarming-physics |
Rust/WASM Barnes-Hut force simulation (3-5x faster than JS) |
swarming-collab-server |
WebSocket relay for multiplayer collaboration |
agent-bridge |
CLI to connect external AI agents to visualization |
create-swarming-app |
Project scaffolder — npx create-swarming-app |
create-swarming-plugin |
Plugin project scaffolder |
npm install
npm run devOpen http://localhost:3100 — the /world visualizer with live PumpFun data.
npm test # Run all tests (vitest)
npm run test:coverage # With coverage
npm test -- --run packages/core # Specific packagenpm run build # Production build (Next.js only)
npm run typecheck # TypeScript check (root tsconfig)
npm run lint # ESLintDo NOT use
turbo run build— broken packages (executor, playground) will fail. Usenpm run build.
- Fork/clone this repo
- Delete
app/andfeatures/(the reference application) - Keep
packages/— these are your reusable building blocks - Create your own
apps/my-app/with@web3viz/*imports - Implement a custom
DataProviderfor your data source
import { createProvider } from '@web3viz/core';
const myProvider = createProvider({
id: 'my-protocol',
label: 'My Protocol',
connect: (emit) => {
const ws = new WebSocket('wss://...');
ws.onmessage = (e) => emit({ type: 'trade', data: parse(e.data) });
return () => ws.close();
},
});All colors use CSS custom properties for runtime theming:
| Token | Default (Dark) | Description |
|---|---|---|
--w3v-bg |
#0a0a0f |
Background |
--w3v-surface |
#141420 |
Card/panel surface |
--w3v-border |
#2a2a3a |
Borders |
--w3v-text |
#e2e2f0 |
Primary text |
--w3v-text-muted |
#8888aa |
Secondary text |
--w3v-accent |
#a78bfa |
Accent/brand |
Override any token via CSS or the ThemeProvider:
<ThemeProvider theme={createTheme({ background: '#ffffff', text: '#111' })}>
<App />
</ThemeProvider>| Layer | Technology |
|---|---|
| Monorepo | Turborepo + npm workspaces |
| Framework | Next.js 14 (App Router), React 18 |
| 3D | React Three Fiber + Three.js + @react-three/drei |
| Physics | d3-force-3d (CPU) + WASM Barnes-Hut (Rust) |
| Animation | Framer Motion |
| Styling | Tailwind CSS + CSS custom properties |
| Typography | IBM Plex Mono |
| AI | Claude Sonnet (@anthropic-ai/sdk) with tool-use |
| MCP | Model Context Protocol server |
| ZK Proofs | Giza LuminAIR (STARK verification) |
| Code Editor | CodeMirror 6 |
| Testing | Vitest + jsdom + React Testing Library |
| CI/CD | GitHub Actions |
| Language | TypeScript 5.5 (strict mode) |
| Data | WebSocket (PumpPortal, Ethereum RPC, Binance) + REST (cookie.fun, DeFi Llama) |
MIT