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:
@@ -47,4 +47,12 @@ public interface IExchangeProcessor
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -193,6 +193,18 @@ namespace Managing.Infrastructure.Exchanges
|
||||
return processor.GetPositionHistory(account, ticker, fromDate, toDate);
|
||||
}
|
||||
|
||||
public Task<List<Position>> GetSpotPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null,
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20)
|
||||
{
|
||||
var processor = GetProcessor(account);
|
||||
return processor.GetSpotPositionHistory(account, ticker, fromDate, toDate, pageIndex, pageSize);
|
||||
}
|
||||
|
||||
public async Task<List<Trade>> GetTrades(Account account, Ticker ticker)
|
||||
{
|
||||
var processor = GetProcessor(account);
|
||||
|
||||
@@ -48,5 +48,13 @@ namespace Managing.Infrastructure.Exchanges.Exchanges
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null);
|
||||
|
||||
public abstract Task<List<Position>> GetSpotPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null,
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,17 @@ public class EvmProcessor : BaseProcessor
|
||||
return await _evmManager.GetPositionHistory(account, ticker, fromDate, toDate);
|
||||
}
|
||||
|
||||
public override async Task<List<Position>> GetSpotPositionHistory(
|
||||
Account account,
|
||||
Ticker ticker,
|
||||
DateTime? fromDate = null,
|
||||
DateTime? toDate = null,
|
||||
int pageIndex = 0,
|
||||
int pageSize = 20)
|
||||
{
|
||||
return await _evmManager.GetSpotPositionHistory(account, ticker, fromDate, toDate, pageIndex, pageSize);
|
||||
}
|
||||
|
||||
#region Not implemented
|
||||
|
||||
public override void LoadClient(Account account)
|
||||
|
||||
Reference in New Issue
Block a user