Fetch closed position to get last pnl realized
This commit is contained in:
@@ -75,4 +75,22 @@ public interface IEvmManager
|
||||
/// <param name="chain">The blockchain chain</param>
|
||||
/// <param name="publicAddress">The public address</param>
|
||||
void ClearBalancesCache(Chain chain, string publicAddress);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position history for a specific ticker and account from GMX
|
||||
/// </summary>
|
||||
/// <param name="account">The trading account</param>
|
||||
/// <param name="ticker">The ticker to get history for</param>
|
||||
/// <param name="fromDate">Optional start date for filtering</param>
|
||||
/// <param name="toDate">Optional end date for filtering</param>
|
||||
/// <param name="pageIndex">Page index for pagination (default: 0)</param>
|
||||
/// <param name="pageSize">Page size for pagination (default: 20)</param>
|
||||
/// <returns>Position history response with actual GMX PnL data</returns>
|
||||
Task<List<Position>> GetPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null,
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20);
|
||||
}
|
||||
@@ -67,4 +67,10 @@ public interface IExchangeService
|
||||
Task<Trade> GetTrade(string reference, string orderId, Ticker ticker);
|
||||
Task<List<FundingRate>> GetFundingRates();
|
||||
Task<IEnumerable<Position>> GetBrokerPositions(Account account);
|
||||
|
||||
Task<List<Position>> GetPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using Managing.Domain.Accounts;
|
||||
using Managing.Domain.Evm;
|
||||
using Managing.Domain.Trades;
|
||||
using static Managing.Common.Enums;
|
||||
|
||||
namespace Managing.Application.Abstractions.Services
|
||||
@@ -22,5 +23,7 @@ namespace Managing.Application.Abstractions.Services
|
||||
Task<decimal> GetEstimatedGasFeeUsdAsync();
|
||||
|
||||
Task<GasFeeData> GetGasFeeDataAsync();
|
||||
|
||||
Task<List<Position>> GetGmxPositionHistoryAsync(string account, int pageIndex = 0, int pageSize = 20, string? ticker = null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user