- Added comments to indicate that BacktestCount is not updated directly in the entity, as it is managed independently via IncrementBacktestCountAsync. This change prevents other update operations from overwriting the BacktestCount, ensuring data integrity.
- Removed the private _currentBalance field and replaced it with direct access to Config.BotTradingBalance.
- Added OnBalanceUpdatedCallback to TradingBotBase for immediate synchronization and database saving when the balance is updated.
- Updated LiveTradingBotGrain to set the callback for balance updates, ensuring accurate state management.
- Modified PostgreSqlBotRepository to save the updated bot trading balance during entity updates.
- Added functionality to update the default LLM provider for users via a new endpoint in UserController.
- Introduced LlmProvider enum to manage available LLM options: Auto, Gemini, OpenAI, and Claude.
- Updated User and UserEntity models to include DefaultLlmProvider property.
- Enhanced database context and migrations to support the new LLM provider configuration.
- Integrated LLM services into the application bootstrap for dependency injection.
- Updated TypeScript API client to include methods for managing LLM providers and chat requests.
- Introduced optional parameters for minimum and maximum BotTradingBalance in BotController, DataController, and related services.
- Updated interfaces and repository methods to support filtering by BotTradingBalance.
- Enhanced TradingBotResponse and BotEntity models to include BotTradingBalance property.
- Adjusted database schema to accommodate new BotTradingBalance field.
- Ensured proper mapping and handling of BotTradingBalance in PostgreSQL repository and mappers.
This commit introduces additional user settings properties, including TrendStrongAgreementThreshold, SignalAgreementThreshold, AllowSignalTrendOverride, and DefaultExchange, to the User entity and associated DTOs. The UserController and UserService are updated to handle these new settings, allowing users to customize their trading configurations more effectively. Database migrations are also included to ensure proper schema updates for the new fields.
Implement a new endpoint in UserController to allow users to update their settings. The UserService is updated to handle the logic for updating user settings, including partial updates for various fields. Additionally, the User entity and database schema are modified to accommodate new user settings properties, ensuring persistence and retrieval of user preferences.
* Refactoring TradingBotBase.cs + clean architecture
* Fix basic tests
* Fix tests
* Fix workers
* Fix open positions
* Fix closing position stucking the grain
* Fix comments
* Refactor candle handling to use IReadOnlyList for chronological order preservation across various components
- Increased thresholds for maximum query and method executions per window to 500 and 250, respectively, to reduce false positives in loop detection.
- Enabled logging of slow queries only, improving performance by reducing log volume.
- Adjusted SQL query logging to capture only warnings and errors, further optimizing logging efficiency.
- Updated various settings across appsettings files to reflect these changes, ensuring consistency in configuration.
- Cleaned up constructor parameters in BotController for better readability.
- Enhanced StartCopyTradingCommand handling with improved formatting.
- Updated bot deletion logic in BotService to delete associated positions and trigger agent summary updates.
- Added new method in TradingService for deleting positions by initiator identifier.
- Implemented error handling in StopBotCommandHandler to ensure agent summary updates do not disrupt bot stop operations.
- Added IConfiguration dependency to BotController for accessing environment variables.
- Updated GetBotsPaginatedAsync method in BotService and IBotService to include a flag for filtering profitable bots.
- Modified DataController to utilize the new filtering option for agent summaries and bot retrieval.
- Enhanced PostgreSqlBotRepository to apply filtering based on profitability when querying bots.
- Added IConfiguration dependency to DataController for environment variable access.
- Updated GetPaginatedAgentSummariesCommand to include a flag for filtering profitable agents.
- Implemented HasUserBotWithNameAsync method in IBotService and BotService to check for existing bots by name.
- Modified StartBotCommandHandler and StartCopyTradingCommandHandler to prevent duplicate bot names during strategy creation.
- Implemented GetBotByUserIdAndNameAsync in IBotService and BotService to retrieve a bot by user ID and name.
- Updated GetUserStrategyCommandHandler to utilize the new method for fetching strategies based on user ID.
- Added corresponding method in IBotRepository and PostgreSqlBotRepository for database access.
- Introduced MasterBotUserId and MasterAgentName properties to facilitate copy trading functionality.
- Updated relevant models, controllers, and database entities to accommodate these new properties.
- Enhanced validation logic in StartCopyTradingCommandHandler to ensure proper ownership checks for master strategies.
- Introduced PositionCount to Backtest, LightBacktest, and their respective response models.
- Updated BacktestController and BacktestExecutor to include PositionCount in responses.
- Modified database schema to accommodate new PositionCount field in relevant entities.