Krypto Kajun be7b1b55d0 Implement enhanced logging with structured opportunity detection
## New Features:
-  Enhanced logger with proper log levels (DEBUG, INFO, WARN, ERROR, OPPORTUNITY)
-  Structured swap data extraction with AmountIn, AmountOut, MinOut values
-  Detailed opportunity logging with full transaction parsing
-  Professional log formatting with timestamps and level indicators
-  Log level filtering (DEBUG shows all, INFO filters out debug messages)

## Enhanced Logger Features:
- Custom timestamp format: `2025/09/14 06:53:59 [LEVEL] message`
- Proper log level hierarchy and filtering
- Special OPPORTUNITY level that always logs regardless of config
- Detailed opportunity logs with tree structure showing:
  - Transaction hash, from/to addresses
  - Method name and protocol (UniswapV2/V3)
  - Amount In/Out/Min values in human-readable format
  - Estimated profit (placeholder for future price oracle)
  - Additional structured data (tokens, fees, deadlines, etc.)

## L2 Parser Enhancements:
- New SwapDetails struct for structured swap data
- Enhanced DEX function parameter decoding
- Support for UniswapV2 and V3 function signatures
- Proper extraction of swap amounts, tokens, and metadata

## Verified Working:
-  DEBUG level: Shows all messages including detailed processing
-  INFO level: Filters out DEBUG, shows only important events
-  OPPORTUNITY detection: Full structured logging of arbitrage opportunities
-  Real DEX transactions detected: 1882+ token swaps logged with full details

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-14 06:56:59 -05:00
2025-09-14 06:21:10 -05:00
2025-09-14 06:21:10 -05:00
2025-09-14 06:21:10 -05:00
2025-09-14 06:21:10 -05:00
2025-09-14 06:21:10 -05:00

MEV Bot

An MEV (Maximal Extractable Value) bot written in Go that monitors the Arbitrum sequencer for potential swap opportunities and identifies profitable arbitrage opportunities.

Overview

This bot monitors the Arbitrum sequencer for attempted swaps and analyzes them to determine if they are large enough to create price movements that can be exploited for arbitrage. It uses off-chain methods to calculate price movements using Uniswap V3 pricing functions.

Features

  • Real-time monitoring of Arbitrum sequencer
  • Detection of potential swap transactions
  • Market scanning for price movement analysis
  • Uniswap V3 pricing calculations (price to tick, sqrtPriceX96 to tick, etc.)
  • Arbitrage opportunity identification

Prerequisites

  • Go 1.24 or higher
  • Access to Arbitrum node

Installation

go mod tidy

Usage

go run cmd/mev-bot/main.go

Configuration

Configuration files can be found in the config/ directory.

Project Structure

.
├── cmd/                 # Main applications
├── config/              # Configuration files
├── internal/            # Private application and library code
├── pkg/                 # Library code that can be used by external projects
├── @prompts/            # AI prompts for development assistance
├── docs/                # Documentation
├── scripts/             # Scripts for building, testing, and deployment
├── go.mod               # Go module definition
├── go.sum               # Go module checksums
├── README.md            # This file
└── QWEN.md              # Qwen Code context file

Development

Prompts Directory

The @prompts/ directory contains prompts that can be used with AI coding assistants for various development tasks.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT

Description
mev-beta
Readme 1.5 GiB
Languages
Go 91.5%
Shell 8.1%
Makefile 0.4%