private void Handle(MarketByPriceUpdateMessage msg)
        {
            if (msg.Tick?.Bids != null)
            {
                for (var i = 0; i < msg.Tick.Bids.Length; ++i)
                {
                    var bid = msg.Tick.Bids[i];

                    _logger.LogInformation($"Market by price update {msg.ParseSymbolFromTopic()} | [bid {i}: price={bid.Price} size={bid.Size}]");
                }
            }

            if (msg.Tick?.Asks != null)
            {
                for (var i = 0; i < msg.Tick.Asks.Length; ++i)
                {
                    var bid = msg.Tick.Asks[i];

                    _logger.LogInformation($"Market by price update {msg.ParseSymbolFromTopic()} | [ask {i}: price={bid.Price} size={bid.Size}]");
                }
            }
        }
Example #2
0
        private OrderBookLevel[] ConvertLevels(MarketByPriceUpdateMessage response)
        {
            var symbol = response.ParseSymbolFromTopic();

            return(ConvertLevels(symbol, response.Tick?.Bids, response.Tick?.Asks));
        }