Fixes for bots running (#22)

* Fixes for bots running

* Up botmanager

* Add cooldown

* Refact can open position

* Add cooldown Period and MaxLossStreak

* Add agentName

* Add env variable for botManager

* Always enable Botmanager

* Fix bot handle

* Fix get positions

* Add Ticker url

* Dont start stopped bot

* fix
This commit is contained in:
Oda
2025-05-09 17:40:31 +02:00
committed by GitHub
parent a8eb0aaf02
commit 7c38c27b4a
54 changed files with 5164 additions and 641 deletions

View File

@@ -115,6 +115,7 @@ public static class ApiBootstrap
services.AddTransient<IBotRepository, BotRepository>();
services.AddTransient<IWorkerRepository, WorkerRepository>();
// Cache
services.AddDistributedMemoryCache();
services.AddTransient<ICacheService, CacheService>();
@@ -135,7 +136,7 @@ public static class ApiBootstrap
services.AddSingleton<IBotService, BotService>();
services.AddSingleton<IWorkerService, WorkerService>();
services.AddTransient<IPrivyService, PrivyService>();
// Web3Proxy Configuration
services.Configure<Web3ProxySettings>(configuration.GetSection("Web3Proxy"));
services.AddTransient<IWeb3ProxyService, Web3ProxyService>();

View File

@@ -14,6 +14,7 @@ using Managing.Application.Scenarios;
using Managing.Application.Shared;
using Managing.Application.Trading;
using Managing.Application.Trading.Commands;
using Managing.Application.Users;
using Managing.Application.Workers;
using Managing.Application.Workers.Abstractions;
using Managing.Domain.Trades;
@@ -52,6 +53,7 @@ public static class WorkersBootstrap
private static IServiceCollection AddApplication(this IServiceCollection services)
{
services.AddSingleton<IUserService, UserService>();
services.AddSingleton<ITradingService, TradingService>();
services.AddSingleton<IBotFactory, BotFactory>();
services.AddSingleton<IScenarioService, ScenarioService>();
@@ -102,6 +104,7 @@ public static class WorkersBootstrap
services.AddTransient<ITradingRepository, TradingRepository>();
services.AddTransient<IBacktestRepository, BacktestRepository>();
services.AddTransient<IBotRepository, BotRepository>();
services.AddTransient<IUserRepository, UserRepository>();
// Cache
services.AddDistributedMemoryCache();