This Pull Request introduces the implementation of the Arbitrage Strategy for the TSE (Trading Strategy Execution) module. The Arbitrage Strategy is designed to take advantage of price differences between different exchanges to generate profit, following the interface defined in strategy.interface.ts. The implementation ensures that the strategy can be started, stopped, and deleted for specific users, aligning with the defined DTOs.
Summary of Changes
ArbitrageStrategy class implementing the Strategy interface.
Create Arbitrage Strategy: Added method to create entity with dto params.
Start Arbitrage Strategy: Added a method to initialize and run the Arbitrage Strategy for a given user, including periodic checks for arbitrage opportunities.
Pause Arbitrage Strategy: Added functionality to pause the strategy for a given user.
Stop Arbitrage Strategy: Implemented a method to stop the ongoing Arbitrage Strategy, including the cancellation of active orders.
Delete Arbitrage Strategy: Added method to soft delete entity.
Arbitrage Logic: Incorporated logic to evaluate arbitrage opportunities based on the Volume Weighted Average Price (VWAP) and profitability thresholds.
Unit Tests: Created unit tests to verify the correct functionality of the strategy lifecycle methods (start, stop, pasue and delete) and the evaluation of arbitrage opportunities.
Description
This Pull Request introduces the implementation of the Arbitrage Strategy for the TSE (Trading Strategy Execution) module. The Arbitrage Strategy is designed to take advantage of price differences between different exchanges to generate profit, following the interface defined in
strategy.interface.ts
. The implementation ensures that the strategy can be started, stopped, and deleted for specific users, aligning with the defined DTOs.Summary of Changes
Strategy
interface.start
,stop
,pasue
anddelete
) and the evaluation of arbitrage opportunities.Related Issues
Fixes #18