Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

Setting Up MEV Monitoring and Reporting Dashboards

A technical guide for developers to build systems that track and visualize MEV activity, including key metrics, data sources, and dashboard deployment.
Chainscore © 2026
introduction
GUIDE

Setting Up MEV Monitoring and Reporting Dashboards

A practical guide to building real-time dashboards for tracking Maximum Extractable Value (MEV) activity across Ethereum and other EVM chains.

Maximum Extractable Value (MEV) represents profits that miners, validators, or sophisticated bots can extract by reordering, including, or censoring transactions within blocks. Monitoring MEV is critical for protocol developers, DApp teams, and researchers to understand market dynamics, assess network health, and identify potential threats like sandwich attacks or time-bandit reorganizations. A well-configured dashboard provides visibility into metrics such as searcher profits, gas used by MEV bots, and the prevalence of different MEV strategies like arbitrage and liquidations.

To begin monitoring, you need access to raw blockchain data. The most common approach is to run an archive node (like Geth or Erigon) for the chain you're analyzing, which provides full historical state. For real-time event streaming, you can use the node's JSON-RPC eth_subscribe method to listen for new blocks. Alternatively, services like The Graph (for indexed data) or Etherscan/Blockscout APIs (for general queries) offer faster setup but may have rate limits. For deep MEV analysis, specialized data providers like EigenPhi or Flashbots' mev-inspect-py offer pre-processed datasets on arbitrage and sandwich trades.

Once you have a data source, the next step is processing. A simple Python script using Web3.py can extract key details from each new block. You'll want to calculate the priority fee (tip) paid by transactions, identify backrunning and frontrunning patterns by analyzing transaction ordering and gas prices, and track interactions with known MEV-related contracts like Flashbots' FlashbotsBundle or CowSwap's settlement contract. Storing this processed data in a time-series database like InfluxDB or TimescaleDB is ideal for dashboard performance and historical analysis.

For the dashboard frontend, tools like Grafana are popular for their powerful visualization and alerting capabilities. Connect Grafana to your time-series database to create panels showing: Total MEV extracted per day, Top searcher addresses by profit, MEV as a percentage of block rewards, and Gas spent on failed MEV transactions. Setting alerts for anomalous spikes in MEV activity can signal market events or ongoing attacks. For a more custom solution, you can build a React or Vue.js app that fetches data from your own API, pulling aggregated metrics from the backend database.

Beyond basic metrics, advanced monitoring involves tracking specific MEV supply chain actors. Identify searchers (bots submitting bundles), builders (block constructors), and relays (trusted intermediaries) by analyzing transaction from addresses and tx.origin patterns. Monitoring the mempool via services like BloXroute or running a geth node with --txpool.locals can provide early signals for pending sandwich attacks targeting your users' transactions. Incorporating EigenLayer restaking metrics or Flashbots Protect RPC usage can also show how ecosystem solutions are being adopted to mitigate MEV risks.

Finally, ensure your reporting is actionable. Dashboards should help answer questions like: 'Is MEV making my protocol's user transactions fail?' or 'What is the cost of MEV on my token's liquidity pools?' Regularly export reports to track trends over time. The code and configurations for these systems are often open-source; studying repositories like flashbots/mev-inspect-py or Chainstack/mev-dashboard provides a solid foundation. Continuous monitoring turns raw blockchain data into a strategic asset for risk management and product development in the DeFi space.

prerequisites
MEV DASHBOARDS

Prerequisites and System Requirements

Before building a system to monitor MEV, you need the right infrastructure and data sources. This guide outlines the essential components.

Effective MEV monitoring requires a robust data pipeline. You'll need access to a reliable Ethereum execution client (like Geth or Erigon) and a consensus client (like Lighthouse or Prysm) to track the live chain. For historical analysis, services like Google's BigQuery public dataset for Ethereum or specialized providers like Dune Analytics and Flipside Crypto are invaluable. The core technical stack typically involves a backend service (Node.js, Python) to ingest data, a database (PostgreSQL, TimescaleDB) for storage, and a frontend framework (React, Next.js) for visualization.

Key data sources include raw transaction mempools, block data, and finalized chain state. To capture pre-chain activity, you need a connection to a mempool, which can be achieved by running your own Ethereum node with specific RPC methods enabled (eth_subscribe, newPendingTransactions) or using a service like Blocknative or Bloxroute. For analyzing extracted value, you must decode transaction calldata and track internal calls, which requires the ABI (Application Binary Interface) for relevant smart contracts like DEX routers (Uniswap, 1inch) and lending protocols (Aave, Compound).

Your development environment should have Node.js (v18+) or Python (3.10+) installed. Essential libraries include ethers.js or web3.py for blockchain interaction, axios or requests for API calls, and pandas for data processing. For dashboard creation, consider using visualization libraries like Chart.js, D3.js, or Plotly. You will also need a basic understanding of SQL for querying your database and familiarity with WebSocket connections for real-time data streams from nodes or data providers.

Security and performance are critical. Ensure your node or data provider connection is stable and can handle high throughput, especially during periods of network congestion. Implement rate limiting and error handling for all external API calls. For storing sensitive data like private RPC endpoints, use environment variables. If you plan to run this system in production, consider containerization with Docker and orchestration with Kubernetes for scalability and reliability.

key-concepts-text
MONITORING

Key MEV Metrics and Data Sources

A practical guide to the essential metrics and data sources for building effective MEV monitoring and reporting dashboards.

Effective MEV monitoring begins with tracking the right metrics. Core transaction-level metrics include arbitrage profit, sandwich profit, and liquidator profit, which quantify the value extracted from specific opportunities. At the block level, you need to monitor the total MEV extracted per block and the block builder's payment (the tip paid to the proposer). For network health, track the MEV burn rate (the portion of MEV redirected to EIP-1559 base fee burn) and the proposer payment share (the percentage of MEV captured by validators). These metrics provide a foundational view of MEV activity and its economic distribution.

Sourcing this data requires aggregating from multiple specialized providers. Flashbots' mev-boost relay APIs provide data on builder bids and block construction. For on-chain analysis, services like EigenPhi and Etherscan's MEV dashboard offer pre-processed transaction labels and profit calculations. To analyze mempool activity and pending transactions, you can connect to public mempool services like Bloxroute or use the txpool RPC methods from your own node. For comprehensive historical analysis, structured datasets on Dune Analytics and Flipside Crypto contain aggregated MEV data from labeled transactions.

Building a dashboard involves querying these sources and visualizing trends. A typical architecture uses a backend service to poll APIs from Flashbots and mempool providers, parses transaction calldata to identify MEV patterns, and stores the results in a time-series database like TimescaleDB. Frontend dashboards, built with frameworks like Grafana or React with Recharts, can then display key charts: MEV revenue over time, top extracting searchers by address, dominant MEV strategies per day, and validator market share among block builders. Setting alerts for anomalies, like a sudden spike in sandwich attack volume, turns a passive dashboard into an active monitoring tool.

For developers, here's a basic Python example using the Web3.py library and the Flashbots relay API to fetch the highest bid for the current slot, a key data point for monitoring builder competition:

python
from web3 import Web3
import requests

web3 = Web3(Web3.HTTPProvider('YOUR_RPC_URL'))
slot = web3.eth.get_block('latest')['slot']

# Example: Fetch bid data from a Flashbots relay
relay_url = 'https://boost-relay.flashbots.net'
bid_response = requests.get(f'{relay_url}/relay/v1/data/bidtraces/builder_blocks_received?slot={slot}')
bid_data = bid_response.json()

if bid_data:
    highest_bid = max(block['value'] for block in bid_data)
    print(f"Highest bid for slot {slot}: {Web3.from_wei(highest_bid, 'ether')} ETH")

Beyond basic metrics, advanced monitoring incorporates risk indicators. Track the censorship rate by measuring the percentage of blocks that exclude transactions from the public mempool, a concern post-merge. Monitor builder centralization by calculating the Herfindahl-Hirschman Index (HHI) for builder market share. Also, correlate MEV activity with network congestion (gas price spikes) and DeFi protocol usage, as high volumes on AMMs like Uniswap V3 directly create more arbitrage opportunities. This contextual analysis reveals the broader impact of MEV on network performance and application-layer health.

Finally, ensure your reporting is actionable. Dashboards should help answer specific questions: Is a particular strategy becoming unprofitable? Are new builders gaining market share? Is user experience degrading due to sandwich attacks? By automating the collection of key metrics from Flashbots, EigenPhi, and on-chain RPC calls, teams can move from observing MEV to proactively managing its effects on their protocols, validators, or investment strategies, making data-driven decisions in a complex ecosystem.

tool-stack-overview
IMPLEMENTATION GUIDE

MEV Monitoring Tool Stack

A curated selection of tools and frameworks for building real-time dashboards to detect, analyze, and report on MEV activity across Ethereum and other EVM chains.

data-pipeline-setup
MEV MONITORING

Step 1: Building the Data Ingestion Pipeline

The foundation of any MEV dashboard is a robust data pipeline. This step involves sourcing, processing, and structuring raw blockchain data into actionable insights.

A monitoring pipeline begins with a reliable data source. For real-time MEV analysis, you need access to a full node's mempool (transaction pool) and block data. Services like Alchemy, QuickNode, or running your own Erigon or Geth node provide the necessary JSON-RPC endpoints. The key is subscribing to events like eth_subscribe("newPendingTransactions") for mempool streams and eth_getBlockByNumber for finalized blocks to capture the complete lifecycle of a transaction.

Raw data must be transformed. An effective pipeline parses each transaction and block to extract MEV-specific signals. This includes calculating gas prices, identifying arbitrage opportunities by comparing DEX prices across pools, detecting sandwich attacks by analyzing transaction ordering within a block, and spotting liquidations on lending protocols. Tools like the Ethereum Execution API Specification standardize this data extraction, while frameworks like Apache Kafka or RabbitMQ can manage the high-throughput event stream.

For practical implementation, here's a simplified Python example using Web3.py to listen for pending transactions and calculate potential priority fees, a common MEV metric:

python
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('YOUR_RPC_URL'))
def handle_new_tx(tx_hash):
    tx = w3.eth.get_transaction(tx_hash)
    block = w3.eth.get_block('latest')
    base_fee = block['baseFeePerGas']
    priority_fee = tx['maxPriorityFeePerGas']
    print(f"Tx: {tx_hash.hex()} | Priority Fee: {priority_fee}")
new_tx_filter = w3.eth.filter('pending')
while True:
    for tx_hash in new_tx_filter.get_new_entries():
        handle_new_tx(tx_hash)

Processed data needs a structured home. The final stage of the pipeline writes clean, indexed data to a time-series database like TimescaleDB or InfluxDB, or a data warehouse like Google BigQuery. This structure enables efficient querying for dashboard metrics—such as MEV revenue per block, top extracting searchers, or protocols most targeted by arbitrage. Ensuring data integrity through schema validation and idempotent processing is critical, as duplicate or malformed data will skew your analysis and alerting.

metric-calculation
DATA PIPELINE

Step 2: Calculating and Storing MEV Metrics

This section details the core data processing pipeline for transforming raw blockchain data into actionable MEV metrics, focusing on calculation logic and persistent storage strategies.

The first step in the calculation pipeline is identifying MEV-related transactions from your ingested raw data. This involves filtering for known patterns using heuristics and transaction simulation. Key signals include sandwich attacks (a profitable trade bracketed by a victim's transaction), arbitrage (profiting from price differences across DEXs), and liquidations (closing undercollateralized positions). For Ethereum, tools like the mev-inspect-py library or Flashbots' mev-inspect-rs provide foundational classifiers. You must extend these with custom logic for new protocols or obscure MEV types, validating findings against mempool data where available.

Once transactions are classified, calculating the extracted value is critical. For arbitrage, this is the net profit in the base token after accounting for all gas fees. For sandwich attacks, it's the profit from the attacker's two trades minus fees. Store these calculations with precise attribution: the extractor address (often a searcher or validator), the victim address (if applicable), the block number, and the transaction hash. Use a structured schema in your database, such as separate tables for mev_opportunities, mev_transactions, and extracted_value_details to enable complex queries.

Beyond simple profit sums, aggregate these metrics to generate insights. Calculate Total Extracted Value (TEV) per block, validator, or protocol. Track the MEV rate (TEV / block reward) to understand validator incentives. Monitor MEV concentration by analyzing the Gini coefficient of profits among searchers. These aggregated metrics should be computed in batch jobs (e.g., using Apache Spark or dbt) and stored in time-series databases like TimescaleDB or analytics tables for dashboard consumption. This historical data is essential for trend analysis.

For reliable access, choose a storage backend that balances query performance with cost. Time-series databases (TimescaleDB, InfluxDB) are optimal for aggregated metrics and dashboard queries. For raw transaction and classification data, a columnar data warehouse (Google BigQuery, Snowflake) enables complex historical analysis. Implement a data pipeline (using Airflow, Dagster, or Prefect) to orchestrate the daily calculation jobs, ensuring idempotency and data freshness. Always include data validation checks to flag anomalies in calculation logic or missing source data.

Finally, make this data actionable by pre-computing key dashboard datasets. Create materialized views for common queries: Top Extractors by 7-Day Volume, Protocols Most Targeted by MEV, Daily MEV by Type. Use these pre-aggregated tables to power your monitoring dashboards, ensuring sub-second query response times. The goal is to move from raw on-chain bytes to a curated set of tables that directly answer the most critical questions about MEV activity and risk in your monitored ecosystem.

dashboard-deployment
IMPLEMENTATION

Step 3: Deploying the Visualization Dashboard

This step covers deploying a real-time dashboard to visualize and analyze MEV data using Grafana and pre-built dashboards.

After collecting MEV data with mev-inspect-py and storing it in a PostgreSQL database, the next step is to visualize it. A dashboard transforms raw transaction data into actionable insights, allowing you to monitor metrics like extracted value per block, sandwich attack frequency, and top beneficiary addresses. The most common and powerful tool for this is Grafana, an open-source analytics platform that connects directly to your database. We will use the official Flashbots mev-explore dashboard as a foundation, which provides pre-configured panels for common MEV analysis.

Begin by installing Grafana on your server. Using Docker is the simplest method: run docker run -d -p 3000:3000 --name=grafana grafana/grafana-oss. Once Grafana is running, access the web interface at http://localhost:3000 (default login is admin/admin). The first task is to add your PostgreSQL database as a data source. In Grafana, navigate to Configuration > Data Sources, click 'Add data source', select PostgreSQL, and enter your connection details: host, database name (mev_inspect), and user credentials.

With the data source configured, you need to import the dashboard. The Flashbots team maintains the mev-explore dashboard JSON files in their GitHub repository. Clone the repo and find the dashboard.json file. In Grafana, go to Dashboards > Import, click 'Upload JSON file', and select the downloaded dashboard.json. After importing, select your PostgreSQL data source when prompted. The dashboard will now populate with panels showing key MEV metrics, including a time-series graph of Total Extracted Value (USD) and a table of the Top Extractors by Profit.

The default dashboard provides excellent starting points, but you will likely need to customize it. Grafana allows you to edit panels, add new queries, and create alerts. For instance, you might want to add a panel tracking arbitrage volume specifically on Uniswap V3 or set an alert for when the value extracted from sandwich attacks exceeds a certain threshold within an hour. Customization is done by editing the panel's SQL query, which accesses the mev_inspect schema tables like arbitrages, liquidations, and sandwiches created by the inspector.

For production monitoring, consider securing your Grafana instance with proper authentication (e.g., setting a strong password for the admin account, enabling OAuth) and setting up persistent storage for the Docker container. You can also configure Grafana to refresh the dashboard automatically every 30 seconds to see near-real-time data. This deployed dashboard becomes a critical tool for researchers quantifying the MEV landscape and for developers monitoring the impact of their smart contracts and transaction strategies in the mempool.

CORE METRICS

MEV Metric Definitions and Calculation Methods

Definitions, calculation formulas, and data sources for key MEV metrics used in monitoring dashboards.

MetricDefinitionCalculation MethodPrimary Data Source

Extracted Value (EV)

Total profit captured by searchers from a specific opportunity or block.

Sum(Transaction Value Out) - Sum(Transaction Value In) - Gas Costs

Block explorer APIs, Flashbots mev-share

Gas Used by MEV

Percentage of a block's gas limit consumed by MEV-related transactions.

(Gas used for MEV txns / Total block gas limit) * 100

Ethereum execution client (e.g., Geth, Erigon)

MEV Revenue Share

Proportion of total block reward (fees + coinbase) attributed to MEV.

(EV in block / Total block reward) * 100

Block builder APIs (e.g., Flashbots, bloXroute)

Arbitrage Profit

Profit from DEX arbitrage across pools within a single block.

Max(0, (Quote from Pool B - Quote from Pool A) - Gas Cost)

DEX subgraphs, mempool watchers

Sandwich Attack Profit

Profit from frontrunning and backrunning a victim's DEX trade.

(Profit from victim's slippage) - (Gas for two wrapper trades)

Mempool simulation, transaction tracing

Time to Inclusion (TTI)

Latency between a transaction's first appearance and its block inclusion.

Block Inclusion Timestamp - First Seen Timestamp

Private mempool relays, public mempool monitors

Failed MEV Attempts

Number of MEV bundles that reverted or were dropped from a block.

Count(Reverted/Dropped Bundles) / Count(Total Bundles Sent)

Searcher infrastructure logs, builder stats

MEV DASHBOARDS

Common Implementation Issues and Troubleshooting

Setting up effective MEV monitoring requires navigating data sourcing, metric calculation, and real-time alerting. This guide addresses frequent technical hurdles and their solutions.

Stale data typically originates from the data source or indexing layer. Common culprits include:

  • RPC Node Issues: Public RPC endpoints (Infura, Alchemy free tiers) have rate limits and can lag behind the chain tip. Use dedicated, archival nodes for MEV monitoring.
  • Mempool Access: If you're only listening to a single node's mempool, you're missing transactions broadcast to other nodes. Use a service like BloXroute, Titan, or connect to multiple geographically distributed nodes.
  • Indexing Delays: Custom indexers or subgraphs can fall behind during chain reorgs or high activity. Implement reorg-handling logic and monitor the lag between the latest block and your indexed data.

Solution: Implement a multi-source data pipeline. Combine a reliable RPC provider with a specialized mempool stream, and add a fallback mechanism to query block data directly if your primary stream fails.

MEV DASHBOARDS

Frequently Asked Questions

Common questions and troubleshooting for developers setting up MEV monitoring and reporting dashboards.

MEV extraction refers to the active process of capturing value from blockchain transaction ordering, typically through bots running strategies like arbitrage or liquidations. MEV monitoring is the passive observation and analysis of this activity. A dashboard doesn't extract MEV; it visualizes data from sources like the Flashbots MEV-Share API, EigenPhi, or block explorers to show metrics such as:

  • Extracted value per block
  • Most active searcher addresses
  • Common MEV strategies (e.g., DEX arbitrage, liquidations)
  • Failed bundle rates Monitoring is essential for researchers to understand ecosystem trends and for protocols to audit their exposure to MEV.
conclusion
IMPLEMENTATION GUIDE

Conclusion and Next Steps

You have configured a monitoring system for MEV activity. This guide outlines the final steps for deployment and suggests advanced areas for further development.

Your MEV dashboard is now a functional tool for observing on-chain activity. The next step is to deploy your monitoring stack into a production environment. For a robust setup, consider using containerization with Docker and an orchestration tool like Kubernetes. This ensures your data pipeline—comprising your indexer, database, and API—is resilient and scalable. Implement logging with a service like Loki or the ELK stack and set up alerts in PagerDuty or Slack to notify you of critical events, such as a sudden spike in sandwich attack volume or a validator missing blocks.

To deepen your analysis, integrate additional data sources. Connect to a block explorer API like Etherscan or Blockscout to enrich transaction data with token symbols and wallet labels. Ingest real-time mempool data from services like Blocknative or Bloxroute to see pending transactions before they are mined, which is crucial for frontrunning detection. You can also pull in macroeconomic indicators or social sentiment data to correlate MEV activity with broader market movements.

The architecture you've built can be extended into an active risk management system. Develop automated responses, such as programmatically increasing slippage tolerance on a DEX aggregator when sandwich attack density is high, or temporarily pausing certain DeFi strategies if arbitrage profitability collapses. For validator operators, create scripts that automatically adjust gas priority fees based on the real-time MEV opportunity value presented by your dashboard, maximizing rewards.

Finally, contribute to the ecosystem's transparency by considering open sourcing non-sensitive parts of your dashboard or publishing anonymized findings. Sharing generalized insights about MEV trends helps educate other developers and researchers. Continue your education by exploring resources like the Flashbots documentation, attending MEV-focused conferences like MEVDay, and participating in research collectives. Your monitoring system is not just a reporting tool; it's a foundation for building more secure and efficient decentralized applications.

How to Set Up MEV Monitoring and Reporting Dashboards | ChainScore Guides