fix(multicall): resolve critical multicall parsing corruption issues

- Added comprehensive bounds checking to prevent buffer overruns in multicall parsing
- Implemented graduated validation system (Strict/Moderate/Permissive) to reduce false positives
- Added LRU caching system for address validation with 10-minute TTL
- Enhanced ABI decoder with missing Universal Router and Arbitrum-specific DEX signatures
- Fixed duplicate function declarations and import conflicts across multiple files
- Added error recovery mechanisms with multiple fallback strategies
- Updated tests to handle new validation behavior for suspicious addresses
- Fixed parser test expectations for improved validation system
- Applied gofmt formatting fixes to ensure code style compliance
- Fixed mutex copying issues in monitoring package by introducing MetricsSnapshot
- Resolved critical security vulnerabilities in heuristic address extraction
- Progress: Updated TODO audit from 10% to 35% complete

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Krypto Kajun
2025-10-17 00:12:55 -05:00
parent f358f49aa9
commit 850223a953
8621 changed files with 79808 additions and 7340 deletions

View File

@@ -0,0 +1,184 @@
{
"summary": {
"generated_at": "2025-10-07T12:37:58.164681749Z",
"total_vectors": 7,
"vectors_passed": 7,
"total_assertions": 7,
"assertions_passed": 7,
"property_checks": 4,
"property_succeeded": 4
},
"vectors": [
{
"name": "balancer_wbtc_usdc",
"description": "Simplified Balancer 50/50 weighted pool",
"exchange": "balancer",
"passed": true,
"tests": [
{
"name": "amount_out_0_001_wbtc",
"type": "amount_out",
"passed": true,
"delta_bps": 0,
"expected": "1",
"actual": "1",
"annotations": [
"tolerance 1.0000 bps"
]
}
]
},
{
"name": "camelot_algebra_weth_usdc",
"description": "Camelot/Algebra concentrated liquidity sample",
"exchange": "camelot",
"passed": true,
"tests": [
{
"name": "amount_out_0_1_weth",
"type": "amount_out",
"passed": true,
"delta_bps": 0,
"expected": "224831320273846572",
"actual": "224831320273846572",
"annotations": [
"tolerance 1.0000 bps"
]
}
]
},
{
"name": "curve_usdc_usdt",
"description": "Curve stable swap example with 0.04% fee",
"exchange": "curve",
"passed": true,
"tests": [
{
"name": "amount_out_1_usdc",
"type": "amount_out",
"passed": true,
"delta_bps": 0,
"expected": "999600",
"actual": "999600",
"annotations": [
"tolerance 1.0000 bps"
]
}
]
},
{
"name": "ramses_v3_weth_usdc",
"description": "Ramses V3 concentrated liquidity example",
"exchange": "ramses",
"passed": true,
"tests": [
{
"name": "amount_out_0_05_weth",
"type": "amount_out",
"passed": true,
"delta_bps": 0,
"expected": "0.099675155967375131",
"actual": "0.099675155967375131",
"annotations": [
"tolerance 1.0000 bps"
]
}
]
},
{
"name": "traderjoe_usdc_weth",
"description": "TraderJoe constant-product pool example mirroring Uniswap V2 math",
"exchange": "traderjoe",
"passed": true,
"tests": [
{
"name": "amount_out_3_weth",
"type": "amount_out",
"passed": true,
"delta_bps": 0,
"expected": "4469788577954173832583",
"actual": "4469788577954173832583",
"annotations": [
"tolerance 1.0000 bps"
]
}
]
},
{
"name": "uniswap_v2_usdc_weth",
"description": "Uniswap V2 style pool with 10k WETH against 20M USDC",
"exchange": "uniswap_v2",
"passed": true,
"tests": [
{
"name": "amount_out_5_weth",
"type": "amount_out",
"passed": true,
"delta_bps": 0,
"expected": "9871580343970612988504",
"actual": "9871580343970612988504",
"annotations": [
"tolerance 1.0000 bps"
]
}
]
},
{
"name": "uniswap_v3_weth_usdc",
"description": "Uniswap V3 style pool around price 1:1 for deterministic regression",
"exchange": "uniswap_v3",
"passed": true,
"tests": [
{
"name": "amount_out_0_1_weth",
"type": "amount_out",
"passed": true,
"delta_bps": 0,
"expected": "199360247566635212",
"actual": "199360247566635212",
"annotations": [
"tolerance 1.0000 bps"
]
}
]
}
],
"property_checks": [
{
"name": "price_conversion_round_trip",
"type": "property",
"passed": true,
"delta_bps": 0,
"expected": "",
"actual": "",
"details": "all samples within 0.1% tolerance"
},
{
"name": "tick_conversion_round_trip",
"type": "property",
"passed": true,
"delta_bps": 0,
"expected": "",
"actual": "",
"details": "ticks round-trip within ±1"
},
{
"name": "price_monotonicity",
"type": "property",
"passed": true,
"delta_bps": 0,
"expected": "",
"actual": "",
"details": "higher ticks produced higher prices"
},
{
"name": "price_symmetry",
"type": "property",
"passed": true,
"delta_bps": 0,
"expected": "",
"actual": "",
"details": "price * inverse remained within 0.1%"
}
]
}

View File

@@ -0,0 +1,26 @@
# Math Audit Report
- Generated: 2025-10-07 12:37:58 UTC
- Vectors: 7/7 passed
- Assertions: 7/7 passed
- Property checks: 4/4 passed
## Vector Results
| Vector | Exchange | Status | Notes |
| --- | --- | --- | --- |
| balancer_wbtc_usdc | balancer | ✅ PASS | |
| camelot_algebra_weth_usdc | camelot | ✅ PASS | |
| curve_usdc_usdt | curve | ✅ PASS | |
| ramses_v3_weth_usdc | ramses | ✅ PASS | |
| traderjoe_usdc_weth | traderjoe | ✅ PASS | |
| uniswap_v2_usdc_weth | uniswap_v2 | ✅ PASS | |
| uniswap_v3_weth_usdc | uniswap_v3 | ✅ PASS | |
## Property Checks
- ✅ price_conversion_round_trip — all samples within 0.1% tolerance
- ✅ tick_conversion_round_trip — ticks round-trip within ±1
- ✅ price_monotonicity — higher ticks produced higher prices
- ✅ price_symmetry — price * inverse remained within 0.1%

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x69bad4eca82a4e139aad810777dc72faf5414e338b0a1b648e8472cd4904f93e",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bbd00000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a482cf40000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x69aaa929dace9feee6e1579f4b0fae055868fd56bb7fbd653a02ebd787e348f3",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bc000000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a48f10c0000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0xf6431652d3e4e9de83d259de062488064ead35e5f112d13ae110b24b8782e242",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bc300000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a49b5240000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "TraderJoeRouter",
"from": "0x3855808a7f42dbaebacf07291e0ae0a7ed692ecb",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xaf6228fcef1fa34dafd4e8d6e359b845e052a1a6597c88c1c2c94045c6140f9f",
"input_data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d50000000000000000000000000000000000000000000000000002d407c9f880c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000344f59c48eb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000098d7803aea152ff1009f000000000000000000000000000000000000000000000000000000000000000012f0569e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031a27787e450000000000000000000000000000000000000000000000000002d407c9f880c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000003855808a7f42dbaebacf07291e0ae0a7ed692ecb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ff00000000000000000000000000000000000001000000000000000000000000de967676db7b1ccdba2bd94b01b5b19de4b563e4000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0x87d66368cd08a7ca42252f5ab44b2fb6d1fb8d15",
"value": "796079871787200"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x725db13de678e9da4590bf4fe40051f397ff4c8625ef5f1e343a39905151fa7b",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bc600000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a4a793c0000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "",
"from": "0xe0beeedbb7d392e6958741c8f9f4bc2e45231e4c",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xe821c9a0ec256c0fd38f6e57eab070bf79b0048d2104989c2cd4c666d46657aa",
"input_data": "0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000124c04b8d59000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e0beeedbb7d392e6958741c8f9f4bc2e45231e4c0000000000000000000000000000000000000000000000000000000068fa3aac00000000000000000000000000000000000000000000000506a66f2e4143c000000000000000000000000000000000000000000000000000000000000586e04600000000000000000000000000000000000000000000000000000000000000285d3a1ff2b6bab83b63cd9ad0787074081a52ef34af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0x1f721e2e82f6676fce4ea07a5958cf098d339e18",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3PositionManager",
"from": "0xe5e58921dfa6602792e3f5624e91d291c01dc135",
"function": "decreaseLiquidity",
"function_sig": "0x0c49ccbe",
"hash": "0x5992966aa1cc733367aa0a00e2b3098b6d0d6b88835affbc43e02e1101ac4b8b",
"input_data": "0x0c49ccbe00000000000000000000000000000000000000000000000000000000004c1f2c00000000000000000000000000000000000000000000000000000001e20e0177000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068ed105b",
"protocol": "UniswapV3",
"to": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "TraderJoeRouter",
"from": "0xcdd200769654f3c986fe6e48584585705a7941f6",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xca9f939fa7f27921ce356dbd103c7613b464dba7356c6a5ce522619c21f14fbb",
"input_data": "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000247489ec235815d3beeae78016c1c0a784c92f5411014e58dd317dbe6562f2140c65f61ece00000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0x87d66368cd08a7ca42252f5ab44b2fb6d1fb8d15",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV2Router02",
"from": "0xba7a224852693f9a1695334105c2e63159eb2311",
"function": "swapExactTokensForTokens",
"function_sig": "0x38ed1739",
"hash": "0xee2af12f5e40c87e7452f70ef439bcf22663a726cc1bdf9f0def2e0f33f72320",
"input_data": "0x38ed17390000000000000000000000000000000000000000000000053220a269ab55c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ba7a224852693f9a1695334105c2e63159eb23110000000000000000000000000000000000000000000000000000000068ed12b5000000000000000000000000000000000000000000000000000000000000000200000000000000000000000003f6921f6e948016631ce796331294d5a863a9ee000000000000000000000000dcc9691793633176acf5cfdc1a658cb3b982e2fb",
"protocol": "UniswapV2",
"to": "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "",
"from": "0x3b0795a13dad67005c629cf02afd8ed515643655",
"function": "swapExactTokensForTokens",
"function_sig": "0x38ed1739",
"hash": "0x3a4869a8dcc5d309eaf3687ec47bfa220f21029375863d3e2e4f3a797e096497",
"input_data": "0x38ed173900000000000000000000000000000000000000000000000246ddf97976680000000000000000000000000000000000000000000000000000000000000b0baa4900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000003b0795a13dad67005c629cf02afd8ed5156436550000000000000000000000000000000000000000000000000000000068ed102400000000000000000000000000000000000000000000000000000000000000020000000000000000000000001009c5c11cdd44bffeac3c70db7eb143df2faad1000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
"protocol": "UniswapV2",
"to": "0x82dfd2b94222bdb603aa6b34a8d37311ab3db800",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3PositionManager",
"from": "0xe5e58921dfa6602792e3f5624e91d291c01dc135",
"function": "collect",
"function_sig": "0xfc6f7865",
"hash": "0x2b55abd5ee9bc902e5370824e8f618cde32c1fdfd0307e433fb3aabb22e6a86a",
"input_data": "0xfc6f786500000000000000000000000000000000000000000000000000000000004c1f2c000000000000000000000000e5e58921dfa6602792e3f5624e91d291c01dc13500000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000ffffffffffffffffffffffffffffffff",
"protocol": "UniswapV3",
"to": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3PositionManager",
"from": "0x9e47fbb2a2a27b3b02e4a63b3ef5a3dc863c0223",
"function": "multicall",
"function_sig": "0xac9650d8",
"hash": "0xa467b01f88098a11878e4c4e43956c943f6d7766139825bb7cbf2bb8efe69578",
"input_data": "0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000a40c49ccbe00000000000000000000000000000000000000000000000000000000004c1daa000000000000000000000000000000000000000000000000004c4269abc13855000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068ed12a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084fc6f786500000000000000000000000000000000000000000000000000000000004c1daa000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c00000000000000000000000000000000000000000000000000225dcd56988ae70000000000000000000000009e47fbb2a2a27b3b02e4a63b3ef5a3dc863c0223000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064df2ab5bb000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90000000000000000000000000000000000000000000000000000000002637ba50000000000000000000000009e47fbb2a2a27b3b02e4a63b3ef5a3dc863c022300000000000000000000000000000000000000000000000000000000",
"protocol": "Multicall",
"to": "0xc36442b4a4522e871399cd717abdd847ab11fe88",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x8cc6ab9ac1d1b7c5f6fc33f767aded9a305744e3",
"function": "exactOutputSingle",
"function_sig": "0xdb3e2198",
"hash": "0x71b76f0e28627051c8e349f4a5af835fb716f39549b50532eb5d8261e9780d2a",
"input_data": "0xdb3e2198000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8000000000000000000000000912ce59144191c1204e64559fe8253a0e49e654800000000000000000000000000000000000000000000000000000000000001f40000000000000000000000008cc6ab9ac1d1b7c5f6fc33f767aded9a305744e30000000000000000000000000000000000000000000000000000000068ed0bd300000000000000000000000000000000000000000000001b1ae4d6e2ef500000000000000000000000000000000000000000000000000000000000000a4adb480000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,12 @@
{
"block_number": "",
"contract_name": "UniswapV3Router",
"from": "0x196beae17c9577256a4c20d72a3c01cae5d00e9e",
"function": "exactInputSingle",
"function_sig": "0x414bf389",
"hash": "0xd39c510f44355cca3b7ee947b9697ef95df8921c8a90b3639572382092afe90c",
"input_data": "0x414bf38900000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000440017a1b021006d556d7fc06a54c32e42eb745b0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000196beae17c9577256a4c20d72a3c01cae5d00e9e0000000000000000000000000000000000000000000000000000000068ed0e0e0000000000000000000000000000000000000000000000000024a689f2b2e3f0000000000000000000000000000000000000000000000011470476b682d78b380000000000000000000000000000000000000000000000000000000000000000",
"protocol": "UniswapV3",
"to": "0xe592427a0aece92de3edee1f18e0157c05861564",
"value": "0"
}

View File

@@ -0,0 +1,58 @@
{
"generated_at": "2025-10-14T04:22:11Z",
"vector_path": "/home/administrator/projects/mev-beta/tools/simulation/vectors/default.json",
"network": "arbitrum-one",
"window": "2024-09-15T00:00:00Z/2024-09-15T01:00:00Z",
"sources": [
"uniswap-v3",
"camelot",
"sushiswap"
],
"attempts": 5,
"executed": 4,
"conversion_rate": 0.8,
"successful": 3,
"failed": 1,
"hit_rate": 0.75,
"gross_profit_eth": "0.101000",
"gas_cost_eth": "0.013700",
"net_profit_eth": "0.087300",
"average_profit_per_trade_eth": "0.021825",
"average_gas_cost_eth": "0.003425",
"profit_factor": 6.372262773722627,
"exchange_breakdown": [
{
"exchange": "camelot",
"executed": 2,
"successful": 1,
"hit_rate": 0.5,
"gross_profit_eth": "0.012000",
"net_profit_eth": "0.006100",
"gas_cost_eth": "0.005900"
},
{
"exchange": "sushiswap",
"executed": 1,
"successful": 1,
"hit_rate": 1,
"gross_profit_eth": "0.049200",
"net_profit_eth": "0.044500",
"gas_cost_eth": "0.004700"
},
{
"exchange": "uniswap-v3",
"executed": 1,
"successful": 1,
"hit_rate": 1,
"gross_profit_eth": "0.039800",
"net_profit_eth": "0.036700",
"gas_cost_eth": "0.003100"
}
],
"skip_reasons": [
{
"reason": "below_min_profit",
"count": 1
}
]
}

View File

@@ -0,0 +1,31 @@
# Profitability Simulation Report
- Generated at: 2025-10-14T04:22:11Z
- Vector source: `/home/administrator/projects/mev-beta/tools/simulation/vectors/default.json`
- Network: **arbitrum-one**
- Window: 2024-09-15T00:00:00Z/2024-09-15T01:00:00Z
- Exchanges: uniswap-v3, camelot, sushiswap
## Summary
- Opportunities analysed: **5**
- Executed: **4** (conversion 80.0%)
- Successes: **3** / 4 (hit rate 75.0%)
- Gross profit: **0.101000 ETH**
- Gas spent: **0.013700 ETH**
- Net profit after gas: **0.087300 ETH**
- Avg profit per trade: **0.021825 ETH**
- Avg gas cost per trade: **0.003425 ETH**
- Profit factor (net/gas): **6.37**
## Exchange Breakdown
| Exchange | Executed | Success | Hit Rate | Gross Profit (ETH) | Gas (ETH) | Net Profit (ETH) |
| --- | ---:| ---:| ---:| ---:| ---:| ---:|
| camelot | 2 | 1 | 50.0% | 0.012000 | 0.005900 | 0.006100 |
| sushiswap | 1 | 1 | 100.0% | 0.049200 | 0.004700 | 0.044500 |
| uniswap-v3 | 1 | 1 | 100.0% | 0.039800 | 0.003100 | 0.036700 |
## Skip Reasons
- below_min_profit: 1

153
reports/unused_files.txt Normal file
View File

@@ -0,0 +1,153 @@
Unused Go packages (not reachable from any main package)
- github.com/fraktal/mev-beta/bindings/contracts [dir: bindings/contracts]
* arbitrageexecutor.go
* baseflashswapper.go
* dexmath.go
* iflashswapper.go
* shared_types.go
* uniswapv2flashswapper.go
* uniswapv3flashswapper.go
- github.com/fraktal/mev-beta/bindings/core [dir: bindings/core]
* iarbitrage.go
* shared_types.go
- github.com/fraktal/mev-beta/internal/secure [dir: internal/secure]
* config_manager.go
- github.com/fraktal/mev-beta/pkg/bindings [dir: pkg/bindings]
* bindings.go
- github.com/fraktal/mev-beta/pkg/execution [dir: pkg/execution]
* queue.go
- github.com/fraktal/mev-beta/pkg/lifecycle [dir: pkg/lifecycle]
* dependency_injection.go
* health_monitor.go
* interfaces.go
* module_registry.go
* shutdown_manager.go
* state_machine.go
- github.com/fraktal/mev-beta/pkg/monitoring [dir: pkg/monitoring]
* dashboard.go
- github.com/fraktal/mev-beta/pkg/orchestrator [dir: pkg/orchestrator]
* coordinator.go
- github.com/fraktal/mev-beta/pkg/patterns [dir: pkg/patterns]
* pipeline.go
- github.com/fraktal/mev-beta/pkg/performance [dir: pkg/performance]
* optimizer.go
* pools.go
- github.com/fraktal/mev-beta/pkg/pricing [dir: pkg/pricing]
* engine.go
- github.com/fraktal/mev-beta/pkg/risk [dir: pkg/risk]
* manager.go
* manager_test.go
* profit_validator.go
- github.com/fraktal/mev-beta/pkg/slippage [dir: pkg/slippage]
* protection.go
- github.com/fraktal/mev-beta/pkg/uniswap/lookup [dir: pkg/uniswap/lookup]
* lookup_bench_test.go
* optimized.go
* tables.go
- github.com/fraktal/mev-beta/test/benchmarks [dir: test/benchmarks]
* pricing_bench_test.go
- github.com/fraktal/mev-beta/test/integration [dir: test/integration]
* corruption_simulation_test.go
- github.com/fraktal/mev-beta/test/mocks [dir: test/mocks]
* arbitrum_mock_test.go
* mock_types.go
- github.com/fraktal/mev-beta/test/testutils [dir: test/testutils]
* testutils.go
- github.com/fraktal/mev-beta/tools/tests [dir: tools/tests]
* ci_agent_bridge_test.go
Directories failing go list (potentially invalid/mixed packages)
- ./test: found packages test (contract_type_validation_test.go) and main (validation_fix_test.go) in /home/administrator/projects/mev-beta/test
- ./test/e2e: package github.com/fraktal/mev-beta/test/e2e: build constraints exclude all Go files in /home/administrator/projects/mev-beta/test/e2e
- ./test/fuzzing: package github.com/fraktal/mev-beta/test/fuzzing: build constraints exclude all Go files in /home/administrator/projects/mev-beta/test/fuzzing
- ./test/production: package github.com/fraktal/mev-beta/test/production: build constraints exclude all Go files in /home/administrator/projects/mev-beta/test/production
- ./test/property: package github.com/fraktal/mev-beta/test/property: build constraints exclude all Go files in /home/administrator/projects/mev-beta/test/property
- ./test/sequencer: package github.com/fraktal/mev-beta/test/sequencer: build constraints exclude all Go files in /home/administrator/projects/mev-beta/test/sequencer
- ./test/stress: package github.com/fraktal/mev-beta/test/stress: build constraints exclude all Go files in /home/administrator/projects/mev-beta/test/stress
- ./test/unit/scanner: package github.com/fraktal/mev-beta/test/unit/scanner: build constraints exclude all Go files in /home/administrator/projects/mev-beta/test/unit/scanner
- ./tests/integration: package github.com/fraktal/mev-beta/tests/integration: build constraints exclude all Go files in /home/administrator/projects/mev-beta/tests/integration
- ./tools/audit-orchestrator: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/audit-orchestrator
- ./tools/audit-orchestrator/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/audit-orchestrator/internal
- ./tools/cicd-audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/cicd-audit
- ./tools/cicd-audit/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/cicd-audit/internal
- ./tools/exchange-audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/exchange-audit
- ./tools/exchange-audit/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/exchange-audit/internal
- ./tools/gas-audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/gas-audit
- ./tools/gas-audit/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/gas-audit/internal
- ./tools/math-audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit
- ./tools/math-audit/cmd: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit/cmd
- ./tools/math-audit/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit/internal
- ./tools/math-audit/internal/audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit/internal/audit
- ./tools/math-audit/internal/checks: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit/internal/checks
- ./tools/math-audit/internal/loader: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit/internal/loader
- ./tools/math-audit/internal/models: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit/internal/models
- ./tools/math-audit/internal/report: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/math-audit/internal/report
- ./tools/opportunity-validator: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/opportunity-validator
- ./tools/opportunity-validator/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/opportunity-validator/internal
- ./tools/performance-audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/performance-audit
- ./tools/performance-audit/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/performance-audit/internal
- ./tools/profitability-audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/profitability-audit
- ./tools/profitability-audit/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/profitability-audit/internal
- ./tools/security-audit: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/security-audit
- ./tools/security-audit/internal: main module (github.com/fraktal/mev-beta) does not contain package github.com/fraktal/mev-beta/tools/security-audit/internal
Heuristic legacy/backup directories (keyword match)
- backup
- backup/logs
- backup/logs/20250917050536
- backup/logs/20250917052923
- backup/old-audits
- backup/old-implementations
- backup/old-misc
- backup/old-misc/git-secrets
- backup/old-misc/git-secrets/.git
- backup/old-misc/git-secrets/.git/hooks
- backup/old-misc/git-secrets/.git/info
- backup/old-misc/git-secrets/.git/logs
- backup/old-misc/git-secrets/.git/logs/refs
- backup/old-misc/git-secrets/.git/logs/refs/heads
- backup/old-misc/git-secrets/.git/logs/refs/remotes
- backup/old-misc/git-secrets/.git/logs/refs/remotes/origin
- backup/old-misc/git-secrets/.git/objects
- backup/old-misc/git-secrets/.git/objects/info
- backup/old-misc/git-secrets/.git/objects/pack
- backup/old-misc/git-secrets/.git/refs
- backup/old-misc/git-secrets/.git/refs/heads
- backup/old-misc/git-secrets/.git/refs/remotes
- backup/old-misc/git-secrets/.git/refs/remotes/origin
- backup/old-misc/git-secrets/.git/refs/tags
- backup/old-misc/git-secrets/.github
- backup/old-misc/git-secrets/.github/workflows
- backup/old-misc/git-secrets/test
- backup/old-misc/git-secrets/test/bats
- backup/old-misc/git-secrets/test/bats/bin
- backup/old-misc/git-secrets/test/bats/libexec
- backup/old-plans
- backup/old-reports
- backups
- backups/20251010_091058
- backups/20251010_091235
- backups/production
- backups/smoke
- pkg/security/backups