Files
mev-beta/orig/.claude/commands/implement-algorithm.md
Administrator c54c569f30 refactor: move all remaining files to orig/ directory
Completed clean root directory structure:
- Root now contains only: .git, .env, docs/, orig/
- Moved all remaining files and directories to orig/:
  - Config files (.claude, .dockerignore, .drone.yml, etc.)
  - All .env variants (except active .env)
  - Git config (.gitconfig, .github, .gitignore, etc.)
  - Tool configs (.golangci.yml, .revive.toml, etc.)
  - Documentation (*.md files, @prompts)
  - Build files (Dockerfiles, Makefile, go.mod, go.sum)
  - Docker compose files
  - All source directories (scripts, tests, tools, etc.)
  - Runtime directories (logs, monitoring, reports)
  - Dependency files (node_modules, lib, cache)
  - Special files (--delete)

- Removed empty runtime directories (bin/, data/)

V2 structure is now clean:
- docs/planning/ - V2 planning documents
- orig/ - Complete V1 codebase preserved
- .env - Active environment config (not in git)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 10:53:05 +01:00

1.8 KiB

Implement Mathematical Algorithm

Implement the following mathematical algorithm for the MEV bot: $ARGUMENTS

Implementation Framework:

  1. Requirements Analysis: Break down the mathematical requirements and precision needs
  2. Formula Implementation: Convert mathematical formulas to precise Go code
  3. Precision Handling: Use appropriate data types (uint256, big.Int) for calculations
  4. Edge Case Handling: Consider boundary conditions and error scenarios
  5. Testing: Create comprehensive tests including property-based tests
  6. Optimization: Optimize for performance while maintaining precision

Implementation Standards:

  • Numerical Precision: Use github.com/holiman/uint256 for precise uint256 arithmetic
  • Error Handling: Implement robust error handling with clear error messages
  • Documentation: Document all mathematical formulas and implementation decisions
  • Testing: Achieve >95% test coverage with property-based tests for mathematical functions
  • Performance: Consider performance implications and benchmark critical paths

File Organization:

  • Core Logic: Place in appropriate pkg/uniswap/ or pkg/math/ subdirectory
  • Tests: Co-locate with source files (*_test.go)
  • Documentation: Inline comments explaining mathematical formulas

Integration Points:

  • Uniswap Pricing: Integrate with pkg/uniswap/ for pricing calculations
  • Market Analysis: Connect to pkg/market/ for market data processing
  • Precision Libraries: Use github.com/holiman/uint256 for uint256 arithmetic

Deliverables:

  • Working implementation with comprehensive tests
  • Documentation of mathematical formulas and implementation approach
  • Performance benchmarks for critical functions
  • Edge case handling and error scenarios