Add normalized size filter and remove obsolete polling config
- Add normalized size filter (usdc_size / √volume) to whale detection, making signal significance comparable across different market sizes - Remove dead polling config (fetch_interval_seconds, tier*_poll_interval) since RTDS WebSocket replaced HTTP polling Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
af5bbd0bce
commit
1bdf56594c
@@ -55,17 +55,13 @@ class Settings(BaseSettings):
|
||||
max_price: float = Field(default=0.90, alias="MAX_PRICE")
|
||||
|
||||
# Monitoring Settings
|
||||
fetch_interval_seconds: int = Field(default=15, alias="FETCH_INTERVAL_SECONDS")
|
||||
trending_markets_limit: int = Field(default=50, alias="TRENDING_MARKETS_LIMIT")
|
||||
|
||||
# Tiered market monitoring (full-coverage mode)
|
||||
# Market coverage (volume thresholds for monitoring list)
|
||||
full_market_scan: bool = Field(default=True, alias="FULL_MARKET_SCAN")
|
||||
tier1_volume_min: float = Field(default=500_000, alias="TIER1_VOLUME_MIN")
|
||||
tier2_volume_min: float = Field(default=10_000, alias="TIER2_VOLUME_MIN")
|
||||
tier3_volume_min: float = Field(default=1_000, alias="TIER3_VOLUME_MIN")
|
||||
tier1_poll_interval: int = Field(default=15, alias="TIER1_POLL_INTERVAL")
|
||||
tier2_poll_interval: int = Field(default=60, alias="TIER2_POLL_INTERVAL")
|
||||
tier3_poll_interval: int = Field(default=300, alias="TIER3_POLL_INTERVAL")
|
||||
|
||||
# LLM Settings
|
||||
llm_model: str = Field(default="gemini-3.1-pro-preview", alias="LLM_MODEL")
|
||||
|
||||
@@ -229,6 +229,7 @@ class TradeMonitor:
|
||||
3. Resolution window — like DTE filter (3-60 days sweet spot)
|
||||
4. Size — like premium filter ($250K+ minimum)
|
||||
5. Dynamic size — like dynamic_premium (base × √(vol / baseline))
|
||||
5.5 Normalized size — like normalized_premium (usdc / √(vol))
|
||||
6. Signal strength — like ask_ratio filter (conviction check)
|
||||
"""
|
||||
# --- 1. Price range ---
|
||||
@@ -268,6 +269,16 @@ class TradeMonitor:
|
||||
if activity.usdc_size < threshold:
|
||||
return False
|
||||
|
||||
# --- 5.5 Normalized size (like normalized_premium) ---
|
||||
# usdc_size / √(volume) makes signals comparable across market sizes.
|
||||
# A $5K trade in a $50K market is far more significant than $20K in a $10M market.
|
||||
if market and market.volume > 0:
|
||||
normalized = activity.usdc_size / math.sqrt(market.volume)
|
||||
# Minimum normalized threshold: filters out trades that are trivial
|
||||
# relative to market size (calibrated: $5K in a $1M market → 5.0)
|
||||
if normalized < 1.5:
|
||||
return False
|
||||
|
||||
# --- 6. Signal strength ---
|
||||
if market and market.outcome_prices:
|
||||
if activity.outcome == "Yes":
|
||||
|
||||
Reference in New Issue
Block a user