Relax whale detection filters to capture more mid-size trades

- Price range: 0.20-0.80 → 0.10-0.90
- Absolute min trade size: $5K → $3K
- Dynamic threshold base: $10K → $5K, range $3K-$50K
- Resolution window: 6h-90d → 3h-180d
- Anomaly score threshold: 0.65 → 0.55

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
SII-leiyu
2026-05-05 11:41:16 +08:00
co-authored by Claude Opus 4.6
parent 3de7cd3373
commit 265c8fb5a1
3 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -51,8 +51,8 @@ class Settings(BaseSettings):
# Whale Detection Settings
min_trade_size_usd: float = Field(default=1000.0, alias="MIN_TRADE_SIZE_USD")
min_price: float = Field(default=0.2, alias="MIN_PRICE")
max_price: float = Field(default=0.8, alias="MAX_PRICE")
min_price: float = Field(default=0.10, alias="MIN_PRICE")
max_price: float = Field(default=0.90, alias="MAX_PRICE")
# Monitoring Settings
fetch_interval_seconds: int = Field(default=15, alias="FETCH_INTERVAL_SECONDS")
+2 -2
View File
@@ -247,7 +247,7 @@ class AnomalyDetector:
market: Optional[Market] = None,
trader_history: Optional[TraderHistory] = None,
market_id: str = "",
min_score: float = 0.65,
min_score: float = 0.55,
) -> Tuple[bool, float, dict]:
"""
Decide whether a whale trade warrants LLM analysis.
@@ -275,7 +275,7 @@ class AnomalyDetector:
def filter_whale_trades(
self,
trades: List[WhaleTrade],
min_score: float = 0.65,
min_score: float = 0.55,
) -> List[WhaleTrade]:
"""Filter whale trades by confidence score."""
filtered = []
+5 -5
View File
@@ -653,26 +653,26 @@ class TradeMonitor:
end_dt = _dt.fromisoformat(market.end_date.replace("Z", "+00:00"))
now_dt = _dt.utcnow().replace(tzinfo=end_dt.tzinfo) if end_dt.tzinfo else _dt.utcnow()
hours_to_resolution = max(0, (end_dt - now_dt).total_seconds() / 3600)
if hours_to_resolution < 6:
if hours_to_resolution < 3:
return False # too close, like DTE < 3
if hours_to_resolution > 90 * 24:
if hours_to_resolution > 180 * 24:
return False # too far, like DTE > 60
except (ValueError, TypeError):
pass # unknown end date, don't reject
# --- 4. Size (like premium min=$250K) ---
# Base minimum: $5,000 (Polymarket scale vs options $250K)
if activity.usdc_size < 5_000:
if activity.usdc_size < 3_000:
return False
# --- 5. Dynamic size (like dynamic_premium = base × √(mcap / baseline)) ---
# Larger markets require proportionally larger trades to be meaningful
base_size = 10_000.0
base_size = 5_000.0
baseline_volume = 1_000_000.0
if market and market.volume > 0:
threshold = base_size * math.sqrt(market.volume / baseline_volume)
threshold = max(5_000.0, min(threshold, 100_000.0)) # floor $5K, cap $100K
threshold = max(3_000.0, min(threshold, 50_000.0)) # floor $3K, cap $50K
else:
threshold = base_size