Clean and update event
This commit is contained in:
@@ -178,27 +178,11 @@ public class TradingService : ITradingService
|
||||
return position;
|
||||
}
|
||||
|
||||
|
||||
public async Task UpdatePositionAsync(Position position)
|
||||
{
|
||||
await _tradingRepository.UpdatePositionAsync(position);
|
||||
}
|
||||
|
||||
public async Task UpdateTradeAsync(Trade trade)
|
||||
{
|
||||
await _tradingRepository.UpdateTradeAsync(trade);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Position>> GetPositionsAsync()
|
||||
{
|
||||
var positions = new List<Position>();
|
||||
positions.AddRange(await GetPositionsByStatusAsync(PositionStatus.New));
|
||||
positions.AddRange(await GetPositionsByStatusAsync(PositionStatus.Filled));
|
||||
positions.AddRange(await GetPositionsByStatusAsync(PositionStatus.PartiallyFilled));
|
||||
return positions;
|
||||
}
|
||||
|
||||
|
||||
public async Task WatchTrader()
|
||||
{
|
||||
var availableTickers = new List<Ticker> { Ticker.BTC, Ticker.ETH, Ticker.UNI, Ticker.LINK };
|
||||
@@ -268,7 +252,8 @@ public class TradingService : ITradingService
|
||||
return await _tradingRepository.GetPositionsByInitiatorIdentifierAsync(initiatorIdentifier);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Position>> GetPositionsByInitiatorIdentifiersAsync(IEnumerable<Guid> initiatorIdentifiers)
|
||||
public async Task<IEnumerable<Position>> GetPositionsByInitiatorIdentifiersAsync(
|
||||
IEnumerable<Guid> initiatorIdentifiers)
|
||||
{
|
||||
return await _tradingRepository.GetPositionsByInitiatorIdentifiersAsync(initiatorIdentifiers);
|
||||
}
|
||||
@@ -385,10 +370,11 @@ public class TradingService : ITradingService
|
||||
var account = await _accountRepository.GetAccountByKeyAsync(publicAddress);
|
||||
if (account != null && account.IsGmxInitialized)
|
||||
{
|
||||
_logger.LogInformation("Account with address {PublicAddress} is already initialized for GMX", publicAddress);
|
||||
return new PrivyInitAddressResponse
|
||||
{
|
||||
Success = true,
|
||||
_logger.LogInformation("Account with address {PublicAddress} is already initialized for GMX",
|
||||
publicAddress);
|
||||
return new PrivyInitAddressResponse
|
||||
{
|
||||
Success = true,
|
||||
Address = publicAddress,
|
||||
IsAlreadyInitialized = true
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user