Beispiel #1
0
        private async Task <Dictionary <string, Order> > TryExecute(Order order)
        {
            Dictionary <string, Order> ordersInvolved;
            bool   oppositeSide = !order.BuyOrder;
            string cacheKey     = CacheKeyGenerator.ToLookKey(ref oppositeSide, order.AskPrice, order.Amount);

            Order oppositeOrder = await GetOrderByKey(cacheKey);

            if (oppositeOrder == null)
            {
                return new Dictionary <string, Order>
                       {
                           { order.Id, order }
                       }
            }
            ;

            ordersInvolved = await Execute(order, oppositeOrder);

            return(ordersInvolved);
        }