namespace Managing.Domain.Synth.Models;

/// <summary>
/// Configuration settings for Synth API integration
/// </summary>
public class SynthConfiguration
{
    /// <summary>
    /// Whether to enable Synth API integration
    /// </summary>
    public bool IsEnabled { get; set; } = false;
    
    /// <summary>
    /// Number of top miners to fetch predictions from (default: 10)
    /// </summary>
    public int TopMinersCount { get; set; } = 10;
    
    /// <summary>
    /// Time increment in seconds for predictions (default: 300 = 5 minutes)
    /// </summary>
    public int TimeIncrement { get; set; } = 300;
    
    /// <summary>
    /// Default time length in seconds for predictions (default: 86400 = 24 hours)
    /// </summary>
    public int DefaultTimeLength { get; set; } = 86400;
    
    /// <summary>
    /// Maximum acceptable liquidation probability threshold (0.0 to 1.0)
    /// If liquidation probability exceeds this, position opening may be blocked
    /// </summary>
    public decimal MaxLiquidationProbability { get; set; } = 0.10m; // 10%
    
    /// <summary>
    /// Cache duration for predictions in minutes (default: 5 minutes)
    /// </summary>
    public int PredictionCacheDurationMinutes { get; set; } = 5;
    
    /// <summary>
    /// Whether to use Synth predictions for position sizing adjustments
    /// </summary>
    public bool UseForPositionSizing { get; set; } = true;
    
    /// <summary>
    /// Whether to use Synth predictions for signal filtering
    /// </summary>
    public bool UseForSignalFiltering { get; set; } = true;
    
    /// <summary>
    /// Whether to use Synth predictions for dynamic stop-loss/take-profit adjustments
    /// </summary>
    public bool UseForDynamicStopLoss { get; set; } = true;
    
    /// <summary>
    /// Validates the configuration
    /// </summary>
    public bool IsValid()
    {
        return !IsEnabled || (TopMinersCount > 0 && 
                             TimeIncrement > 0 && 
                             DefaultTimeLength > 0 &&
                             MaxLiquidationProbability >= 0 && MaxLiquidationProbability <= 1);
    }
} 