using System.Text.Json.Serialization;

namespace Managing.Infrastructure.Evm.Models;

public class TradaoUserDetails
{
    [JsonPropertyName("gmxv2_42161")] public Gmxv242161 gmxv2_42161 { get; set; }
}

public class Summary
{
    [JsonPropertyName("pnl")] public decimal pnl { get; set; }

    [JsonPropertyName("roi")] public decimal roi { get; set; }

    [JsonPropertyName("winRate")] public decimal winRate { get; set; }

    [JsonPropertyName("trades")] public int trades { get; set; }

    [JsonPropertyName("winTrades")] public int winTrades { get; set; }

    [JsonPropertyName("lossTrades")] public int lossTrades { get; set; }

    [JsonPropertyName("averageWin")] public decimal averageWin { get; set; }

    [JsonPropertyName("averageLoss")] public decimal averageLoss { get; set; }

    [JsonPropertyName("fee")] public decimal fee { get; set; }

    [JsonPropertyName("tradingVolume")] public decimal tradingVolume { get; set; }

    [JsonPropertyName("lastTradeTime")] public int lastTradeTime { get; set; }

    [JsonPropertyName("maxIncreaseTimes")] public int maxIncreaseTimes { get; set; }
}

// GMX v1
public class Gmx42161
{
    [JsonPropertyName("updatetime")] public int updatetime { get; set; }

    [JsonPropertyName("summary")] public Summary summary { get; set; }

    [JsonPropertyName("preference")] public List<object> preference { get; set; }

    [JsonPropertyName("records")] public List<Record> records { get; set; }
}

public class Gmx43114
{
    [JsonPropertyName("updatetime")] public int updatetime { get; set; }

    [JsonPropertyName("summary")] public Summary summary { get; set; }

    [JsonPropertyName("preference")] public List<object> preference { get; set; }

    [JsonPropertyName("records")] public List<object> records { get; set; }
}

public class Gmxv242161
{
    [JsonPropertyName("updatetime")] public int updatetime { get; set; }

    [JsonPropertyName("summary")] public Summary summary { get; set; }

    [JsonPropertyName("preference")] public List<Preference> preference { get; set; }

    [JsonPropertyName("records")] public List<Record> records { get; set; }
    [JsonPropertyName("prices")] public Dictionary<string, string> prices { get; set; }
}

public class Record
{
    [JsonPropertyName("indexToken")] public string indexToken { get; set; }

    [JsonPropertyName("collateralToken")] public string collateralToken { get; set; }

    [JsonPropertyName("isLong")] public bool isLong { get; set; }

    [JsonPropertyName("isOpen")] public bool isOpen { get; set; }

    [JsonPropertyName("positionId")] public string positionId { get; set; }

    [JsonPropertyName("records")] public List<RecordDetail> records { get; set; }

    [JsonPropertyName("averagePrice")] public string averagePrice { get; set; }

    [JsonPropertyName("liqPrice")] public string liqPrice { get; set; }

    [JsonPropertyName("borrowFee")] public string borrowFee { get; set; }

    [JsonPropertyName("closeFee")] public string closeFee { get; set; }

    [JsonPropertyName("fundingFee")] public string fundingFee { get; set; }
}

public class RecordDetail
{
    [JsonPropertyName("timestamp")] public int timestamp { get; set; }

    [JsonPropertyName("indexToken")] public string indexToken { get; set; }

    [JsonPropertyName("collateralToken")] public string collateralToken { get; set; }

    [JsonPropertyName("isLong")] public bool isLong { get; set; }

    [JsonPropertyName("sizeDelta")] public double sizeDelta { get; set; }

    [JsonPropertyName("collateralDelta")] public double collateralDelta { get; set; }

    [JsonPropertyName("price")] public double price { get; set; }

    [JsonPropertyName("fee")] public double fee { get; set; }

    [JsonPropertyName("isLiquidation")] public bool isLiquidation { get; set; }

    [JsonPropertyName("eventType")] public int eventType { get; set; }

    [JsonPropertyName("pnlDelta")] public double pnlDelta { get; set; }

    [JsonPropertyName("averagePrice")] public double averagePrice { get; set; }

    [JsonPropertyName("positionId")] public string positionId { get; set; }

    [JsonPropertyName("status")] public string status { get; set; }

    [JsonPropertyName("blocknum")] public int blocknum { get; set; }

    [JsonPropertyName("transactionIndex")] public int transactionIndex { get; set; }
}

public class Gmxv243114
{
    [JsonPropertyName("updatetime")] public int updatetime { get; set; }

    [JsonPropertyName("summary")] public Summary summary { get; set; }

    [JsonPropertyName("preference")] public List<object> preference { get; set; }

    [JsonPropertyName("records")] public List<object> records { get; set; }
}

public class Kwenta10
{
    [JsonPropertyName("updatetime")] public int updatetime { get; set; }

    [JsonPropertyName("summary")] public Summary summary { get; set; }

    [JsonPropertyName("preference")] public List<object> preference { get; set; }

    [JsonPropertyName("records")] public List<object> records { get; set; }
}

public class Polynomial10
{
    [JsonPropertyName("updatetime")] public int updatetime { get; set; }

    [JsonPropertyName("summary")] public Summary summary { get; set; }

    [JsonPropertyName("preference")] public List<object> preference { get; set; }

    [JsonPropertyName("records")] public List<object> records { get; set; }
}

public class Preference
{
    [JsonPropertyName("tokenAddress")] public string tokenAddress { get; set; }

    [JsonPropertyName("winTrades")] public int winTrades { get; set; }

    [JsonPropertyName("lossTrades")] public int lossTrades { get; set; }

    [JsonPropertyName("pnl")] public double pnl { get; set; }
}