public BitfinexExecutionHarvester(IBitfinexWebSocketSubscriber socketSubscriber, BitfinexModelConverter bitfinexModelConverter, IHandler <ExecutionReport> handler, ILog log ) { _socketSubscriber = socketSubscriber; _bitfinexModelConverter = bitfinexModelConverter; _handler = handler; _log = log; }
private ExecutionReport OrderToTrade(Order order) { var id = order.Id; var execTime = order.Timestamp; var orderPrice = order.Price; var originalVolume = order.OriginalAmount; var tradeType = BitfinexModelConverter.ConvertTradeType(order.TradeType); var status = order.ConvertOrderStatus(); return(new ExecutionReport(new Instrument(order.Symbol), execTime, orderPrice, originalVolume, order.ExecutedAmount, tradeType, id, status, order.OrderType, order.AvgExecutionPrice) { ExecType = ExecType.Trade, Success = true, FailureType = OrderStatusUpdateFailureType.None, RemainingVolume = order.RemainingAmount, }); }
public BitfinexExchange( BitfinexAdapterSettings configuration, ILimitOrderRepository snapshotStorage, string xApiKey, string apiKey, string secret, ILog log) : base(Constants.BitfinexExchangeName, configuration, log) { _modelConverter = new BitfinexModelConverter(configuration); var credenitals = new BitfinexServiceClientCredentials(apiKey, secret); _snapshotStorage = snapshotStorage; _xApiKey = xApiKey; _exchangeApi = new BitfinexApi(credenitals, log) { BaseUri = new Uri(configuration.EndpointUrl) }; }