Fix price impact

This commit is contained in:
2025-05-28 01:04:58 +07:00
parent f743436634
commit 4e49f03199
6 changed files with 45 additions and 31 deletions

View File

@@ -1132,7 +1132,7 @@ export class DataClient extends AuthorizedApiBase {
return Promise.resolve<PlatformSummaryViewModel>(null as any);
}
data_GetAgentBalances(agentName: string | null | undefined, startDate: Date | undefined, endDate: Date | null | undefined): Promise<AgentBalance[]> {
data_GetAgentBalances(agentName: string | null | undefined, startDate: Date | undefined, endDate: Date | null | undefined): Promise<AgentBalanceHistory> {
let url_ = this.baseUrl + "/Data/GetAgentBalances?";
if (agentName !== undefined && agentName !== null)
url_ += "agentName=" + encodeURIComponent("" + agentName) + "&";
@@ -1158,13 +1158,13 @@ export class DataClient extends AuthorizedApiBase {
});
}
protected processData_GetAgentBalances(response: Response): Promise<AgentBalance[]> {
protected processData_GetAgentBalances(response: Response): Promise<AgentBalanceHistory> {
const status = response.status;
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
if (status === 200) {
return response.text().then((_responseText) => {
let result200: any = null;
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as AgentBalance[];
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as AgentBalanceHistory;
return result200;
});
} else if (status !== 200 && status !== 204) {
@@ -1172,7 +1172,7 @@ export class DataClient extends AuthorizedApiBase {
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
});
}
return Promise.resolve<AgentBalance[]>(null as any);
return Promise.resolve<AgentBalanceHistory>(null as any);
}
data_GetBestAgents(startDate: Date | undefined, endDate: Date | null | undefined, page: number | undefined, pageSize: number | undefined): Promise<BestAgentsResponse> {
@@ -3212,7 +3212,6 @@ export interface StrategyPerformance {
export interface UserStrategyDetailsViewModel {
name?: string | null;
strategyName?: string | null;
state?: string | null;
pnL?: number;
roiPercentage?: number;
@@ -3225,6 +3224,7 @@ export interface UserStrategyDetailsViewModel {
losses?: number;
positions?: Position[] | null;
identifier?: string | null;
scenarioName?: string | null;
}
export interface PlatformSummaryViewModel {
@@ -3251,6 +3251,11 @@ export interface AgentSummaryViewModel {
volumeLast24h?: number;
}
export interface AgentBalanceHistory {
agentName?: string | null;
agentBalances?: AgentBalance[] | null;
}
export interface AgentBalance {
agentName?: string | null;
totalValue?: number;
@@ -3268,21 +3273,6 @@ export interface BestAgentsResponse {
totalPages?: number;
}
export interface AgentBalanceHistory {
agentName?: string | null;
totalValue?: number;
totalAccountUsdValue?: number;
botsAllocationUsdValue?: number;
pnL?: number;
time?: Date;
pnLHistory?: PnLPoint[] | null;
}
export interface PnLPoint {
time?: Date;
value?: number;
}
export enum RiskLevel {
Low = "Low",
Medium = "Medium",