Files
mev-beta/orig/.claude/commands/verify-precision.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

54 lines
1.7 KiB
Markdown

# Verify Mathematical Precision
Verify the precision and correctness of the following mathematical implementation in the MEV bot: $ARGUMENTS
## Verification Protocol:
### 1. **Mathematical Correctness Analysis**
- Review mathematical formulas against official specifications
- Validate implementation against known test cases
- Check boundary conditions and edge cases
- Verify precision handling for large numbers
### 2. **Property-Based Testing**
```bash
# Run property-based tests for mathematical functions
go test -v -run=Property ./pkg/uniswap/...
# Run fuzz tests for mathematical calculations
go test -fuzz=Fuzz ./pkg/uniswap/...
```
### 3. **Precision Validation Areas**
#### **Uniswap V3 Calculations**
- sqrtPriceX96 to price conversion accuracy
- Tick calculation correctness
- Liquidity-based calculation precision
- Price impact computation validation
#### **Financial Calculations**
- Profit calculation accuracy
- Gas estimation precision
- Slippage protection validation
- Fee calculation correctness
### 4. **Comparison Testing**
- Compare results with reference implementations
- Validate against on-chain data when possible
- Cross-check with other DeFi protocol implementations
- Benchmark against established mathematical libraries
## Verification Steps:
1. **Static Analysis**: Review code for mathematical correctness
2. **Unit Testing**: Verify with known test cases
3. **Property Testing**: Test mathematical invariants
4. **Fuzz Testing**: Find edge cases with random inputs
5. **Comparison Testing**: Validate against reference implementations
## Output Requirements:
- Detailed correctness analysis report
- Precision validation results
- Edge case identification and handling
- Recommendations for improvements
- Test suite enhancements