docs: Merge analysis/CLAUDE.md into onchain/CLAUDE.md
Consolidated the fuzzing analysis documentation into the main onchain CLAUDE.md file for better discoverability. Removed the redundant analysis/CLAUDE.md file. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1a45646017
commit
f4ae2fea7a
2 changed files with 56 additions and 57 deletions
|
|
@ -71,7 +71,62 @@ forge test --fuzz-runs 10000 # Extended fuzzing
|
|||
|
||||
## Analysis Tools
|
||||
|
||||
See `analysis/CLAUDE.md` for fuzzing and attack vector testing.
|
||||
### Fuzzing Analysis
|
||||
|
||||
Tools for testing KRAIKEN's three-position strategy resilience against various market conditions and trading patterns.
|
||||
|
||||
#### Quick Start
|
||||
|
||||
```bash
|
||||
# Run with specific optimizer (50 runs default)
|
||||
./analysis/run-fuzzing.sh BullMarketOptimizer
|
||||
|
||||
# Custom runs and trades
|
||||
./analysis/run-fuzzing.sh WhaleOptimizer runs=100 trades=30
|
||||
|
||||
# Debug mode with position tracking CSV (forces runs=1)
|
||||
./analysis/run-fuzzing.sh NeutralMarketOptimizer debugCSV
|
||||
```
|
||||
|
||||
#### Available Optimizers
|
||||
|
||||
- `BullMarketOptimizer` - Buying bias
|
||||
- `NeutralMarketOptimizer` - Balanced trading
|
||||
- `BearMarketOptimizer` - Selling bias
|
||||
- `WhaleOptimizer` - Large positions
|
||||
- `RandomScenarioOptimizer` - Random behavior
|
||||
|
||||
#### Output Structure
|
||||
|
||||
Each campaign creates `fuzzing_results_[optimizer]_[timestamp]/`:
|
||||
- `config.txt` - Campaign parameters
|
||||
- `run_*.log` - Individual run logs
|
||||
- `merged_profitable_scenarios.csv` - Profitable scenarios combined
|
||||
- `summary.txt` - Statistics and cumulative P&L
|
||||
- `debug_positions_*.csv` - Position data (debugCSV mode only)
|
||||
|
||||
#### Visualization
|
||||
|
||||
```bash
|
||||
# Automatic launch with debugCSV
|
||||
./analysis/run-fuzzing.sh [optimizer] debugCSV
|
||||
|
||||
# Manual server (port 8000)
|
||||
./analysis/view-scenarios.sh
|
||||
```
|
||||
|
||||
#### Advanced Usage
|
||||
|
||||
```bash
|
||||
# Manual fuzzing with environment variables
|
||||
FUZZING_RUNS=500 TRACK_POSITIONS=true forge script analysis/FuzzingAnalysis.s.sol --ffi --via-ir
|
||||
```
|
||||
|
||||
Environment variables:
|
||||
- `FUZZING_RUNS` - Scenarios per market (default: 100)
|
||||
- `TRACK_POSITIONS` - Enable position CSV (default: false)
|
||||
- `OPTIMIZER_CLASS` - Optimizer to use
|
||||
- `TRADES_PER_RUN` - Trades per run (default: 20)
|
||||
|
||||
## Uniswap V3 Math
|
||||
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
# KRAIKEN LiquidityManager Fuzzing Analysis
|
||||
|
||||
Tools for testing KRAIKEN's three-position strategy resilience against various market conditions and trading patterns.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Run with specific optimizer (50 runs default)
|
||||
./analysis/run-fuzzing.sh BullMarketOptimizer
|
||||
|
||||
# Custom runs and trades
|
||||
./analysis/run-fuzzing.sh WhaleOptimizer runs=100 trades=30
|
||||
|
||||
# Debug mode with position tracking CSV (forces runs=1)
|
||||
./analysis/run-fuzzing.sh NeutralMarketOptimizer debugCSV
|
||||
```
|
||||
|
||||
## Available Optimizers
|
||||
|
||||
- `BullMarketOptimizer` - Buying bias
|
||||
- `NeutralMarketOptimizer` - Balanced trading
|
||||
- `BearMarketOptimizer` - Selling bias
|
||||
- `WhaleOptimizer` - Large positions
|
||||
- `RandomScenarioOptimizer` - Random behavior
|
||||
|
||||
## Output Structure
|
||||
|
||||
Each campaign creates `fuzzing_results_[optimizer]_[timestamp]/`:
|
||||
- `config.txt` - Campaign parameters
|
||||
- `run_*.log` - Individual run logs
|
||||
- `merged_profitable_scenarios.csv` - Profitable scenarios combined
|
||||
- `summary.txt` - Statistics and cumulative P&L
|
||||
- `debug_positions_*.csv` - Position data (debugCSV mode only)
|
||||
|
||||
## Visualization
|
||||
|
||||
```bash
|
||||
# Automatic launch with debugCSV
|
||||
./analysis/run-fuzzing.sh [optimizer] debugCSV
|
||||
|
||||
# Manual server (port 8000)
|
||||
./analysis/view-scenarios.sh
|
||||
```
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
```bash
|
||||
# Manual fuzzing with environment variables
|
||||
FUZZING_RUNS=500 TRACK_POSITIONS=true forge script analysis/FuzzingAnalysis.s.sol --ffi --via-ir
|
||||
```
|
||||
|
||||
Environment variables:
|
||||
- `FUZZING_RUNS` - Scenarios per market (default: 100)
|
||||
- `TRACK_POSITIONS` - Enable position CSV (default: false)
|
||||
- `OPTIMIZER_CLASS` - Optimizer to use
|
||||
- `TRADES_PER_RUN` - Trades per run (default: 20)
|
||||
Loading…
Add table
Add a link
Reference in a new issue