indexing

Index historical on-chain events into queryable GraphQL subgraphs.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/mashharuki/flare-sample --skill indexing-mashharuki
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: indexing
Source: https://github.com/mashharuki/flare-sample/tree/main/.claude/skills/eth-indexing
Command: npx skills add https://github.com/mashharuki/flare-sample --skill indexing-mashharuki

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reading historical on-chain state and events via raw RPC calls or block-by-block scans is slow, expensive, and often impractical; this Skill explains how to use indexers and event-first contract design to make historical data queryable and reliable.

Core Features & Use Cases

  • Event-first contract design: Recommend emitting structured, indexed events so offchain indexers can reconstruct state without expensive archival reads.
  • The Graph / subgraphs: Guidance on defining schemas, writing mapping handlers, and deploying subgraphs to serve fast GraphQL queries for activity feeds, NFT browsers, and DeFi dashboards.
  • Alternative indexers & provider APIs: When to choose Dune, Alchemy/QuickNode, Etherscan, Ponder, or custom indexers and the tradeoffs for analytics versus production backends.
  • Realtime & current state patterns: Use multicall for batched reads and WebSocket subscriptions for live updates while reserving indexers for historical queries.

Quick Start

Create a subgraph that indexes Transfer and custom events from your contract, deploy it to The Graph or a chosen indexing provider, and query recent activity via the generated GraphQL API.

Frequently Asked Questions about indexing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query historical on-chain events without scanning blocks via raw RPC?

Index historical on-chain events using subgraphs and event-first contract design to avoid expensive archival reads, enabling fast GraphQL queries for contract activity without block-by-block scans.

What is the best way to build an NFT explorer or DeFi dashboard with historical Ethereum data?

Deploy a subgraph to The Graph to index custom and Transfer events, defining schemas and mapping handlers that serve fast GraphQL queries for NFT explorers and DeFi dashboards.

How do I structure smart contract events for efficient offchain indexing?

Emit structured, indexed events using event-first contract design so offchain indexers can reliably reconstruct historical state without performing expensive archival reads.

When should I use The Graph subgraphs versus Dune SQL or provider APIs for on-chain analytics?

Choose The Graph subgraphs for production backends requiring fast GraphQL queries, Dune SQL for analytics, and provider APIs or custom indexers based on specific tradeoffs between analytics and production needs.

Can I use multicall and WebSocket subscriptions for real-time on-chain data instead of indexers?

Use multicall for batched current state reads and WebSocket subscriptions for real-time updates, reserving subgraph indexers specifically for fast historical on-chain queries.