wip training and inference stats

This commit is contained in:
Dobromir Popov
2025-07-27 19:20:23 +03:00
parent 2a21878ed5
commit 87c0dc8ac4
8 changed files with 833 additions and 84 deletions

View File

@ -1125,7 +1125,7 @@ class MultiExchangeCOBProvider:
)
# Store consolidated order book
self.consolidated_order_books[symbol] = cob_snapshot
self.current_order_book[symbol] = cob_snapshot
self.realtime_snapshots[symbol].append(cob_snapshot)
# Update real-time statistics
@ -1294,8 +1294,8 @@ class MultiExchangeCOBProvider:
while self.is_streaming:
try:
for symbol in self.symbols:
if symbol in self.consolidated_order_books:
cob = self.consolidated_order_books[symbol]
if symbol in self.current_order_book:
cob = self.current_order_book[symbol]
# Notify bucket update callbacks
for callback in self.bucket_update_callbacks:
@ -1327,22 +1327,22 @@ class MultiExchangeCOBProvider:
def get_consolidated_orderbook(self, symbol: str) -> Optional[COBSnapshot]:
"""Get current consolidated order book snapshot"""
return self.consolidated_order_books.get(symbol)
return self.current_order_book.get(symbol)
def get_price_buckets(self, symbol: str, bucket_count: int = 100) -> Optional[Dict]:
"""Get fine-grain price buckets for a symbol"""
if symbol not in self.consolidated_order_books:
if symbol not in self.current_order_book:
return None
cob = self.consolidated_order_books[symbol]
cob = self.current_order_book[symbol]
return cob.price_buckets
def get_exchange_breakdown(self, symbol: str) -> Optional[Dict]:
"""Get breakdown of liquidity by exchange"""
if symbol not in self.consolidated_order_books:
if symbol not in self.current_order_book:
return None
cob = self.consolidated_order_books[symbol]
cob = self.current_order_book[symbol]
breakdown = {}
for exchange in cob.exchanges_active:
@ -1386,10 +1386,10 @@ class MultiExchangeCOBProvider:
def get_market_depth_analysis(self, symbol: str, depth_levels: int = 20) -> Optional[Dict]:
"""Get detailed market depth analysis"""
if symbol not in self.consolidated_order_books:
if symbol not in self.current_order_book:
return None
cob = self.consolidated_order_books[symbol]
cob = self.current_order_book[symbol]
# Analyze depth distribution
bid_levels = cob.consolidated_bids[:depth_levels]