MegaETH Mainnet
- Type
- mainnet
- Protocol
- ethereum
- Identifier
- megaeth
- Chain ID
- eip155:4326
- Native Currency
- ETH
Indexing Data on MegaETH
MegaETH is a high-performance, EVM-compatible Ethereum Layer 2 built for real-time applications with very high throughput and low latency. The Graph can stream that onchain activity — DEX swaps, pools, and liquidity; lending and borrowing positions; token transfers and holder balances; and contract events — as real-time data with Substreams.
MegaETH is supported by The Graph with Substreams — a parallelized, real-time streaming engine for high-throughput use cases — via Pinax Network.
Indexing MegaETH with Substreams
Substreams is a parallelized, real-time streaming engine for extracting and transforming blockchain data. Where a Subgraph indexes into a hosted GraphQL API, Substreams lets you consume high-throughput data directly or via 10+ supported sinks. MegaETH is served with the base EVM block model, so Substreams modules have access to block, transaction, and event (log) data. Modules are written in Rust and composed into reusable packages.
Find an Existing Module on Substreams.dev
Before writing any code, check the Substreams Registry for a package that already does what you need. The registry hosts community- and team-built modules covering common onchain data that you can run as-is or compose into your own pipeline. Search for the protocol or data you want on MegaETH; if a module fits, you can consume its output directly or import it as a dependency in your own project.
Develop Your Own Substreams Module
If no existing module fits, you can build one. The Substreams Quick Start is the full walkthrough. In short:
- Install the Substreams CLI and get an API key from [Pinax Network](https://app.pinax.network/).
- Scaffold a project with
substreams initand choose the EVM path, pointing it at your MegaETH contract. - Write your extraction and transformation logic in Rust, then run
substreams build. - Stream the output with
substreams gui(orsubstreams run) to iterate, then publish your package to the Substreams Registry to reuse or share it.