Fix bots + positions managements
This commit is contained in:
@@ -40,4 +40,5 @@ public interface IExchangeProcessor
|
||||
Task<List<Trade>> GetOrders(Account account, Ticker ticker);
|
||||
Task<Trade> GetTrade(string reference, string orderId, Ticker ticker);
|
||||
Task<List<FundingRate>> GetFundingRates();
|
||||
Task<IEnumerable<Position>> GetPositions(Account account);
|
||||
}
|
||||
|
||||
@@ -187,6 +187,12 @@ namespace Managing.Infrastructure.Exchanges
|
||||
return processor.GetFundingRates();
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Position>> GetBrokerPositions(Account account)
|
||||
{
|
||||
var processor = _exchangeProcessor.First(e => e.Exchange() == TradingExchanges.Evm);
|
||||
return processor.GetPositions(account);
|
||||
}
|
||||
|
||||
public async Task<List<Trade>> GetTrades(Account account, Ticker ticker)
|
||||
{
|
||||
var processor = GetProcessor(account);
|
||||
|
||||
@@ -41,5 +41,6 @@ namespace Managing.Infrastructure.Exchanges.Exchanges
|
||||
public abstract Task<List<Trade>> GetOrders(Account account, Ticker ticker);
|
||||
public abstract Task<Trade> GetTrade(string reference, string orderId, Ticker ticker);
|
||||
public abstract Task<List<FundingRate>> GetFundingRates();
|
||||
public abstract Task<IEnumerable<Position>> GetPositions(Account account);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,11 @@ public class BinanceProcessor : BaseProcessor
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task<IEnumerable<Position>> GetPositions(Account account)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override async Task<List<Trade>> GetTrades(Account account, Ticker ticker)
|
||||
{
|
||||
var binanceOrder =
|
||||
|
||||
@@ -103,6 +103,11 @@ public class EvmProcessor : BaseProcessor
|
||||
return await _evmManager.GetFundingRates();
|
||||
}
|
||||
|
||||
public override async Task<IEnumerable<Position>> GetPositions(Account account)
|
||||
{
|
||||
return await _evmManager.GetPositions(account);
|
||||
}
|
||||
|
||||
public override decimal GetVolume(Account account, Ticker ticker)
|
||||
{
|
||||
var volume = _evmManager.GetVolume(SubgraphProvider.ChainlinkPrice, ticker);
|
||||
|
||||
@@ -212,4 +212,9 @@ public class FtxProcessor : BaseProcessor
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task<IEnumerable<Position>> GetPositions(Account account)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,11 @@ public class KrakenProcessor : BaseProcessor
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task<IEnumerable<Position>> GetPositions(Account account)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override async Task<List<Trade>> GetTrades(Account account, Ticker ticker)
|
||||
{
|
||||
LoadClient(account);
|
||||
|
||||
Reference in New Issue
Block a user