Implement spot position history retrieval in SpotBot and related services
- Added CheckSpotPositionInExchangeHistory method to SpotBot for verifying closed positions against exchange history. - Enhanced logging for Web3Proxy errors during position verification. - Introduced GetSpotPositionHistory method in IEvmManager, IExchangeService, and IWeb3ProxyService interfaces. - Implemented GetSpotPositionHistory in EvmManager and ExchangeService to fetch historical swap data. - Updated GMX SDK integration to support fetching spot position history. - Modified generated API types to include new trading type and position history structures.
This commit is contained in:
@@ -94,6 +94,24 @@ public interface IEvmManager
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the spot position history (swap executions) 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>Spot position history response containing swap executions</returns>
|
||||
Task<List<Position>> GetSpotPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null,
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the staked KUDAI balance for a specific address
|
||||
/// </summary>
|
||||
|
||||
@@ -73,4 +73,12 @@ public interface IExchangeService
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null);
|
||||
|
||||
Task<List<Position>> GetSpotPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null,
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20);
|
||||
}
|
||||
@@ -31,5 +31,13 @@ namespace Managing.Application.Abstractions.Services
|
||||
string? ticker = null,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null);
|
||||
|
||||
Task<List<Position>> GetGmxSpotPositionHistoryAsync(
|
||||
string account,
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20,
|
||||
string? ticker = null,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user