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.
This commit is contained in:
@@ -448,7 +448,7 @@ public class AgentGrain : Grain, IAgentGrain
|
||||
var user = await _userService.GetUserByIdAsync(userId);
|
||||
|
||||
// Perform the swap
|
||||
var swapInfo = await _accountService.SwapGmxTokensAsync(user, accountName,
|
||||
var swapInfo = await _tradingService.SwapGmxTokensAsync(user, accountName,
|
||||
Ticker.USDC, Ticker.ETH, Constants.GMX.Config.AutoSwapAmount);
|
||||
|
||||
if (swapInfo.Success)
|
||||
|
||||
Reference in New Issue
Block a user