//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v14.3.0.0 (NJsonSchema v11.2.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

/* tslint:disable */
/* eslint-disable */
// ReSharper disable InconsistentNaming



export interface Account {
    name: string;
    exchange: TradingExchanges;
    type: AccountType;
    key?: string | null;
    secret?: string | null;
    user?: User | null;
    balances?: Balance[] | null;
    isPrivyWallet?: boolean;
}

export enum TradingExchanges {
    Binance = "Binance",
    Kraken = "Kraken",
    Ftx = "Ftx",
    Evm = "Evm",
    GmxV2 = "GmxV2",
}

export enum AccountType {
    Cex = "Cex",
    Trader = "Trader",
    Watch = "Watch",
    Auth = "Auth",
    Privy = "Privy",
}

export interface User {
    id?: number;
    name?: string | null;
    accounts?: Account[] | null;
    agentName?: string | null;
    avatarUrl?: string | null;
    telegramChannel?: string | null;
}

export interface Balance {
    tokenImage?: string | null;
    tokenName?: string | null;
    amount?: number;
    price?: number;
    value?: number;
    tokenAdress?: string | null;
    chain?: Chain | null;
}

export interface Chain {
    id?: string | null;
    rpcUrl?: string | null;
    name?: string | null;
    chainId?: number;
}

export interface GmxClaimableSummary {
    claimableFundingFees?: FundingFeesData | null;
    claimableUiFees?: UiFeesData | null;
    rebateStats?: RebateStatsData | null;
}

export interface FundingFeesData {
    totalUsdc?: number;
}

export interface UiFeesData {
    totalUsdc?: number;
}

export interface RebateStatsData {
    totalRebateUsdc?: number;
    discountUsdc?: number;
    rebateFactor?: number;
    discountFactor?: number;
}

export interface SwapInfos {
    success?: boolean;
    hash?: string | null;
    message?: string | null;
    error?: string | null;
    errorType?: string | null;
    suggestion?: string | null;
}

export interface SwapTokensRequest {
    fromTicker: Ticker;
    toTicker: Ticker;
    amount: number;
    orderType?: string | null;
    triggerRatio?: number | null;
    allowedSlippage?: number;
}

export enum Ticker {
    AAVE = "AAVE",
    ADA = "ADA",
    APE = "APE",
    ALGO = "ALGO",
    ARB = "ARB",
    ATOM = "ATOM",
    AVAX = "AVAX",
    BNB = "BNB",
    BTC = "BTC",
    BAL = "BAL",
    CHZ = "CHZ",
    COMP = "COMP",
    CRO = "CRO",
    CRV = "CRV",
    DOGE = "DOGE",
    DOT = "DOT",
    DYDX = "DYDX",
    ENS = "ENS",
    ETC = "ETC",
    ETH = "ETH",
    FIL = "FIL",
    FLM = "FLM",
    FTM = "FTM",
    GALA = "GALA",
    GMX = "GMX",
    GRT = "GRT",
    IMX = "IMX",
    JASMY = "JASMY",
    KSM = "KSM",
    LDO = "LDO",
    LINK = "LINK",
    LRC = "LRC",
    LTC = "LTC",
    MANA = "MANA",
    MATIC = "MATIC",
    MKR = "MKR",
    NEAR = "NEAR",
    OP = "OP",
    PEPE = "PEPE",
    QTUM = "QTUM",
    REN = "REN",
    ROSE = "ROSE",
    RSR = "RSR",
    RUNE = "RUNE",
    SAND = "SAND",
    SOL = "SOL",
    SRM = "SRM",
    SUSHI = "SUSHI",
    THETA = "THETA",
    UNI = "UNI",
    USDC = "USDC",
    USDT = "USDT",
    WIF = "WIF",
    XMR = "XMR",
    XRP = "XRP",
    XTZ = "XTZ",
    SHIB = "SHIB",
    STX = "STX",
    ORDI = "ORDI",
    APT = "APT",
    BOME = "BOME",
    MEME = "MEME",
    FLOKI = "FLOKI",
    MEW = "MEW",
    TAO = "TAO",
    BONK = "BONK",
    WLD = "WLD",
    TBTC = "tBTC",
    WBTC_b = "WBTC_b",
    EIGEN = "EIGEN",
    SUI = "SUI",
    SEI = "SEI",
    USDC_e = "USDC_e",
    DAI = "DAI",
    TIA = "TIA",
    TRX = "TRX",
    TON = "TON",
    PENDLE = "PENDLE",
    WstETH = "wstETH",
    USDe = "USDe",
    SATS = "SATS",
    POL = "POL",
    XLM = "XLM",
    BCH = "BCH",
    ICP = "ICP",
    RENDER = "RENDER",
    INJ = "INJ",
    TRUMP = "TRUMP",
    MELANIA = "MELANIA",
    ENA = "ENA",
    FARTCOIN = "FARTCOIN",
    AI16Z = "AI16Z",
    ANIME = "ANIME",
    BERA = "BERA",
    VIRTUAL = "VIRTUAL",
    PENGU = "PENGU",
    ONDO = "ONDO",
    FET = "FET",
    AIXBT = "AIXBT",
    CAKE = "CAKE",
    S = "S",
    JUP = "JUP",
    HYPE = "HYPE",
    OM = "OM",
    DOLO = "DOLO",
    Unknown = "Unknown",
}

export interface SendTokenRequest {
    recipientAddress: string;
    ticker: Ticker;
    amount: number;
    chainId?: number | null;
}

export interface Backtest {
    id: string;
    finalPnl: number;
    winRate: number;
    growthPercentage: number;
    hodlPercentage: number;
    config: TradingBotConfig;
    positions: { [key: string]: Position; };
    signals: { [key: string]: LightSignal; };
    candles: Candle[];
    startDate: Date;
    endDate: Date;
    statistics: PerformanceMetrics;
    fees: number;
    walletBalances: KeyValuePairOfDateTimeAndDecimal[];
    user: User;
    score: number;
    requestId?: string;
    metadata?: any | null;
    scoreMessage?: string;
}

export interface TradingBotConfig {
    accountName: string;
    moneyManagement: LightMoneyManagement;
    ticker: Ticker;
    timeframe: Timeframe;
    isForWatchingOnly: boolean;
    botTradingBalance: number;
    isForBacktest: boolean;
    cooldownPeriod: number;
    maxLossStreak: number;
    flipPosition: boolean;
    name: string;
    riskManagement?: RiskManagement | null;
    scenario?: LightScenario | null;
    scenarioName?: string | null;
    maxPositionTimeHours?: number | null;
    closeEarlyWhenProfitable?: boolean;
    flipOnlyWhenInProfit: boolean;
    useSynthApi?: boolean;
    useForPositionSizing?: boolean;
    useForSignalFiltering?: boolean;
    useForDynamicStopLoss?: boolean;
}

export interface LightMoneyManagement {
    name: string;
    timeframe: Timeframe;
    stopLoss: number;
    takeProfit: number;
    leverage: number;
}

export enum Timeframe {
    FiveMinutes = "FiveMinutes",
    FifteenMinutes = "FifteenMinutes",
    ThirtyMinutes = "ThirtyMinutes",
    OneHour = "OneHour",
    FourHour = "FourHour",
    OneDay = "OneDay",
    OneMinute = "OneMinute",
}

export interface RiskManagement {
    adverseProbabilityThreshold: number;
    favorableProbabilityThreshold: number;
    riskAversion: number;
    kellyMinimumThreshold: number;
    kellyMaximumCap: number;
    maxLiquidationProbability: number;
    signalValidationTimeHorizonHours: number;
    positionMonitoringTimeHorizonHours: number;
    positionWarningThreshold: number;
    positionAutoCloseThreshold: number;
    kellyFractionalMultiplier: number;
    riskTolerance: RiskToleranceLevel;
    useExpectedUtility: boolean;
    useKellyCriterion: boolean;
}

export enum RiskToleranceLevel {
    Conservative = "Conservative",
    Moderate = "Moderate",
    Aggressive = "Aggressive",
}

export interface LightScenario {
    name?: string | null;
    indicators?: LightIndicator[] | null;
    loopbackPeriod?: number | null;
}

export interface LightIndicator {
    name?: string | null;
    type?: IndicatorType;
    signalType?: SignalType;
    minimumHistory?: number;
    period?: number | null;
    fastPeriods?: number | null;
    slowPeriods?: number | null;
    signalPeriods?: number | null;
    multiplier?: number | null;
    smoothPeriods?: number | null;
    stochPeriods?: number | null;
    cyclePeriods?: number | null;
}

export enum IndicatorType {
    RsiDivergence = "RsiDivergence",
    RsiDivergenceConfirm = "RsiDivergenceConfirm",
    MacdCross = "MacdCross",
    EmaCross = "EmaCross",
    ThreeWhiteSoldiers = "ThreeWhiteSoldiers",
    SuperTrend = "SuperTrend",
    ChandelierExit = "ChandelierExit",
    EmaTrend = "EmaTrend",
    Composite = "Composite",
    StochRsiTrend = "StochRsiTrend",
    Stc = "Stc",
    StDev = "StDev",
    LaggingStc = "LaggingStc",
    SuperTrendCrossEma = "SuperTrendCrossEma",
    DualEmaCross = "DualEmaCross",
}

export enum SignalType {
    Signal = "Signal",
    Trend = "Trend",
    Context = "Context",
}

export interface Position {
    accountName: string;
    date: Date;
    originDirection: TradeDirection;
    ticker: Ticker;
    moneyManagement: LightMoneyManagement;
    Open: Trade;
    StopLoss: Trade;
    TakeProfit1: Trade;
    TakeProfit2?: Trade | null;
    ProfitAndLoss?: ProfitAndLoss | null;
    status: PositionStatus;
    signalIdentifier?: string | null;
    identifier: string;
    initiator: PositionInitiator;
    user: User;
    initiatorIdentifier: string;
}

export enum TradeDirection {
    None = "None",
    Short = "Short",
    Long = "Long",
}

export interface Trade {
    fee: number;
    date: Date;
    direction: TradeDirection;
    status: TradeStatus;
    tradeType: TradeType;
    ticker: Ticker;
    quantity: number;
    price: number;
    leverage: number;
    exchangeOrderId: string;
    message: string;
}

export enum TradeStatus {
    PendingOpen = "PendingOpen",
    Requested = "Requested",
    Cancelled = "Cancelled",
    Filled = "Filled",
}

export enum TradeType {
    Limit = "Limit",
    Market = "Market",
    StopMarket = "StopMarket",
    StopLimit = "StopLimit",
    StopLoss = "StopLoss",
    TakeProfit = "TakeProfit",
    StopLossProfit = "StopLossProfit",
    StopLossProfitLimit = "StopLossProfitLimit",
    StopLossLimit = "StopLossLimit",
    TakeProfitLimit = "TakeProfitLimit",
    TrailingStop = "TrailingStop",
    TrailingStopLimit = "TrailingStopLimit",
    StopLossAndLimit = "StopLossAndLimit",
    SettlePosition = "SettlePosition",
}

export interface ProfitAndLoss {
    realized?: number;
    net?: number;
    averageOpenPrice?: number;
}

export enum PositionStatus {
    New = "New",
    Canceled = "Canceled",
    Rejected = "Rejected",
    Updating = "Updating",
    PartiallyFilled = "PartiallyFilled",
    Filled = "Filled",
    Flipped = "Flipped",
    Finished = "Finished",
}

export enum PositionInitiator {
    PaperTrading = "PaperTrading",
    Bot = "Bot",
    User = "User",
    CopyTrading = "CopyTrading",
}

export interface LightSignal {
    status: SignalStatus;
    direction: TradeDirection;
    confidence: Confidence;
    timeframe: Timeframe;
    date: Date;
    candle: Candle;
    identifier: string;
    ticker: Ticker;
    exchange: TradingExchanges;
    indicatorType: IndicatorType;
    signalType: SignalType;
    indicatorName: string;
}

export enum SignalStatus {
    WaitingForPosition = "WaitingForPosition",
    PositionOpen = "PositionOpen",
    Expired = "Expired",
}

export enum Confidence {
    Low = "Low",
    Medium = "Medium",
    High = "High",
    None = "None",
}

export interface Candle {
    exchange: TradingExchanges;
    ticker: string;
    openTime: Date;
    date: Date;
    open: number;
    close: number;
    high: number;
    low: number;
    timeframe: Timeframe;
    volume?: number;
}

export interface PerformanceMetrics {
    count?: number;
    sharpeRatio?: number;
    maxDrawdown?: number;
    maxDrawdownPc?: number;
    maxDrawdownRecoveryTime?: string;
    winningTrades?: number;
    loosingTrades?: number;
    totalPnL?: number;
}

export interface KeyValuePairOfDateTimeAndDecimal {
    key?: Date;
    value?: number;
}

export interface DeleteBacktestsRequest {
    backtestIds: string[];
}

export interface PaginatedBacktestsResponse {
    backtests?: LightBacktestResponse[] | null;
    totalCount?: number;
    currentPage?: number;
    pageSize?: number;
    totalPages?: number;
    hasNextPage?: boolean;
    hasPreviousPage?: boolean;
}

export interface LightBacktestResponse {
    id: string;
    config: TradingBotConfig;
    finalPnl: number;
    winRate: number;
    growthPercentage: number;
    hodlPercentage: number;
    startDate: Date;
    endDate: Date;
    maxDrawdown: number;
    fees: number;
    sharpeRatio: number;
    score: number;
    scoreMessage: string;
}

export interface LightBacktest {
    id?: string | null;
    config?: TradingBotConfig | null;
    finalPnl?: number;
    winRate?: number;
    growthPercentage?: number;
    hodlPercentage?: number;
    startDate?: Date;
    endDate?: Date;
    maxDrawdown?: number | null;
    fees?: number;
    sharpeRatio?: number | null;
    score?: number;
    scoreMessage?: string | null;
}

export interface RunBacktestRequest {
    config?: TradingBotConfigRequest | null;
    startDate?: Date;
    endDate?: Date;
    save?: boolean;
    withCandles?: boolean;
}

export interface TradingBotConfigRequest {
    accountName: string;
    ticker: Ticker;
    timeframe: Timeframe;
    isForWatchingOnly: boolean;
    botTradingBalance: number;
    name: string;
    flipPosition: boolean;
    cooldownPeriod: number;
    maxLossStreak: number;
    scenario?: ScenarioRequest | null;
    scenarioName?: string | null;
    moneyManagementName?: string | null;
    moneyManagement?: MoneyManagementRequest | null;
    maxPositionTimeHours?: number | null;
    closeEarlyWhenProfitable?: boolean;
    flipOnlyWhenInProfit?: boolean;
    useSynthApi?: boolean;
    useForPositionSizing?: boolean;
    useForSignalFiltering?: boolean;
    useForDynamicStopLoss?: boolean;
}

export interface ScenarioRequest {
    name: string;
    indicators: IndicatorRequest[];
    loopbackPeriod?: number | null;
}

export interface IndicatorRequest {
    name: string;
    type: IndicatorType;
    signalType: SignalType;
    minimumHistory?: number;
    period?: number | null;
    fastPeriods?: number | null;
    slowPeriods?: number | null;
    signalPeriods?: number | null;
    multiplier?: number | null;
    smoothPeriods?: number | null;
    stochPeriods?: number | null;
    cyclePeriods?: number | null;
}

export interface MoneyManagementRequest {
    name: string;
    timeframe: Timeframe;
    stopLoss: number;
    takeProfit: number;
    leverage: number;
}

export interface BundleBacktestRequest {
    requestId: string;
    user: User;
    createdAt: Date;
    completedAt?: Date | null;
    status: BundleBacktestRequestStatus;
    name: string;
    backtestRequestsJson: string;
    results?: string[] | null;
    totalBacktests: number;
    completedBacktests: number;
    failedBacktests: number;
    progressPercentage?: number;
    errorMessage?: string | null;
    progressInfo?: string | null;
    currentBacktest?: string | null;
    estimatedTimeRemainingSeconds?: number | null;
}

export enum BundleBacktestRequestStatus {
    Pending = "Pending",
    Running = "Running",
    Completed = "Completed",
    Failed = "Failed",
    Cancelled = "Cancelled",
}

export interface RunBundleBacktestRequest {
    name: string;
    requests: RunBacktestRequest[];
}

export interface GeneticRequest {
    requestId: string;
    user: User;
    createdAt: Date;
    completedAt?: Date | null;
    status: GeneticRequestStatus;
    ticker: Ticker;
    timeframe: Timeframe;
    startDate: Date;
    endDate: Date;
    balance: number;
    populationSize: number;
    generations: number;
    mutationRate: number;
    selectionMethod: GeneticSelectionMethod;
    crossoverMethod: GeneticCrossoverMethod;
    mutationMethod: GeneticMutationMethod;
    elitismPercentage: number;
    maxTakeProfit: number;
    eligibleIndicators: IndicatorType[];
    results?: Backtest[] | null;
    bestFitness?: number | null;
    bestIndividual?: string | null;
    errorMessage?: string | null;
    progressInfo?: string | null;
    bestChromosome?: string | null;
    currentGeneration?: number;
    bestFitnessSoFar?: number | null;
}

export enum GeneticRequestStatus {
    Pending = "Pending",
    Running = "Running",
    Completed = "Completed",
    Failed = "Failed",
    Cancelled = "Cancelled",
}

export enum GeneticSelectionMethod {
    Elite = "Elite",
    Roulette = "Roulette",
    StochasticUniversalSampling = "StochasticUniversalSampling",
    Tournament = "Tournament",
    Truncation = "Truncation",
}

export enum GeneticCrossoverMethod {
    AlternatingPosition = "AlternatingPosition",
    CutAndSplice = "CutAndSplice",
    Cycle = "Cycle",
    OnePoint = "OnePoint",
    OrderBased = "OrderBased",
    Ordered = "Ordered",
    PartiallyMapped = "PartiallyMapped",
    PositionBased = "PositionBased",
    ThreeParent = "ThreeParent",
    TwoPoint = "TwoPoint",
    Uniform = "Uniform",
    VotingRecombination = "VotingRecombination",
}

export enum GeneticMutationMethod {
    Displacement = "Displacement",
    FlipBit = "FlipBit",
    Insertion = "Insertion",
    PartialShuffle = "PartialShuffle",
    ReverseSequence = "ReverseSequence",
    Twors = "Twors",
    Uniform = "Uniform",
}

export interface RunGeneticRequest {
    ticker?: Ticker;
    timeframe?: Timeframe;
    startDate?: Date;
    endDate?: Date;
    balance?: number;
    populationSize?: number;
    generations?: number;
    mutationRate?: number;
    selectionMethod?: GeneticSelectionMethod;
    crossoverMethod?: GeneticCrossoverMethod;
    mutationMethod?: GeneticMutationMethod;
    elitismPercentage?: number;
    maxTakeProfit?: number;
    eligibleIndicators?: IndicatorType[] | null;
}

export interface MoneyManagement extends LightMoneyManagement {
    user?: User | null;
}

export interface StartBotRequest {
    config?: TradingBotConfigRequest | null;
}

export interface SaveBotRequest extends StartBotRequest {
}

export enum BotStatus {
    Saved = "Saved",
    Stopped = "Stopped",
    Running = "Running",
}

export interface TradingBotResponse {
    status: string;
    signals: { [key: string]: LightSignal; };
    positions: { [key: string]: Position; };
    candles: Candle[];
    winRate: number;
    profitAndLoss: number;
    identifier: string;
    agentName: string;
    createDate: Date;
    startupTime: Date;
    name: string;
    ticker: Ticker;
}

export interface PaginatedResponseOfTradingBotResponse {
    items?: TradingBotResponse[] | null;
    totalCount?: number;
    pageNumber?: number;
    pageSize?: number;
    totalPages?: number;
    hasPreviousPage?: boolean;
    hasNextPage?: boolean;
}

export interface OpenPositionManuallyRequest {
    identifier?: string;
    direction?: TradeDirection;
}

export interface ClosePositionRequest {
    identifier?: string;
    positionId?: string;
}

export interface UpdateBotConfigRequest {
    identifier: string;
    config: TradingBotConfigRequest;
    moneyManagementName?: string | null;
    moneyManagement?: MoneyManagement | null;
}

export interface TickerInfos {
    ticker?: Ticker;
    imageUrl?: string | null;
}

export interface SpotlightOverview {
    spotlights: Spotlight[];
    dateTime: Date;
    identifier?: string;
    scenarioCount?: number;
}

export interface Spotlight {
    scenario: Scenario;
    tickerSignals: TickerSignal[];
}

export interface Scenario {
    name?: string | null;
    indicators?: IndicatorBase[] | null;
    loopbackPeriod?: number | null;
    user?: User | null;
}

export interface IndicatorBase {
    name?: string | null;
    type?: IndicatorType;
    signalType?: SignalType;
    minimumHistory?: number;
    period?: number | null;
    fastPeriods?: number | null;
    slowPeriods?: number | null;
    signalPeriods?: number | null;
    multiplier?: number | null;
    smoothPeriods?: number | null;
    stochPeriods?: number | null;
    cyclePeriods?: number | null;
    user?: User | null;
}

export interface TickerSignal {
    ticker: Ticker;
    fiveMinutes: LightSignal[];
    fifteenMinutes: LightSignal[];
    oneHour: LightSignal[];
    fourHour: LightSignal[];
    oneDay: LightSignal[];
}

export interface CandlesWithIndicatorsResponse {
    candles?: Candle[] | null;
    indicatorsValues?: { [key in keyof typeof IndicatorType]?: IndicatorsResultBase; } | null;
}

export interface IndicatorsResultBase {
    ema?: EmaResult[] | null;
    fastEma?: EmaResult[] | null;
    slowEma?: EmaResult[] | null;
    macd?: MacdResult[] | null;
    rsi?: RsiResult[] | null;
    stoch?: StochResult[] | null;
    stochRsi?: StochRsiResult[] | null;
    bollingerBands?: BollingerBandsResult[] | null;
    chandelierShort?: ChandelierResult[] | null;
    stc?: StcResult[] | null;
    stdDev?: StdDevResult[] | null;
    superTrend?: SuperTrendResult[] | null;
    chandelierLong?: ChandelierResult[] | null;
}

export interface ResultBase {
    date?: Date;
}

export interface EmaResult extends ResultBase {
    ema?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface MacdResult extends ResultBase {
    macd?: number | null;
    signal?: number | null;
    histogram?: number | null;
    fastEma?: number | null;
    slowEma?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface RsiResult extends ResultBase {
    rsi?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

/** Stochastic indicator results includes aliases for those who prefer the simpler K,D,J outputs.  See  documentation  for more information. */
export interface StochResult extends ResultBase {
    oscillator?: number | null;
    signal?: number | null;
    percentJ?: number | null;
    k?: number | null;
    d?: number | null;
    j?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface StochRsiResult extends ResultBase {
    stochRsi?: number | null;
    signal?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface BollingerBandsResult extends ResultBase {
    sma?: number | null;
    upperBand?: number | null;
    lowerBand?: number | null;
    percentB?: number | null;
    zScore?: number | null;
    width?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface ChandelierResult extends ResultBase {
    chandelierExit?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface StcResult extends ResultBase {
    stc?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface StdDevResult extends ResultBase {
    stdDev?: number | null;
    mean?: number | null;
    zScore?: number | null;
    stdDevSma?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface SuperTrendResult extends ResultBase {
    superTrend?: number | null;
    upperBand?: number | null;
    lowerBand?: number | null;
}

export interface GetCandlesWithIndicatorsRequest {
    ticker?: Ticker;
    startDate?: Date;
    endDate?: Date;
    timeframe?: Timeframe;
    scenario?: ScenarioRequest | null;
}

export interface StrategiesStatisticsViewModel {
    totalStrategiesRunning?: number;
    changeInLast24Hours?: number;
}

export interface TopStrategiesViewModel {
    topStrategies?: StrategyPerformance[] | null;
}

export interface StrategyPerformance {
    strategyName?: string | null;
    pnL?: number;
    agentName?: string | null;
}

export interface TopStrategiesByRoiViewModel {
    topStrategiesByRoi?: StrategyRoiPerformance[] | null;
}

export interface StrategyRoiPerformance {
    strategyName?: string | null;
    roi?: number;
    pnL?: number;
    volume?: number;
}

export interface TopAgentsByPnLViewModel {
    topAgentsByPnL?: AgentPerformance[] | null;
}

export interface AgentPerformance {
    agentName?: string | null;
    pnL?: number;
    totalROI?: number;
    totalVolume?: number;
    activeStrategiesCount?: number;
    totalBalance?: number;
}

export interface UserStrategyDetailsViewModel {
    name?: string | null;
    state?: BotStatus;
    pnL?: number;
    roiPercentage?: number;
    roiLast24H?: number;
    runtime?: Date;
    winRate?: number;
    totalVolumeTraded?: number;
    volumeLast24H?: number;
    wins?: number;
    losses?: number;
    positions?: Position[] | null;
    identifier?: string;
    walletBalances?: { [key: string]: number; } | null;
}

export interface PlatformSummaryViewModel {
    totalAgents?: number;
    totalActiveStrategies?: number;
    totalPlatformPnL?: number;
    totalPlatformVolume?: number;
    totalPlatformVolumeLast24h?: number;
    totalOpenInterest?: number;
    totalPositionCount?: number;
    agentsChange24h?: number;
    strategiesChange24h?: number;
    pnLChange24h?: number;
    volumeChange24h?: number;
    openInterestChange24h?: number;
    positionCountChange24h?: number;
    volumeByAsset?: { [key in keyof typeof Ticker]?: number; } | null;
    positionCountByAsset?: { [key in keyof typeof Ticker]?: number; } | null;
    positionCountByDirection?: { [key in keyof typeof TradeDirection]?: number; } | null;
    lastUpdated?: Date;
    last24HourSnapshot?: Date;
    volumeHistory?: VolumeHistoryPoint[] | null;
}

export interface VolumeHistoryPoint {
    date?: Date;
    volume?: number;
}

export interface PaginatedAgentIndexResponse {
    agentSummaries?: AgentSummaryViewModel[] | null;
    totalCount?: number;
    currentPage?: number;
    pageSize?: number;
    totalPages?: number;
    hasNextPage?: boolean;
    hasPreviousPage?: boolean;
    timeFilter?: string | null;
    sortBy?: SortableFields;
    sortOrder?: string | null;
    filteredAgentNames?: string | null;
}

export interface AgentSummaryViewModel {
    agentName?: string | null;
    totalPnL?: number;
    totalROI?: number;
    wins?: number;
    losses?: number;
    activeStrategiesCount?: number;
    totalVolume?: number;
    totalBalance?: number;
}

export enum SortableFields {
    TotalPnL = "TotalPnL",
    TotalROI = "TotalROI",
    Wins = "Wins",
    Losses = "Losses",
    AgentName = "AgentName",
    CreatedAt = "CreatedAt",
    UpdatedAt = "UpdatedAt",
}

export interface AgentBalanceHistory {
    agentName?: string | null;
    agentBalances?: AgentBalance[] | null;
}

export interface AgentBalance {
    agentName?: string | null;
    totalValue?: number;
    totalAccountUsdValue?: number;
    botsAllocationUsdValue?: number;
    pnL?: number;
    time?: Date;
}

export interface BestAgentsResponse {
    agents?: AgentBalanceHistory[] | null;
    totalCount?: number;
    currentPage?: number;
    pageSize?: number;
    totalPages?: number;
}

export interface ScenarioViewModel {
    name: string;
    indicators: IndicatorViewModel[];
    loopbackPeriod?: number | null;
    userName: string;
}

export interface IndicatorViewModel {
    name: string;
    type: IndicatorType;
    signalType: SignalType;
    minimumHistory: number;
    period?: number | null;
    fastPeriods?: number | null;
    slowPeriods?: number | null;
    signalPeriods?: number | null;
    multiplier?: number | null;
    smoothPeriods?: number | null;
    stochPeriods?: number | null;
    cyclePeriods?: number | null;
    userName: string;
}

export enum RiskLevel {
    Low = "Low",
    Medium = "Medium",
    High = "High",
    Adaptive = "Adaptive",
}

export interface PrivyInitAddressResponse {
    success?: boolean;
    usdcHash?: string | null;
    orderVaultHash?: string | null;
    exchangeRouterHash?: string | null;
    error?: string | null;
}

export interface LoginRequest {
    name: string;
    address: string;
    signature: string;
    message: string;
}

export interface FileResponse {
    data: Blob;
    status: number;
    fileName?: string;
    headers?: { [name: string]: any };
}