feat: implement SniperDetector with DBSCAN clustering (#16)

Add sniper cluster detection system that identifies wallets exhibiting
coordinated "sniper" behavior - consistently entering markets within
minutes of their creation.

Key features:
- SniperDetector class using DBSCAN clustering algorithm
- Tracks wallet entries across markets with timing analysis
- Feature vector: market hash, entry delta, log position size
- Identifies clusters of wallets with similar timing patterns
- Generates SniperClusterSignal for detected cluster members
- Configurable entry threshold (default 5 minutes), cluster size, DBSCAN params
- Confidence scoring based on cluster size, entry speed, market overlap

Also adds:
- SniperClusterSignal model to detector/models.py
- scikit-learn and numpy dependencies for ML clustering
- 27 comprehensive tests covering clustering logic and edge cases

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Patrick Selamy
2026-01-04 16:59:53 -05:00
co-authored by Claude Opus 4.5
parent c100bbfdfb
commit 96e471882a
6 changed files with 1343 additions and 0 deletions
+2
View File
@@ -16,6 +16,8 @@ dependencies = [
"websockets>=12.0",
"prometheus-client>=0.19.0",
"aiohttp>=3.9.0",
"scikit-learn>=1.3.0",
"numpy>=1.24.0",
]
[project.optional-dependencies]