Commit Graph

78 Commits

Author SHA1 Message Date
5e7b2b34d4 Refactor ETH balance and gas fee checks in SpotBot
- Updated balance checks to utilize user-defined thresholds for minimum trading and swap balances, enhancing flexibility.
- Improved gas fee validation by incorporating user settings, allowing for more personalized transaction management.
- Enhanced logging to provide clearer messages regarding balance sufficiency and gas fee limits, improving user feedback during operations.
2026-01-06 00:43:51 +07:00
645bbe6d95 Enhance SpotBot slippage handling and logging
- Increased slippage tolerance from 0.6% to 0.7% to account for gas reserves.
- Improved logging to provide detailed information when adjusting position quantities due to slippage or when retaining original quantities.
- Updated CloseSpotPositionCommandHandler to use the position's opened quantity instead of the entire wallet balance, ensuring gas fees are preserved.
- Adjusted Web3ProxyService settings for retry attempts and operation timeouts to improve performance.
- Enhanced swap token implementation to handle native tokens correctly and increased operation timeout for better reliability.
2026-01-05 22:13:18 +07:00
21d87efeee Refactor user settings management to remove IsGmxEnabled and DefaultExchange from updatable fields, introducing GmxSlippage instead. Update UserController, UserService, and related DTOs to reflect these changes, ensuring proper handling of user settings. Adjust database schema and migrations to accommodate the new GmxSlippage property, enhancing user customization options for trading configurations. 2025-12-30 07:19:08 +07:00
ee8db1cdc8 Enhance SpotBot to improve position recovery logic and add token balance verification after closing positions. The changes include filtering for recent unfinished positions and logging detailed information during position closure, ensuring better tracking and error handling for token balances. 2025-12-29 16:39:02 +07:00
31886aeaf3 Refactor signal generation in TradingService to implement a rolling window approach, allowing for incremental processing of candles. This change enhances signal capture across the entire date range and prevents duplicate signals by tracking seen identifiers. 2025-12-28 21:22:45 +07:00
8a7addafd7 Refactor signal generation in TradingService to process indicators individually, improving clarity and performance. Add new API types for refining indicators, including request and response structures. 2025-12-28 20:59:11 +07:00
4f3ec31501 Add endpoint for indicator refiner 2025-12-28 20:38:38 +07:00
4fda65e3c2 Enhance error handling in TradingService by capturing exceptions with Sentry; update TypeScript version in package.json for improved features; modify tsconfig.json to exclude unnecessary directories; add new performance benchmark entries in CSV files for better tracking of telemetry data. 2025-12-20 15:53:16 +07:00
1426f0b560 Clean code, remove warning for future and spot 2025-12-11 14:36:35 +07:00
292a48d108 Fix close position 2025-12-11 12:23:01 +07:00
8ff9437400 Fix a bit the spot trading 2025-12-10 23:16:46 +07:00
5bd03259da Add BacktestSpotBot and update BacktestExecutor for spot trading support
- Introduced BacktestSpotBot class to handle backtesting for spot trading scenarios.
- Updated BacktestExecutor to support both BacktestFutures and BacktestSpot trading types.
- Enhanced error handling to provide clearer messages for unsupported trading types.
- Registered new command handlers for OpenSpotPositionRequest and CloseSpotPositionCommand in ApiBootstrap.
- Added unit tests for executing backtests with spot trading configurations, ensuring correct behavior and metrics validation.
2025-12-01 23:41:23 +07:00
3771bb5dde Refactor SwapGmxTokens functionality into TradingService
- Moved SwapGmxTokensAsync method from AccountService to TradingService to centralize trading operations.
- Updated AccountController and AgentGrain to utilize the new TradingService method for swapping GMX tokens.
- Removed the old SwapGmxTokensAsync method from IAccountService and its implementation in AccountService.
2025-12-01 22:49:30 +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
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
460a7bd559 Fix realized pnl on backtest save + add tests (not all passing) 2025-11-14 02:38:15 +07:00
3b176c290c Update precalculated indicators values 2025-11-12 23:26:12 +07:00
1792cd2371 Fix backtest consistency 2025-11-11 12:15:12 +07:00
14d101b63e Add benchmark for backtest on the test 2025-11-11 11:23:30 +07:00
51a227e27e Improve perf for backtests 2025-11-10 02:15:43 +07:00
6ffe9ae9c4 Add error handling for GMX positions 2025-10-21 17:56:09 +07:00
d6122aeb27 Fix backtests and indicators 2025-10-16 20:06:47 +07:00
661f91f537 Remove decimal when using balance 2025-10-16 02:38:29 +07:00
04df72a6bd Fix .First Position update + add more details when position rejected 2025-10-11 12:27:54 +07:00
117d45fb50 Do not stop bot if position open 2025-10-11 00:32:02 +07:00
e4fa4c6595 Add High network fees error message 2025-10-10 22:40:44 +07:00
a3d6dd1238 Remove warning for backtest when signal is expired 2025-10-10 01:35:10 +07:00
de48e758cf Fix build 2025-10-06 01:38:02 +07:00
16a56bd26c Add agent fees 2025-09-28 20:57:42 +07:00
a8d09c36b7 Update agent stats 2025-09-28 13:55:24 +07:00
d432549d26 Clean and update event 2025-09-27 22:20:12 +07:00
6d91c75ec2 Fix position gas fee 2025-09-26 17:16:41 +07:00
bcfeb693ce Update account/position and platform summary 2025-09-26 01:18:59 +07:00
b2e38811ed Fix global PNL 2025-09-25 23:23:53 +07:00
40f3c66694 Add ETH and USDC balance check before start/restart bot and autoswap 2025-09-23 14:03:46 +07:00
d13ac9fd21 fix backtest below 10usdc + update trade 2025-09-22 23:56:45 +07:00
8afe80ca0e Improve Platform stats 2025-09-21 16:50:06 +07:00
Oda
cee3902a4d Update SDK (#35)
* Update SDK for swap

* Fix web3proxy build

* Update types

* Fix swap

* Send token test and BASE transfer

* fix cache and hook

* Fix send

* Update health check with uiFeereceiver

* Fix sdk

* Fix get positions

* Fix timeoutloop

* Fix open position

* Fix closes positions

* Review
2025-09-17 14:28:56 +07:00
Oda
56b4f14eb3 Price reminder and init approval
* Start price reminder grain

* Add config and init grain at startup

* Save init wallet when already init
2025-09-13 02:29:14 +07:00
2e4c18ff63 change minimum to trade 2025-08-27 05:19:12 +07:00
0aafab82b3 Fix decimal in amount to trade 2025-08-16 19:18:23 +07:00
955c358138 Improve per on price update
Some checks failed
Build & Deploy / build-and-deploy (push) Has been cancelled
.NET / build (push) Has been cancelled
2025-08-16 17:02:31 +07:00
d2975be0f5 Merge workers into API 2025-08-16 04:55:33 +07:00
8eefab4597 Fix concurrent on userStrategies 2025-08-15 08:56:32 +07:00
b4a4656b3b Update the position count and initiator 2025-08-15 08:47:48 +07:00
e6c3ec139a Add event 2025-08-15 01:23:39 +07:00
2622da05e6 Update open interest 2025-08-14 23:53:45 +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
3d3f71ac7a Move workers 2025-08-05 17:53:19 +07:00