Files
mev-beta/docs/monitoring.md
2025-09-12 01:16:30 -05:00

1.5 KiB

Monitoring System Documentation

This document explains how the MEV bot monitors the Arbitrum sequencer for potential swap transactions.

Overview

The monitoring system connects to an Arbitrum RPC endpoint and continuously monitors for new blocks and transactions. It identifies potential swap transactions and forwards them to the market scanner for analysis.

Components

ArbitrumMonitor

The main monitoring component that handles:

  • Connecting to the Arbitrum RPC endpoint
  • Polling for new blocks
  • Processing transactions in new blocks
  • Identifying potential swap transactions

Transaction Processing

Each transaction is analyzed to determine if it's a potential swap:

  1. Check if the transaction is calling a known DEX contract
  2. Decode the transaction data to extract swap parameters
  3. Extract token addresses and amounts
  4. Calculate potential price impact

Configuration

The monitoring system is configured through config/config.yaml:

  • arbitrum.rpc_endpoint: The RPC endpoint to connect to
  • bot.polling_interval: How often to check for new blocks
  • arbitrum.chain_id: The chain ID to ensure we're on the correct network

Implementation Details

The monitor uses the go-ethereum library to interact with the Arbitrum network. It implements efficient polling to minimize RPC calls while ensuring timely detection of new blocks.

Key features:

  • Graceful error handling and reconnection
  • Configurable polling intervals
  • Transaction sender identification
  • Support for both RPC and WebSocket endpoints