- Introduced a new transformation module that includes safety limits for trade operations, enhancing data integrity and preventing errors. - Refactored existing transformation logic into dedicated classes and functions, improving modularity and maintainability. - Added detailed validation for trade sizes, prices, and symbol formats, ensuring compliance with trading rules. - Implemented logging for significant operations and validation checks, aiding in monitoring and debugging. - Created a changelog to document the new features and changes, providing clarity for future development. - Developed extensive unit tests to cover the new functionality, ensuring reliability and preventing regressions. These changes significantly enhance the architecture of the transformation module, making it more robust and easier to manage.
67 lines
1.5 KiB
Python
67 lines
1.5 KiB
Python
"""
|
|
Common utilities and data structures for the application.
|
|
|
|
This package provides shared functionality across different components
|
|
of the system, including data transformation, validation, and aggregation.
|
|
"""
|
|
|
|
from .data_types import (
|
|
StandardizedTrade,
|
|
OHLCVCandle,
|
|
MarketDataPoint,
|
|
DataValidationResult,
|
|
CandleProcessingConfig
|
|
)
|
|
|
|
from .transformation.trade import (
|
|
TradeTransformer,
|
|
create_standardized_trade,
|
|
batch_create_standardized_trades
|
|
)
|
|
|
|
from .transformation.base import BaseDataTransformer
|
|
from .transformation.unified import UnifiedDataTransformer
|
|
|
|
from .transformation.safety import (
|
|
TradeLimits,
|
|
DEFAULT_LIMITS,
|
|
STABLECOIN_LIMITS,
|
|
VOLATILE_LIMITS,
|
|
validate_trade_size,
|
|
validate_trade_price,
|
|
validate_symbol_format
|
|
)
|
|
|
|
from .validation import (
|
|
BaseDataValidator,
|
|
ValidationResult
|
|
)
|
|
|
|
__all__ = [
|
|
# Data types
|
|
'StandardizedTrade',
|
|
'OHLCVCandle',
|
|
'MarketDataPoint',
|
|
'DataValidationResult',
|
|
'CandleProcessingConfig',
|
|
|
|
# Trade transformation
|
|
'TradeTransformer',
|
|
'create_standardized_trade',
|
|
'batch_create_standardized_trades',
|
|
'BaseDataTransformer',
|
|
'UnifiedDataTransformer',
|
|
|
|
# Safety limits and validation
|
|
'TradeLimits',
|
|
'DEFAULT_LIMITS',
|
|
'STABLECOIN_LIMITS',
|
|
'VOLATILE_LIMITS',
|
|
'validate_trade_size',
|
|
'validate_trade_price',
|
|
'validate_symbol_format',
|
|
|
|
# Validation
|
|
'BaseDataValidator',
|
|
'ValidationResult',
|
|
] |