BOM WORKING!!!!

This commit is contained in:
Dobromir Popov
2025-06-18 17:50:24 +03:00
parent 3cadae60f7
commit 7fbe3119cf
3 changed files with 607 additions and 488 deletions

View File

@ -120,8 +120,8 @@ class MultiExchangeCOBProvider:
self.consolidation_frequency = 100 # ms
# REST API configuration for deep order book
self.rest_api_frequency = 5000 # ms - full snapshot every 5 seconds
self.rest_depth_limit = 1000 # Get up to 1000 levels via REST
self.rest_api_frequency = 1000 # ms - full snapshot every 1 second
self.rest_depth_limit = 500 # Increased from 100 to 500 levels via REST for maximum depth
# Exchange configurations
self.exchange_configs = self._initialize_exchange_configs()
@ -158,7 +158,7 @@ class MultiExchangeCOBProvider:
self.session_trades: Dict[str, List[Dict]] = {symbol: [] for symbol in self.symbols}
self.svp_cache: Dict[str, Dict] = {symbol: {} for symbol in self.symbols}
# Fixed USD bucket sizes for different symbols
# Fixed USD bucket sizes for different symbols as requested
self.fixed_usd_buckets = {
'BTC/USDT': 10.0, # $10 buckets for BTC
'ETH/USDT': 1.0, # $1 buckets for ETH
@ -870,12 +870,12 @@ class MultiExchangeCOBProvider:
# Generate fine-grain price buckets
price_buckets = self._generate_price_buckets(symbol, sorted_bids, sorted_asks, volume_weighted_mid)
# Create consolidated snapshot
# Create consolidated snapshot with more levels for dashboard
cob_snapshot = COBSnapshot(
symbol=symbol,
timestamp=timestamp,
consolidated_bids=sorted_bids[:50], # Top 50 levels
consolidated_asks=sorted_asks[:50],
consolidated_bids=sorted_bids[:100], # Top 100 levels for better dashboard display
consolidated_asks=sorted_asks[:100],
exchanges_active=active_exchanges,
volume_weighted_mid=volume_weighted_mid,
total_bid_liquidity=total_bid_liquidity,