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>
1.8 KiB
1.8 KiB
Implement Mathematical Algorithm
Implement the following mathematical algorithm for the MEV bot: $ARGUMENTS
Implementation Framework:
- Requirements Analysis: Break down the mathematical requirements and precision needs
- Formula Implementation: Convert mathematical formulas to precise Go code
- Precision Handling: Use appropriate data types (uint256, big.Int) for calculations
- Edge Case Handling: Consider boundary conditions and error scenarios
- Testing: Create comprehensive tests including property-based tests
- 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/orpkg/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/uint256for 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