This project is a trading bot that allows users to automate trades, manage positions, and place complex orders through a simple interface. The bot integrates with multiple services to gather real-time price data, trigger alerts, execute trades, and notify users about important events.
The project is built following the Domain-Driven Design (DDD) paradigm, which helps structure the application into distinct domains, each responsible for a specific business functionality.
The bot is designed to work seamlessly with external price aggregators and brokers, enabling the user to automate trading strategies. The core services involved in the system include:
- Pricing Service: Fetches real-time price data.
- Alert Service: Triggers alerts based on predefined price conditions (entry, stop-loss, take-profit).
- Strategy Service: Defines and executes trading strategies based on price data and alerts.
- Trade Execution Service: Executes trades through the broker's API.
- Notification Service: Sends user notifications based on alerts and trade executions.
For a detailed explanation of the architecture and how the services interact, please refer to the architecture document and the architecture diagram.
The project follows an event-driven architecture, where each service listens to and publishes events to coordinate tasks such as price updates, alert triggers, trade execution, and user notifications. The overall design is influenced by the principles of Domain-Driven Design (DDD), with clear boundaries between the different domains (e.g., pricing, alerting, trade execution).
If you haven't installed the dependencies yet, run the following command:
npm installTo start the project, you can use the run_project.sh script located in the /scripts folder. This will launch all necessary services for the trading bot to work.
cd /scripts
./run_project.shThis will initialize the bot and start fetching price data, managing alerts, executing trades, and sending notifications.
npx jestTo stop the project, simply run the stop_project.sh script, which is also located in the /scripts folder.
cd /scripts
./stop_project.shThis will gracefully stop all the services involved in the bot.
This project is licensed under the MIT License - see the LICENSE file for details.