This commit is contained in:
Dobromir Popov
2025-08-04 17:40:30 +03:00
parent de77b0afa8
commit 8ee9b7a90c
7 changed files with 1468 additions and 14 deletions

View File

@ -51,9 +51,7 @@ class ExchangeConfig:
@dataclass
class AggregationConfig:
"""Data aggregation configuration"""
btc_bucket_size: float = float(os.getenv('BTC_BUCKET_SIZE', '10.0')) # $10 USD buckets
eth_bucket_size: float = float(os.getenv('ETH_BUCKET_SIZE', '1.0')) # $1 USD buckets
default_bucket_size: float = float(os.getenv('DEFAULT_BUCKET_SIZE', '1.0'))
bucket_size: float = float(os.getenv('BUCKET_SIZE', '1.0')) # $1 USD buckets for all symbols
heatmap_depth: int = int(os.getenv('HEATMAP_DEPTH', '50')) # Number of price levels
update_frequency: float = float(os.getenv('UPDATE_FREQUENCY', '0.5')) # Seconds
volume_threshold: float = float(os.getenv('VOLUME_THRESHOLD', '0.01')) # Minimum volume
@ -119,15 +117,9 @@ class Config:
if self.aggregation.eth_bucket_size <= 0:
raise ValueError("ETH bucket size must be positive")
def get_bucket_size(self, symbol: str) -> float:
"""Get bucket size for a specific symbol"""
symbol_upper = symbol.upper()
if 'BTC' in symbol_upper:
return self.aggregation.btc_bucket_size
elif 'ETH' in symbol_upper:
return self.aggregation.eth_bucket_size
else:
return self.aggregation.default_bucket_size
def get_bucket_size(self, symbol: str = None) -> float:
"""Get bucket size (now universal $1 for all symbols)"""
return self.aggregation.bucket_size
def get_database_url(self) -> str:
"""Get database connection URL"""
@ -158,8 +150,7 @@ class Config:
'symbols': self.exchanges.symbols,
},
'aggregation': {
'btc_bucket_size': self.aggregation.btc_bucket_size,
'eth_bucket_size': self.aggregation.eth_bucket_size,
'bucket_size': self.aggregation.bucket_size,
'heatmap_depth': self.aggregation.heatmap_depth,
},
'api': {