Commit Graph

1083 Commits

Author SHA1 Message Date
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
476bcebfe9 Fix active strategy count on plateform surmmary 2025-11-21 20:02:33 +07:00
153e170ca4 Refactor LiveBotRegistryGrain and PlatformSummaryGrain to improve active bot tracking
- Introduced CalculateActiveBotsCount method in LiveBotRegistryGrain to streamline active bot count calculations.
- Updated logging to reflect active bot counts accurately during registration and unregistration.
- Added historical tracking of strategy activation/deactivation events in PlatformSummaryGrain, including a new StrategyEvent class and related logic to manage event history.
- Enhanced CalculateActiveStrategiesForDate method to compute active strategies based on historical events.
2025-11-21 19:38:32 +07:00
eac13dd5e4 Enhance bot command handlers with GMX wallet initialization
- Updated RestartBotCommandHandler, StartBotCommandHandler, and StartCopyTradingCommandHandler to include ITradingService for GMX wallet initialization.
- Added checks for GMX account initialization status and implemented wallet initialization logic where necessary.
- Improved error handling for wallet initialization failures.
2025-11-21 19:05:51 +07:00
53f81302ba Return last 24 volume for strategies 2025-11-21 17:02:18 +07:00
1bec83a2ec Add MasterAgentName to UserStrategyDetailsViewModel and DataController
- Updated UserStrategyDetailsViewModel to include MasterAgentName property, which represents the agent name of the master bot's owner for copy trading bots.
- Modified DataController to populate the MasterAgentName field when returning strategy details.
2025-11-21 14:28:19 +07:00
d3623350da Save bundle backtest 2025-11-20 23:25:43 +07:00
aa8a723aad Dont display indicators use on copied strategy 2025-11-20 22:14:44 +07:00
4d4e5b6d25 Update position value calculations in AgentGrain and BotService
- Changed the calculation of USDC value in AgentGrain to use net profit and loss instead of realized profit.
- Added similar position value calculations in BotService, including error handling for position retrieval failures.
2025-11-20 20:34:12 +07:00
a6adf5e458 Fix test with new ROI and collateral calcul 2025-11-20 20:04:20 +07:00
b1aa0541e2 Add test and max collateral used 2025-11-20 15:38:27 +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
97103fbfe8 Add master strategy validation in LiveTradingBotGrain
- Introduced a check to ensure the master strategy is retrieved successfully before proceeding with key validation.
- Added logging for cases where the master strategy is not found, improving traceability in the bot's operation.
2025-11-19 23:39:38 +07:00
fb570b9f7e Fix key conditions 2025-11-19 23:25:57 +07:00
b7796ede0c Add logging for owned keys in KaigenService
- Enhanced logging to include the count of owned keys fetched for a user.
- Added detailed logging for each owned key's agent name.
2025-11-19 23:18:56 +07:00
799b27b0a8 Remove credit have to be enable for owned keys 2025-11-19 21:12:25 +07:00
c7adb687b8 Fix recovery positions 2025-11-19 21:06:02 +07:00
e1f2f75c23 Fix redundant recover position call 2025-11-19 20:42:11 +07:00
f56d75d28f Fix loop when trying to recover the cancelled position 2025-11-19 20:23:44 +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
9b25201def Remove SSL for kaigen API url 2025-11-19 09:08:58 +07:00
6db2b34f9f Update influxdb api key 2025-11-19 09:01:53 +07:00
3236edd2bb Add Kaigen API health check and configuration
- Introduced Kaigen configuration section in appsettings.Oda.json with BaseUrl.
- Added HTTP client for Kaigen API health check in Program.cs.
- Registered KaigenHealthCheck service for monitoring Kaigen API connectivity.
2025-11-19 00:59:49 +07:00
030a6b0eba Fix bot running signal 2025-11-18 23:02:38 +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
0ee190786e Prevent user to open multiple strategy on the same ticker 2025-11-18 13:58:50 +07:00
87712038ff Update configs 2025-11-18 11:23:21 +07:00
6341d712ef Update Config local to remote name 2025-11-18 11:00:01 +07:00
9855a6c6ed Update configs 2025-11-18 10:57:46 +07:00
52c11e30c4 Refactor TradingBotBase to manage current balance more effectively. Introduced _currentBalance field to track balance updates during trading operations. Updated wallet balance logic to utilize _currentBalance for consistency. Added new entries to performance benchmark CSV files for recent test runs. 2025-11-17 23:53:53 +07:00
091f617e37 Update configuration files for production, sandbox, and local environments. Changed Kaigen BaseUrl and database connection strings to point to new server addresses. Adjusted CORS allowed origins and authentication valid audiences for improved security and functionality. 2025-11-17 22:59:15 +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
8697f1598d Add validation for Kudai strategy staking requirements in StartCopyTradingCommandHandler. Implemented methods in IEvmManager to retrieve staked KUDAI balance and GBC NFT count. Enhanced error handling for staking checks. 2025-11-17 12:57:47 +07:00
4b24a934ad Update ExchangeRouter address 2025-11-17 11:12:59 +07:00
c229212acd Add copy trading authorization checks in LiveTradingBotGrain and StartCopyTradingCommandHandler. Integrated IKaigenService to verify user ownership of master strategy keys before allowing copy trading. Enhanced error handling and logging for authorization verification. 2025-11-16 22:11:54 +07:00
2baa2e173c Add localhost authorize for production 2025-11-16 18:27:19 +07:00
ec88b124e6 Refactor LiveTradingBotGrain to close all open positions before stopping the bot. Introduced CloseAllOpenPositionsAsync method to handle position closure and logging, ensuring a smoother stop process. Removed the previous check for open positions in the database. 2025-11-16 18:22:48 +07:00
1e15d5f23b Add copy trading functionality with StartCopyTrading endpoint and related models. Implemented position copying from master bot and subscription to copy trading stream in LiveTradingBotGrain. Updated TradingBotConfig to support copy trading parameters. 2025-11-16 14:54:17 +07:00
428e36d744 Add todo for backtest performance 2025-11-15 20:53:08 +07:00
49a693b44a Remove orderBy to improve perfs 2025-11-15 14:17:21 +07:00
bed25e7222 Optimize backtest memory usage by implementing a rolling window for candle storage and update performance benchmarks with new test data. 2025-11-15 13:54:39 +07:00
e814eb749c Update MessengerService to reflect initial balance and net PnL in messages 2025-11-15 13:44:50 +07:00
6d661f459e Remove candle from backtest return + fix message when good backtest 2025-11-14 20:49:02 +07:00
b4005a2d1e Add telemetry for update signal and run bot 2025-11-14 20:22:01 +07:00
ac1707c439 Add test for RSI Divergence 2025-11-14 20:02:51 +07:00