Files
mev-beta/README.md
Krypto Kajun 8256da9281 math(perf): implement and benchmark optimized Uniswap V3 pricing functions
- Add cached versions of SqrtPriceX96ToPrice and PriceToSqrtPriceX96 functions
- Implement comprehensive benchmarks for all mathematical functions
- Add accuracy tests for optimized functions
- Document mathematical optimizations and performance analysis
- Update README and Qwen Code configuration to reference optimizations

Performance improvements:
- SqrtPriceX96ToPriceCached: 24% faster than original
- PriceToSqrtPriceX96Cached: 12% faster than original
- Memory allocations reduced by 20-33%

🤖 Generated with Qwen Code
Co-Authored-By: Qwen <noreply@tongyi.aliyun.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2025-09-14 11:36:57 -05:00

98 lines
3.7 KiB
Markdown

# 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
- Optimized mathematical functions for improved performance (see [Mathematical Optimizations](docs/MATH_OPTIMIZATIONS.md))
## Prerequisites
- Go 1.24 or higher
- Access to Arbitrum node
## Installation
```bash
go mod tidy
```
## Usage
```bash
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
├── .claude/ # Claude Code specific configuration and tools
├── .gemini/ # Gemini specific configuration and tools
├── .opencode/ # OpenCode specific configuration and tools
├── .qwen/ # Qwen Code specific configuration and tools
├── CLAUDE.md # Complete project documentation and Claude context (comprehensive example)
├── GEMINI.md # Gemini context (simplified, references CLAUDE.md)
├── OPENCODE.md # OpenCode context (simplified, references CLAUDE.md)
└── QWEN.md # Qwen Code context (simplified, references CLAUDE.md)
```
## Development
### AI Assistant CLI Configurations
This project is configured to work with multiple AI coding assistants, each with specialized expertise:
- **Claude** (`.claude/`) - System architecture, design patterns, and integration
- **OpenCode** (`.opencode/`) - Multi-language development and testing
- **Qwen Code** (`.qwen/`) - Mathematical computations and precision handling
- **Gemini** (`.gemini/`) - Performance optimization and concurrency
### Git Workflow
This project follows a comprehensive Git workflow with specific branch strategies, commit conventions, and automated checks. See [docs/GIT_WORKFLOW.md](docs/GIT_WORKFLOW.md) and [docs/BRANCH_STRATEGY.md](docs/BRANCH_STRATEGY.md) for detailed information.
Key aspects:
- **Branch Strategy**: `main`, `develop`, `feature/*`, `fix/*`, `release/*`, `hotfix/*`
- **Commit Messages**: Conventional commits format
- **Git Hooks**: Pre-commit and pre-push checks
- **Pull Requests**: Required for all merges to `main` and `develop`
### 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 following the branch naming conventions
3. Commit your changes with conventional commit messages
4. Push to the branch
5. Create a Pull Request with detailed description
## License
MIT