Commit Graph

92 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
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
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
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
fb570b9f7e Fix key conditions 2025-11-19 23:25:57 +07:00
0ee190786e Prevent user to open multiple strategy on the same ticker 2025-11-18 13:58:50 +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
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
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
49b0f7b696 Fix restart with no accountName 2025-10-12 16:28:53 +07:00
ff74296c26 Fix restart/start if not account with the first account of the user 2025-10-12 16:08:12 +07:00
d71d47f644 Add reason when stopping bot 2025-10-10 23:31:32 +07:00
76b087a6e4 Fix status and filtered positions for metrics 2025-10-08 18:37:38 +07:00
86dd6849ea Fix status IsFinished/IsOpen/IsForMetrics + use redis for markets on gmx.tsx instead of inmemory cache 2025-10-08 12:13:04 +07:00
67065469a6 Fix config update + remove messages + Summary fix for not open position 2025-10-08 02:52:11 +07:00
ff7e4ed3d3 un-stopped bot return status "stopped" instead of the error 2025-10-07 16:10:14 +07:00
85000644a6 Add ROI to botPaginated 2025-10-06 23:54:59 +07:00
347c78afc7 Update messaging 2025-10-06 01:34:13 +07:00
dab4807334 Fix Runtime 2025-10-06 00:55:18 +07:00
1b060fb145 Fix update strategy name into db 2025-10-05 21:31:42 +07:00
4aad20b30b Fix status bot allocation start/restart 2025-10-05 02:21:44 +07:00
cad70799b5 Allocation only for running bot 2025-10-05 02:07:20 +07:00
3581607375 Fix Usdc.Value to amount 2025-10-05 01:53:50 +07:00
de0d042254 Use usdc balance instead usdc value for ensuring balance check 2025-10-05 01:36:25 +07:00
63683d6bdf Fix allocated amount when no bot 2025-10-05 01:00:47 +07:00
6928770da7 Block user to create strategy with over allocation 2025-10-03 16:14:24 +07:00
7c13ad5f06 Update Agent balance tracking 2025-10-03 15:30:39 +07:00
f041c1e8e8 Add net Pnl in db 2025-09-28 22:18:58 +07:00
16a56bd26c Add agent fees 2025-09-28 20:57:42 +07:00
bcfeb693ce Update account/position and platform summary 2025-09-26 01:18:59 +07:00
c297429b18 Fix bot TOP 3 2025-09-25 11:08:28 +07:00
40f3c66694 Add ETH and USDC balance check before start/restart bot and autoswap 2025-09-23 14:03:46 +07:00
d2dbee9a5f Fix unsubscribe + reduce bot update db query 2025-09-15 00:42:24 +07:00
b0d2dcc6b9 Reduce Agent Summary call 2025-09-15 00:19:21 +07:00
0a2b7aa335 fix concurrent 2025-08-14 18:11:22 +07:00
6a2e4e81b1 Update status to match UI 2025-08-14 18:08:31 +07:00
e4049045c3 Fix concurrency 2025-08-14 17:49:05 +07:00
aacb92018f Update cache for userStrategy details 2025-08-14 17:42:07 +07:00
93a6f9fd9e Stop all bot for a user 2025-08-06 16:03:42 +07:00
36529ae403 Fix db and fix endpoints 2025-08-05 22:30:18 +07:00
2dcbcc3ef2 Clear a bit more 2025-08-05 19:34:42 +07:00
843239d187 Fix mediator 2025-08-05 17:31:10 +07:00
6c63b80f4a Fix get online agentnames 2025-08-05 05:09:50 +07:00
Oda
082ae8714b Trading bot grain (#33)
* Trading bot Grain

* Fix a bit more of the trading bot

* Advance on the tradingbot grain

* Fix build

* Fix db script

* Fix user login

* Fix a bit backtest

* Fix cooldown and backtest

* start fixing bot start

* Fix startup

* Setup local db

* Fix build and update candles and scenario

* Add bot registry

* Add reminder

* Updateing the grains

* fix bootstraping

* Save stats on tick

* Save bot data every tick

* Fix serialization

* fix save bot stats

* Fix get candles

* use dict instead of list for position

* Switch hashset to dict

* Fix a bit

* Fix bot launch and bot view

* add migrations

* Remove the tolist

* Add agent grain

* Save agent summary

* clean

* Add save bot

* Update get bots

* Add get bots

* Fix stop/restart

* fix Update config

* Update scanner table on new backtest saved

* Fix backtestRowDetails.tsx

* Fix agentIndex

* Update agentIndex

* Fix more things

* Update user cache

* Fix

* Fix account load/start/restart/run
2025-08-05 04:07:06 +07:00
6cd28a4edb Return only online agent name 2025-07-31 15:55:03 +07:00
c454e87d7a Add new endpoint for the agent status 2025-07-30 22:36:49 +07:00
Oda
3de8b5e00e Orlean (#32)
* Start building with orlean

* Add missing file

* Serialize grain state

* Remove grain and proxies

* update and add plan

* Update a bit

* Fix backtest grain

* Fix backtest grain

* Clean a bit
2025-07-30 16:03:30 +07:00