feat: add TradeContext, Subcategory and LastAnalyzedAt

This commit is contained in:
Richard
2026-07-05 18:56:18 +02:00
parent 8f6bce23f3
commit c38b4d498f
9 changed files with 1185 additions and 2 deletions
@@ -0,0 +1,29 @@
using Predictalytics.Domain.Enums;
namespace Predictalytics.Domain.Entities;
/// <summary>
/// High-resolution analytics context for a specific trade.
/// Collected asynchronously after a trade is discovered to calculate Slippage and Edge.
/// Only collected for Watchlisted or high-scoring traders to conserve database space.
/// </summary>
public class TradeContext
{
public long Id { get; set; }
/// <summary>The ID of the parent trade.</summary>
public long TradeId { get; set; }
public Trade Trade { get; set; } = null!;
/// <summary>The estimated mid-price of the asset roughly 1 minute before the trade execution.</summary>
public decimal? PriceBefore1m { get; set; }
/// <summary>The estimated mid-price of the asset roughly 1 minute after the trade execution.</summary>
public decimal? PriceAfter1m { get; set; }
/// <summary>Calculated slippage: execution price vs PriceBefore1m.</summary>
public decimal? EstimatedSlippage { get; set; }
/// <summary>Estimated order type based on fee or exact price matching.</summary>
public OrderType EstimatedOrderType { get; set; } = OrderType.Unknown;
}