- Introduced the `OKXCollector` and `OKXWebSocketClient` classes for real-time market data collection from the OKX exchange. - Implemented a factory pattern for creating exchange-specific collectors, enhancing modularity and scalability. - Added configuration support for the OKX collector in `config/okx_config.json`. - Updated documentation to reflect the new modular architecture and provide guidance on using the OKX collector. - Created unit tests for the OKX collector and exchange factory to ensure functionality and reliability. - Enhanced logging and error handling throughout the new implementation for improved monitoring and debugging.
27 lines
864 B
Python
27 lines
864 B
Python
"""
|
|
Exchange registry for supported exchanges.
|
|
|
|
This module contains the registry of supported exchanges and their capabilities,
|
|
separated to avoid circular import issues.
|
|
"""
|
|
|
|
# Exchange registry for factory pattern
|
|
EXCHANGE_REGISTRY = {
|
|
'okx': {
|
|
'collector': 'data.exchanges.okx.collector.OKXCollector',
|
|
'websocket': 'data.exchanges.okx.websocket.OKXWebSocketClient',
|
|
'name': 'OKX',
|
|
'supported_pairs': ['BTC-USDT', 'ETH-USDT', 'SOL-USDT', 'DOGE-USDT', 'TON-USDT'],
|
|
'supported_data_types': ['trade', 'orderbook', 'ticker', 'candles']
|
|
}
|
|
}
|
|
|
|
|
|
def get_supported_exchanges():
|
|
"""Get list of supported exchange names."""
|
|
return list(EXCHANGE_REGISTRY.keys())
|
|
|
|
|
|
def get_exchange_info(exchange_name: str):
|
|
"""Get information about a specific exchange."""
|
|
return EXCHANGE_REGISTRY.get(exchange_name.lower()) |