Base Blockchain Uniswap Indexer
Real-Time EVM Liquidity & Contract Event Pipeline
High-frequency data indexer capturing Uniswap V2 and V3 smart contract events on the Base blockchain (Chain ID 8453). Built with WebSocket subscriptions, automated cron task schedulers, BullMQ worker consumers, and GraphQL subgraph querying via Alchemy and Mobula.
Technologies & Tools Employed
ENGINEERING STATUS: VERIFIED & SHIPPED
Base Blockchain Uniswap Indexer
Base Blockchain Uniswap Indexer is a resilient, high-frequency EVM event indexing pipeline engineered to capture, decode, and store Uniswap V2 and V3 smart contract events on Coinbase’s Base blockchain (Chain ID 8453) in real-time.
1. Overview & Data Pipeline
DeFi analytics, liquidity tracking, and arbitrage monitoring demand ultra-low-latency event ingestion without missing blocks during chain reorgs or rate limits. This indexer captures log emissions (Swap, Mint, Burn, Sync, Collect) across Uniswap liquidity pools on Base, processing thousands of transactions per minute into structured relational and analytical models.
[Base Network RPC (Chain ID 8453)]
│
(WebSocket Log Subscription & HTTP)
▼
[Log Ingestion & Reorg Monitor]
│
▼
[BullMQ Redis Worker Queue]
├── Job: Decode ABI Event Logs
├── Job: Fetch Block Timestamps & Tx Receipts
└── Job: Query Mobula / Alchemy GraphQL for Pool Metadata
│
▼
[Normalization & Pipeline Workers]
│
┌────────────────┴────────────────┐
▼ ▼
[PostgreSQL Storage] [GraphQL Subgraph / API]
- Pool states & Reserves - Real-Time Query Layer
- Normalized Swaps & Volumes - Analytics Endpoints
2. Architecture & Core Mechanisms
Real-Time Ingestion with Fallbacks
- Subscribes to live EVM logs via persistent WebSockets from Base RPC providers.
- Scheduled cron reconcilers audit block ranges every 60 seconds to detect missing blocks, dropped sockets, or reorg depths.
Distributed BullMQ Queue Workers
- Heavy operations (ABI decoding, ERC-20 token decimals resolution, pool reserve calculations) are offloaded to Redis-backed BullMQ worker pools.
- Built-in exponential backoff retry mechanisms isolate rate limits without pausing real-time event intake.
Dual-Protocol Uniswap V2 & V3 Support
- Uniswap V2: Parses constant product formula events (
Sync,Swap) and tracks reserve changes directly. - Uniswap V3: Decodes concentrated liquidity math, tracking tick ranges, liquidity indices, and fee tier distributions.
Hybrid Graph & RPC Querying
- Combines raw RPC JSON-RPC queries with Mobula and Alchemy GraphQL APIs to enrich transactions with token metadata, USD exchange rates, and wallet labels.
3. Technology Stack
- Runtime & Language: Node.js, TypeScript (Strict Mode)
- Blockchain Tooling: Ethers.js / Viem, EVM ABI Decoders, Base RPC (Alchemy & QuickNode)
- Queue & Concurrency: BullMQ, Redis Cluster
- Databases: PostgreSQL (Prisma / Drizzle ORM)
- Containerization: Docker Compose multi-container deployment with healthcheck probes
4. Key Engineering Achievements
- Handled peak throughput of 500+ decoded swap events per second without memory leaks or Redis queue backlog build-up.
- Designed reorg detection logic that rewinds and re-indexes blocks when fork depths of up to 12 blocks occur on Base.
- Containerized the entire pipeline into isolated ingestor, worker, and API services for seamless cloud deployment.
