Add start and enddate when fetching the position history

This commit is contained in:
2025-10-24 18:00:23 +07:00
parent 554cac7d89
commit fc4369a008
10 changed files with 352 additions and 32 deletions

View File

@@ -989,7 +989,9 @@ public class EvmManager : IEvmManager
account.Key,
pageIndex,
pageSize,
ticker.ToString());
ticker.ToString(),
fromDate,
toDate);
// Map the result to the Position domain object
return result;

View File

@@ -589,15 +589,22 @@ namespace Managing.Infrastructure.Evm.Services
return queryString.ToString();
}
public async Task<List<Position>> GetGmxPositionHistoryAsync(string account, int pageIndex = 0,
int pageSize = 20, string? ticker = null)
public async Task<List<Position>> GetGmxPositionHistoryAsync(
string account,
int pageIndex = 0,
int pageSize = 20,
string? ticker = null,
DateTime? fromDate = null,
DateTime? toDate = null)
{
var payload = new
{
account,
pageIndex,
pageSize,
ticker
ticker,
fromDateTime = fromDate?.ToString("O"), // ISO 8601 format
toDateTime = toDate?.ToString("O") // ISO 8601 format
};
var response = await GetGmxServiceAsync<GetGmxPositionHistoryResponse>("/position-history", payload);