How erfaniaa/crypto-portfolio-optimizer works
Project’s Main Components
• Entry Point: main.py, which coordinates and initiates the portfolio simulation process.
• Configuration Module: config.py, holding simulation and optimization parameters (e.g., candidate coins, date interval, wallet size, weights precision).
• Optimization Engine: crypto_portfolio_optimizer.py, which likely contains the brute-force (backtracking) algorithm to explore different allocations.
• Simulation Component: wallet_simulator.py, which is in charge of simulating the portfolio performance over the backtested period.
• Metrics Analysis: metrics.py, responsible for computing and evaluating key performance measures like drawdowns.
• External Dependencies: requirements.txt outlines the Python libraries, and the project may rely on external data sources not explicitly shown here (but implied in the simulation of historical coin data).
Relationships and Interactions
• main.py serves as the application’s entry point. It reads configuration values from config.py and initiates the simulation.
• From main.py, the optimization engine (in crypto_portfolio_optimizer.py) is called to generate a range of potential portfolio allocations.
• The wallet_simulator.py then uses these allocation strategies to simulate the investment portfolio’s performance over a given historical period.
• After simulation, metrics.py is called to analyze the performance (especially focusing on drawdown calculations).
Architectural Patterns and Design Principles
• Modular Design: Each file represents a distinct module with clearly separated responsibilities (configuration, optimization, simulation, and metrics).
• Single Entry Point: The “main.py” centralizes execution, which simplifies the integration of various modules.
• Data Flow Driven by Configuration: The config.py file abstracts key simulation parameters, ensuring that the system can be easily tuned without modifying business logic.
• Emphasis on Simulation and Backtesting: The design reflects a focus on processing historical data to simulate and optimize portfolio performance.
Relevant Technologies and Frameworks
• Python (as the primary programming language)
• Standard libraries and potential dependencies (as indicated by requirements.txt) for numerical analysis, data handling, or even plotting (if used for visualization in the simulation results).