예제 #1
0
        public ExchangeHealthControlService(
            IExchangeCache exchangeCache,

            IExchangeConnectorService exchangeConnectorService,

            IRabbitMqPublisher <ExchangeHealthControlReport> exchangeHealthControlReportPublisher,

            IExchangeHealthControlResultRepository exchangeHealthControlResultRepository,

            IReloadingManager <ExchangeHealthControlJobSettings> settings,

            ILog log)
        {
            _exchangeCache = exchangeCache;

            _exchangeConnectorService = exchangeConnectorService;

            _exchangeHealthControlReportPublisher = exchangeHealthControlReportPublisher;

            _exchangeHealthControlResultRepository = exchangeHealthControlResultRepository;

            _settings = settings;

            _log = log;

            _failMessageThrottlingPeriodSec = _settings.CurrentValue.FailMessageThrottlingPeriodSeconds;
        }
예제 #2
0
 /// <summary>
 /// Get information about a specific exchange
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='exchangeName'>
 /// Name of the specific exchange
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ExchangeInformationModel> GetExchangeInfoAsync(this IExchangeConnectorService operations, string exchangeName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetExchangeInfoWithHttpMessagesAsync(exchangeName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #3
0
 /// <summary>
 /// Checks service is alive
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IsAliveResponseModel> IsAliveAsync(this IExchangeConnectorService operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.IsAliveWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #4
0
 /// <summary>
 /// Returns full balance information on the exchange
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='exchangeName'>
 /// The exchange name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <TradeBalanceModel> > GetTradeBalanceAsync(this IExchangeConnectorService operations, string exchangeName = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetTradeBalanceWithHttpMessagesAsync(exchangeName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #5
0
 /// <summary>
 /// Get a list of all connected exchanges
 /// </summary>
 /// <remarks>
 /// The names of available exchanges participates in API calls for
 /// exchange-specific methods
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <string> > GetSupportedExchangesAsync(this IExchangeConnectorService operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetSupportedExchangesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #6
0
 /// <summary>
 /// Places a new order on the exchange
 /// </summary>
 /// <remarks>
 /// In the location header of successful response placed an URL for getting
 /// info about the order
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='orderModel'>
 /// A new order
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ExecutionReport> CreateOrderAsync(this IExchangeConnectorService operations, OrderModel orderModel = default(OrderModel), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrderWithHttpMessagesAsync(orderModel, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #7
0
 /// <summary>
 /// Cancels the existing order
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The order id to cancel
 /// </param>
 /// <param name='exchangeName'>
 /// The exchange name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ExecutionReport> CancelOrderAsync(this IExchangeConnectorService operations, string id, string exchangeName = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CancelOrderWithHttpMessagesAsync(id, exchangeName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #8
0
 public SpecialLiquidationCommandsHandler(
     ITradingEngine tradingEngine,
     IDateService dateService,
     IOrderReader orderReader,
     IChaosKitty chaosKitty,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     ILog log,
     MarginTradingSettings marginTradingSettings,
     IAssetPairsCache assetPairsCache,
     IAssetPairDayOffService assetPairDayOffService,
     IExchangeConnectorService exchangeConnectorService,
     IIdentityGenerator identityGenerator,
     IAccountsCacheService accountsCacheService)
 {
     _tradingEngine = tradingEngine;
     _dateService   = dateService;
     _orderReader   = orderReader;
     _chaosKitty    = chaosKitty;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _log = log;
     _marginTradingSettings    = marginTradingSettings;
     _assetPairsCache          = assetPairsCache;
     _assetPairDayOffService   = assetPairDayOffService;
     _exchangeConnectorService = exchangeConnectorService;
     _identityGenerator        = identityGenerator;
     _accountsCacheService     = accountsCacheService;
 }
예제 #9
0
        public ExchangePollingService(
            IExchangeCache exchangeCache,

            IQuoteService quoteService,

            IExchangeConnectorService exchangeConnectorService,

            IRabbitMqPublisher <ExecutionReport> executionReportPublisher,

            IReloadingManager <ExchangePollingJobSettings> settings,

            ILog log)
        {
            _exchangeCache = exchangeCache;

            _quoteService = quoteService;

            _exchangeConnectorService = exchangeConnectorService;

            _executionReportPublisher = executionReportPublisher;

            _settings = settings;

            _log = log;
        }
예제 #10
0
 public StpMatchingEngine(string id,
                          ExternalOrderBooksList externalOrderBooksList,
                          IExchangeConnectorService exchangeConnectorService,
                          ILog log,
                          IDateService dateService,
                          IRabbitMqNotifyService rabbitMqNotifyService,
                          IAssetPairsCache assetPairsCache)
 {
     _externalOrderBooksList   = externalOrderBooksList;
     _exchangeConnectorService = exchangeConnectorService;
     _log                   = log;
     _dateService           = dateService;
     _rabbitMqNotifyService = rabbitMqNotifyService;
     _assetPairsCache       = assetPairsCache;
     Id = id;
 }
예제 #11
0
 public StpMatchingEngine(string id,
                          IExternalOrderbookService externalOrderbookService,
                          IExchangeConnectorService exchangeConnectorService,
                          ILog log,
                          IOperationsLogService operationsLogService,
                          IDateService dateService,
                          IRabbitMqNotifyService rabbitMqNotifyService,
                          IAssetPairsCache assetPairsCache,
                          MarginTradingSettings marginTradingSettings,
                          IQuoteCacheService quoteCacheService)
 {
     _externalOrderbookService = externalOrderbookService;
     _exchangeConnectorService = exchangeConnectorService;
     _log = log;
     _operationsLogService  = operationsLogService;
     _dateService           = dateService;
     _rabbitMqNotifyService = rabbitMqNotifyService;
     _assetPairsCache       = assetPairsCache;
     _marginTradingSettings = marginTradingSettings;
     _quoteCacheService     = quoteCacheService;
     Id = id;
 }