Add ticker to the UserStrategies list and set debit credit to 1 for backtest
This commit is contained in:
@@ -554,6 +554,7 @@ public class DataController : ControllerBase
|
||||
Positions = positions,
|
||||
Identifier = strategy.Identifier,
|
||||
WalletBalances = new Dictionary<DateTime, decimal>(),
|
||||
Ticker = strategy.Ticker
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -71,5 +71,6 @@ namespace Managing.Api.Models.Responses
|
||||
public Guid Identifier { get; set; }
|
||||
|
||||
public Dictionary<DateTime, decimal> WalletBalances { get; set; } = new Dictionary<DateTime, decimal>();
|
||||
public Enums.Ticker Ticker { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ namespace Managing.Application.Backtests
|
||||
{
|
||||
try
|
||||
{
|
||||
creditRequestId = await _kaigenService.DebitUserCreditsAsync(user, 3);
|
||||
creditRequestId = await _kaigenService.DebitUserCreditsAsync(user, 1);
|
||||
_logger.LogInformation(
|
||||
"Successfully debited credits for user {UserName} with request ID {RequestId}",
|
||||
user.Name, creditRequestId);
|
||||
|
||||
@@ -4502,6 +4502,7 @@ export interface UserStrategyDetailsViewModel {
|
||||
positions?: Position[] | null;
|
||||
identifier?: string;
|
||||
walletBalances?: { [key: string]: number; } | null;
|
||||
ticker?: Ticker;
|
||||
}
|
||||
|
||||
export interface PlatformSummaryViewModel {
|
||||
|
||||
@@ -985,6 +985,7 @@ export interface UserStrategyDetailsViewModel {
|
||||
positions?: Position[] | null;
|
||||
identifier?: string;
|
||||
walletBalances?: { [key: string]: number; } | null;
|
||||
ticker?: Ticker;
|
||||
}
|
||||
|
||||
export interface PlatformSummaryViewModel {
|
||||
|
||||
@@ -2,11 +2,12 @@ import React, {useState} from 'react'
|
||||
import {Card, FormInput, GridTile} from '../../components/mollecules'
|
||||
import useApiUrlStore from '../../app/store/apiStore'
|
||||
import {
|
||||
type AgentBalanceHistory,
|
||||
DataClient,
|
||||
type Position,
|
||||
TradeDirection,
|
||||
type UserStrategyDetailsViewModel
|
||||
type AgentBalanceHistory,
|
||||
BotStatus,
|
||||
DataClient,
|
||||
type Position,
|
||||
TradeDirection,
|
||||
type UserStrategyDetailsViewModel
|
||||
} from '../../generated/ManagingApi'
|
||||
|
||||
interface AgentData {
|
||||
@@ -356,8 +357,9 @@ function AgentSearch({ index }: { index: number }) {
|
||||
{agentData?.strategies && agentData.strategies.length > 0 && (
|
||||
<GridTile title="Strategies">
|
||||
<div className="space-y-4">
|
||||
<div className="grid grid-cols-6 gap-4 p-3 bg-base-300 rounded-lg text-sm font-medium">
|
||||
<div className="grid grid-cols-7 gap-4 p-3 bg-base-300 rounded-lg text-sm font-medium">
|
||||
<span>Name</span>
|
||||
<span>Ticker</span>
|
||||
<span>Status</span>
|
||||
<span>PnL</span>
|
||||
<span>ROI</span>
|
||||
@@ -366,9 +368,10 @@ function AgentSearch({ index }: { index: number }) {
|
||||
</div>
|
||||
|
||||
{agentData.strategies.map((strategy, index) => (
|
||||
<div key={index} className="grid grid-cols-6 gap-4 p-3 bg-base-200 rounded-lg text-sm">
|
||||
<div key={index} className="grid grid-cols-7 gap-4 p-3 bg-base-200 rounded-lg text-sm">
|
||||
<span className="font-medium">{strategy.name}</span>
|
||||
<span className={`badge ${strategy.state === 'RUNNING' ? 'badge-success' : 'badge-warning'}`}>
|
||||
<span className="text-blue-500 font-medium">{strategy.ticker || '-'}</span>
|
||||
<span className={`badge ${strategy.state == BotStatus.Running ? 'badge-success' : 'badge-warning'}`}>
|
||||
{strategy.state}
|
||||
</span>
|
||||
<span className={strategy.pnL && strategy.pnL >= 0 ? 'text-green-500' : 'text-red-500'}>
|
||||
|
||||
Reference in New Issue
Block a user