全面完成代理
This commit is contained in:
@@ -14,6 +14,7 @@ import base64
|
||||
from typing import Optional, Dict
|
||||
import trader as trader_module
|
||||
from position_tracker import PositionTracker
|
||||
from proxy_util import get_session_proxies, patch_websocket_if_needed
|
||||
|
||||
|
||||
class DataFeed:
|
||||
@@ -102,9 +103,12 @@ class DataFeed:
|
||||
self.threads.append(pm_thread)
|
||||
print(f"[DATA] Started Polymarket feed for {coin.upper()}")
|
||||
|
||||
# ❌ USER CHANNEL DISABLED - WebSocket auth doesn't work
|
||||
# Using REST API takingAmount/makingAmount instead!
|
||||
print(f"[DATA] ℹ️ Position tracking via REST API responses")
|
||||
# ✅ USER CHANNEL ENABLED - WebSocket for position tracking
|
||||
patch_websocket_if_needed()
|
||||
user_thread = threading.Thread(target=self._user_channel_worker, daemon=True)
|
||||
user_thread.start()
|
||||
self.threads.append(user_thread)
|
||||
print(f"[DATA] ✅ User Channel WebSocket started")
|
||||
|
||||
# Start local timer update (fixes timer freeze)
|
||||
timer_thread = threading.Thread(target=self._timer_worker, daemon=True)
|
||||
@@ -179,7 +183,7 @@ class DataFeed:
|
||||
|
||||
# Use events API with specific slug
|
||||
url = f"{gamma_api}/events?slug={slug}"
|
||||
resp = requests.get(url, timeout=10)
|
||||
resp = requests.get(url, timeout=10, proxies=get_session_proxies())
|
||||
resp.raise_for_status()
|
||||
|
||||
events = resp.json()
|
||||
|
||||
Reference in New Issue
Block a user