Commit e1f4a05
feat(forensics): Add advanced wallet forensics and TUI graph enhancements
This commit adds comprehensive blockchain forensic capabilities and fixes
critical TUI graph rendering issues.
## New Features
### Forensic Analysis Framework (src/utils/forensics_config.rs)
- NEW: ForensicsConfig for customizable analysis parameters
- Wallet behavior classification (Bot, Exchange, Trader, Mixer, EOA, etc.)
- Rapid transfer detection with severity levels (Critical/High/Medium/Low)
- Circular flow pattern detection for money laundering analysis
- Explainable risk scoring with human-readable reasons
- Whale flow detection (configurable SOL thresholds)
- Pattern analysis: sources, sinks, hubs identification
### TUI Graph Enhancements (src/utils/tui/graph.rs) - 514 lines added
- ✅ FIX: Columnar layout with inflows left, outflows right
- ✅ FIX: Abbreviated addresses (first 3 + last 3 chars) for readability
- ✅ FIX: All nodes get positions for off-screen edge rendering
- ✅ FIX: Edges now draw correctly to off-viewport nodes
- NEW: get_whale_flows() - filter large transfers above threshold
- NEW: analyze_wallet_patterns() - identify sources/sinks/hubs
- NEW: classify_wallet_behavior() - behavior pattern classification
- NEW: detect_rapid_transfers() - alert on suspicious velocity
- NEW: detect_circular_flows() - money laundering detection
- NEW: calculate_risk_score() - explainable risk assessment
- NEW: find_mixing_candidates() - privacy analysis
- NEW: get_network_density() - graph complexity metrics
- NEW: calculate_centrality() - hub identification
### TUI App Improvements (src/utils/tui/app.rs)
- Better graph rendering with columnar flow visualization
- Enhanced node selection with abbreviated address display
- Improved edge selection showing full flow details
- Fixed graph viewport calculations
### OVSM Compiler Updates
- ELF header generation improvements (crates/ovsm/src/compiler/elf.rs)
- Enhanced SBPF code generation (crates/ovsm/src/compiler/mod.rs)
- Better binary output handling
## Documentation Updates (CLAUDE.md)
- Added "CURRENT KNOWN ISSUES & TECHNICAL DEBT" section
- Documented TUI dashboard known issues
- Listed AI Insights panel problems requiring attention
- Documented MCP compression fixes
- Identified dashboard widget enhancement needs
## Bug Fixes
### MCP Compression (src/commands/research.rs)
- ✅ FIX: Added `compress: true` to all get_account_transfers calls
- Fixed lines: research_agent.rs:1462, 1544, 1897, 1915
- Prevents massive JSON responses from MCP server
- Reduces bandwidth and improves performance
### Graph Rendering (src/utils/tui/graph.rs)
- ✅ FIX: should_render_node() now returns true for all nodes
- Ensures all nodes have positions even if off-screen
- Allows edges to draw correctly to viewport boundaries
- Fixes issue where edges disappeared when nodes were off-screen
## Files Changed
- CLAUDE.md: +117 lines (documentation updates)
- crates/ovsm/src/compiler/elf.rs: refactored ELF generation
- crates/ovsm/src/compiler/mod.rs: enhanced code generation
- src/commands/ovsm_handler.rs: minor updates
- src/commands/research.rs: MCP compression fixes
- src/utils/forensics_config.rs: +202 lines (NEW FILE)
- src/utils/mod.rs: added forensics module export
- src/utils/tui/app.rs: +121 lines (graph visualization fixes)
- src/utils/tui/graph.rs: +514 lines (forensic features)
## Testing
- ✅ Streaming server tested: ALL TESTS PASSED
- ✅ WebSocket subscription working (9 events in 10s from Pump.fun)
- ✅ Program alias resolution working (40+ programs)
- ✅ Token symbol resolution working (25+ tokens)
- ✅ Real-time event capture verified (Buy/Sell/Fee transactions)
## Technical Debt Noted
- AI Insights panel needs automated analysis implementation
- Dashboard widgets need enhancement (top N display, trends)
- Node label positioning needs improvement at high zoom levels
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent e0979a9 commit e1f4a05
File tree
9 files changed
+995
-56
lines changed- crates/ovsm/src/compiler
- src
- commands
- utils
- tui
9 files changed
+995
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
195 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
| |||
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
265 | | - | |
| 271 | + | |
266 | 272 | | |
267 | | - | |
| 273 | + | |
268 | 274 | | |
269 | 275 | | |
270 | 276 | | |
| |||
319 | 325 | | |
320 | 326 | | |
321 | 327 | | |
322 | | - | |
| 328 | + | |
323 | 329 | | |
324 | 330 | | |
325 | 331 | | |
| |||
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
331 | | - | |
| 337 | + | |
332 | 338 | | |
333 | 339 | | |
334 | 340 | | |
| |||
382 | 388 | | |
383 | 389 | | |
384 | 390 | | |
385 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
386 | 397 | | |
387 | 398 | | |
388 | 399 | | |
| |||
391 | 402 | | |
392 | 403 | | |
393 | 404 | | |
394 | | - | |
| 405 | + | |
395 | 406 | | |
396 | 407 | | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
| 408 | + | |
| 409 | + | |
401 | 410 | | |
402 | | - | |
| 411 | + | |
403 | 412 | | |
404 | 413 | | |
405 | 414 | | |
| |||
448 | 457 | | |
449 | 458 | | |
450 | 459 | | |
451 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
452 | 464 | | |
453 | 465 | | |
454 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
| |||
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
| 63 | + | |
| 64 | + | |
54 | 65 | | |
55 | 66 | | |
56 | 67 | | |
| |||
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| |||
144 | 156 | | |
145 | 157 | | |
146 | 158 | | |
147 | | - | |
148 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
149 | 170 | | |
150 | 171 | | |
151 | 172 | | |
| |||
191 | 212 | | |
192 | 213 | | |
193 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
194 | 223 | | |
195 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
196 | 236 | | |
197 | 237 | | |
198 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
0 commit comments