A comprehensive dual-process indexing system for Chainlink data feeds and price aggregators across multiple chains.
βββββββββββββββββββββββ βββββββββββββββββββββββββββ
β Flags Indexer β β Aggregators Indexer β
β (Port 42069) β β (Port 42070) β
β β β β
β - Index flags only β β - Index flags + aggs β
β - Discover aggs β β - Complete dataset β
β - Lightweight β β - Updated dynamically β
βββββββββββββββββββββββ βββββββββββββββββββββββββββ
β β²
β Discovers new aggregators β
βββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β Supervisor β
β β
β - Polls flags DB β
β - Updates agg configβ
β - Manages processes β
βββββββββββββββββββββββ
This monorepo contains three main applications:
Lightweight indexer that processes only Chainlink flag events to discover aggregators.
Key Features:
- Flags-only indexing - Processes FlagRaised/FlagLowered events
- Aggregator discovery - Finds aggregator addresses from flag events
- Lightweight & fast - Minimal resource usage for quick discovery
- Always running - Provides continuous discovery of new aggregators
Full-featured indexer that processes both flag events and aggregator price events.
Key Features:
- Complete dataset - Indexes both flags and aggregator events
- Price tracking - Tracks AnswerUpdated and NewRound events
- Dynamic config - Aggregator addresses added dynamically by supervisor
- Price quote API - REST endpoints with BFS pathfinding for cross-token pricing
Orchestrates both indexers and manages the discovery process.
Key Features:
- Process management - Starts, stops, and monitors both indexers
- Discovery polling - Polls flags database for new aggregators
- Config updates - Updates aggregator indexer config dynamically
- Health monitoring - Automatic restart and fault tolerance
A TypeScript SDK that provides a clean, type-safe interface for consuming the price API.
Key Features:
- Type-safe - Full TypeScript support with comprehensive types
- Modern API - Promise-based with async/await support
- Batch operations - Fetch multiple quotes in parallel
- Error handling - Specific error classes for different failure scenarios
# Install dependencies
pnpm install
# Set up environment files
cp apps/chainlink-flags-indexer/.envrc.template apps/chainlink-flags-indexer/.envrc
cp apps/chainlink-aggregators-indexer/.envrc.template apps/chainlink-aggregators-indexer/.envrc
cp apps/chainlink-supervisor/.envrc.template apps/chainlink-supervisor/.envrc
# Edit .envrc files with your database URL and DRPC API key
# Start the supervisor (manages everything)
cd apps/chainlink-supervisor
pnpm start# Terminal 1: Flags indexer
cd apps/chainlink-flags-indexer && pnpm dev
# Terminal 2: Aggregators indexer
cd apps/chainlink-aggregators-indexer && pnpm dev
# Terminal 3: Supervisor
cd apps/chainlink-supervisor && pnpm devAPIs will be available at:
- Flags Indexer:
http://localhost:42069 - Aggregators Indexer:
http://localhost:42070
cd pkg/sdk
pnpm install
pnpm buildimport { ChainlinkRegistryClient } from '@chainlink-registry/sdk';
const client = new ChainlinkRegistryClient({
baseUrl: 'http://localhost:42070' // Use aggregators indexer for price data
});
// Get a price quote
const quote = await client.getPriceQuote(8453, 'ETH', 'USD');
console.log(`1 ETH = ${quote.formattedPrice} USD`);
// Get available tokens
const tokens = await client.getAvailableTokens(8453);
console.log(`Available tokens: ${tokens.tokens.join(', ')}`);| Chain ID | Network | Status |
|---|---|---|
| 1 | Ethereum | β Active |
| 10 | Optimism | β Active |
| 100 | Gnosis | β Active |
| 130 | Unichain | β Active |
| 137 | Polygon | β Active |
| 146 | Sonic | β Active |
| 324 | zkSync Era | β Active |
| 1868 | Soneium | β Active |
| 5000 | Mantle | β Active |
| 8453 | Base | β Active |
| 42161 | Arbitrum One | β Active |
| 42220 | Celo | β Active |
| 43114 | Avalanche | β Active |
| 57073 | Ink | β Active |
| 59144 | Linea | β Active |
| 60808 | BOB | β Active |
| 534352 | Scroll | β Active |
curl "http://localhost:42070/price/quote/8453/ETH/USD"curl "http://localhost:42070/price/quote/1/BTC/EUR"- Node.js 18+
- pnpm
- PostgreSQL (handled by Ponder)
- DRPC API key
chainlink-registry/
βββ apps/
β βββ chainlink-flags-indexer/ # Lightweight flags-only indexer
β β βββ src/
β β β βββ index.ts # Flag event processing
β β β βββ api/ # GraphQL/SQL API
β β β βββ utils/ # Data feed utilities
β β βββ abis/ # Contract ABIs
β β βββ ponder.config.ts # Multi-chain configuration
β β βββ ponder.schema.ts # Database schema
β βββ chainlink-aggregators-indexer/ # Full aggregator indexer
β β βββ src/
β β β βββ index.ts # Flag + aggregator processing
β β β βββ api/ # Price quote API
β β β βββ utils/ # Pricing utilities
β β βββ abis/ # Contract ABIs
β β βββ ponder.config.ts # Dynamic configuration
β β βββ ponder.schema.ts # Extended database schema
β βββ chainlink-supervisor/ # Process orchestrator
β βββ src/
β β βββ index.ts # Main supervisor logic
β β βββ process-manager.ts # Process lifecycle management
β β βββ aggregator-discovery.ts # Discovery logic
β β βββ config-generator.ts # Dynamic config updates
β βββ types.ts # TypeScript definitions
βββ pkg/
β βββ sdk/ # TypeScript SDK
β βββ src/
β β βββ client.ts # Main client class
β β βββ types.ts # TypeScript definitions
β β βββ utils.ts # Helper functions
β βββ examples/ # Usage examples
βββ package.json # Workspace configuration
MIT
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Ponder Documentation
- Chainlink Price Feeds
- DRPC - Multi-chain RPC provider