* 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
This commit is contained in:
Oda
2025-07-30 11:03:30 +02:00
committed by GitHub
parent d281d7cd02
commit 3de8b5e00e
59 changed files with 2626 additions and 677 deletions

View File

@@ -0,0 +1,104 @@
using Managing.Domain.Bots;
using Managing.Domain.Trades;
using Orleans;
using static Managing.Common.Enums;
namespace Managing.Application.Abstractions.Models;
/// <summary>
/// Response model for trading bot data.
/// Used to return comprehensive bot information via Orleans grains.
/// </summary>
[GenerateSerializer]
public class TradingBotResponse
{
/// <summary>
/// Bot identifier
/// </summary>
[Id(0)]
public string Identifier { get; set; } = string.Empty;
/// <summary>
/// Bot display name
/// </summary>
[Id(1)]
public string Name { get; set; } = string.Empty;
/// <summary>
/// Current bot status
/// </summary>
[Id(2)]
public BotStatus Status { get; set; }
/// <summary>
/// Bot configuration
/// </summary>
[Id(3)]
public TradingBotConfig Config { get; set; }
/// <summary>
/// Trading positions
/// </summary>
[Id(4)]
public List<Position> Positions { get; set; } = new();
/// <summary>
/// Trading signals
/// </summary>
[Id(5)]
public List<LightSignal> Signals { get; set; } = new();
/// <summary>
/// Wallet balance history
/// </summary>
[Id(6)]
public Dictionary<DateTime, decimal> WalletBalances { get; set; } = new();
/// <summary>
/// Current profit and loss
/// </summary>
[Id(7)]
public decimal ProfitAndLoss { get; set; }
/// <summary>
/// Win rate percentage
/// </summary>
[Id(8)]
public int WinRate { get; set; }
/// <summary>
/// Execution count
/// </summary>
[Id(9)]
public long ExecutionCount { get; set; }
/// <summary>
/// Startup time
/// </summary>
[Id(10)]
public DateTime StartupTime { get; set; }
/// <summary>
/// Creation date
/// </summary>
[Id(11)]
public DateTime CreateDate { get; set; }
/// <summary>
/// Current balance
/// </summary>
[Id(12)]
public decimal CurrentBalance { get; set; }
/// <summary>
/// Number of active positions
/// </summary>
[Id(13)]
public int ActivePositionsCount { get; set; }
/// <summary>
/// Last execution time
/// </summary>
[Id(14)]
public DateTime LastExecution { get; set; }
}