fix broken merge
This commit is contained in:
@@ -344,6 +344,12 @@ class DashboardComponentManager:
|
||||
asks = cob_snapshot.get('asks', []) or []
|
||||
elif hasattr(cob_snapshot, 'stats'):
|
||||
# Old format with stats attribute
|
||||
stats = getattr(cob_snapshot, 'stats', None)
|
||||
mid_price = float(getattr(stats, 'mid_price', 0) or 0)
|
||||
spread_bps = float(getattr(stats, 'spread_bps', 0) or 0)
|
||||
imbalance = float(getattr(stats, 'imbalance', 0) or 0)
|
||||
bids = getattr(cob_snapshot, 'bids', []) or []
|
||||
asks = getattr(cob_snapshot, 'asks', []) or []
|
||||
else:
|
||||
# New object-like snapshot with direct attributes
|
||||
mid_price = float(getattr(cob_snapshot, 'volume_weighted_mid', 0) or 0)
|
||||
|
||||
Reference in New Issue
Block a user