Commit Graph

161 Commits

Author SHA1 Message Date
bcb00b9a86 Refactor pagination sorting parameters across multiple controllers and services to use the new SortDirection enum; update related API models and TypeScript definitions for consistency. Fix minor documentation and naming inconsistencies in the Bot and Data controllers. 2025-12-14 20:23:26 +07:00
c4e444347c Fix bot update with the tradingtype 2025-12-13 14:46:30 +07:00
87bc2e9dce Enhance PostgreSqlBacktestRepository to include PositionCount in backtest mappings
- Updated the mapping logic in multiple methods to include PositionCount alongside existing fields such as NetPnl, Score, and InitialBalance.
2025-12-12 01:44:34 +07:00
a254db6d24 Update bot market type 2025-12-11 23:32:06 +07:00
Oda
9d536ea49e Refactoring TradingBotBase.cs + clean architecture (#38)
* 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
2025-12-01 19:32:06 +07:00
fef66f6d7b Update configuration settings and logging behavior for SQL monitoring
- 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.
2025-11-24 01:02:53 +07:00
411fc41bef Refactor BotController and BotService for improved bot management
- 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.
2025-11-23 15:30:11 +07:00
9c8ab71736 Do not update the masterBotUserId if update change it to null 2025-11-22 16:32:00 +07:00
2a354bd7d2 Implement profitable bots filtering in BotController and DataController
- 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.
2025-11-22 14:02:29 +07:00
e69dd43ace Enhance DataController and BotService with new configuration and bot name checks
- 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.
2025-11-22 13:34:26 +07:00
269bbfaab0 Add GetBotByUserIdAndNameAsync method to IBotService and BotService
- 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.
2025-11-22 10:46:07 +07:00
55f70add44 Include master bot for all query on Botentity 2025-11-20 14:52:55 +07:00
190a9cf12d Finish copy trading 2025-11-20 14:46:54 +07:00
ff2df2d9ac Add MasterBotUserId and MasterAgentName for copy trading support
- 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.
2025-11-20 00:33:31 +07:00
61f95981a7 Fix position count 2025-11-19 17:58:04 +07:00
096fb500e4 Add position count property map 2025-11-19 14:16:30 +07:00
68e9b2348c Add PositionCount property to Backtest models and responses
- 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.
2025-11-18 22:23:20 +07:00
02e46e8d0d Add paginated user retrieval functionality in AdminController and related services. Implemented UsersFilter for filtering user queries and added LastConnectionDate property to User model. Updated database schema and frontend API to support new user management features. 2025-11-17 20:04:17 +07:00
06ef33b7ab Enhance user authentication by adding optional OwnerWalletAddress parameter in LoginRequest and UserService. Update UserController and related components to support the new wallet address functionality, ensuring better user profile management and validation in trading operations. 2025-11-17 13:48:05 +07:00
0cfc30598b Fix managing with good backtest return 2025-11-14 14:28:13 +07:00
4a8c22e52a Update and fix worker 2025-11-11 03:02:24 +07:00
e8e2ec5a43 Add test for executor 2025-11-11 02:15:57 +07:00
d02a07f86b Fix initial balance on the backtest + n8n webhook 2025-11-10 18:37:44 +07:00
91c766de86 Add admin endpoint to delete bundle backtest requests and implement related UI functionality + Add job resilient 2025-11-10 12:28:07 +07:00
0861e9a8d2 Add admin page for bundle 2025-11-10 11:50:20 +07:00
7e52b7a734 Improve workers for backtests 2025-11-10 01:44:33 +07:00
747bda2700 Update jobs 2025-11-09 04:48:15 +07:00
7e08e63dd1 Add genetic backtest to worker 2025-11-09 03:32:08 +07:00
7dba29c66f Add jobs 2025-11-09 02:08:31 +07:00
f16e4e0d48 fix isAdmin 2025-11-08 02:37:31 +07:00
e0795677e4 Add whitelisting and admin 2025-11-07 23:46:48 +07:00
21110cd771 Add whitelisting service + update the jwt valid audience 2025-11-07 19:38:33 +07:00
5afddb895e Add async for saving backtests 2025-11-05 16:58:46 +07:00
28f2daeb05 Update the keep for influx request 2025-10-28 19:06:33 +07:00
7676a9f1ac Fix influxdb candle fetch 2025-10-28 18:27:56 +07:00
92c28367cf Add Versionning for bundle backtest request 2025-10-23 13:37:53 +07:00
f49f75ede0 Add migrations 2025-10-16 17:19:47 +07:00
472c507801 Add netpnl and initialBalance to backtests 2025-10-16 17:19:22 +07:00
b3f3bccd72 Add delete backtests by filters 2025-10-15 00:28:25 +07:00
48c2d20d70 Add sort by name 2025-10-14 20:03:20 +07:00
e4e9a522bc Fix filter by name for backtest 2025-10-14 19:37:03 +07:00
a462fc9948 Add name to backtest filters 2025-10-14 18:38:27 +07:00
74adad5834 Add filters and sorting for backtests 2025-10-14 18:06:36 +07:00
5acc77650f Add bundle backtest refact + fix whitelist 2025-10-12 14:40:20 +07:00
b6a4c7661f Fix update agent Summary when new balance fetch 2025-10-11 13:10:47 +07:00
652c01b8bb Fix AgentName 2025-10-10 16:08:50 +07:00
b6b11be33a Fix perf with cache 2025-10-10 03:42:57 +07:00
bdda24cb60 Add caches 2025-10-10 03:12:39 +07:00
ba3b0f6232 Add cache for user agent/name 2025-10-10 03:03:41 +07:00
3128e3e9d9 Add cache for position 2025-10-10 02:48:50 +07:00