コード例 #1
0
        private async ValueTask HandleTrades(IReadOnlyList <WalletTradeMessage> trades)
        {
            var wallets = _walletManager.GetAll().Select(e => e.WalletId).ToList();

            var list = trades.Where(e => wallets.Contains(e.WalletId)).ToList();

            if (list.Any())
            {
                using var _ = MyTelemetry.StartActivity("Handle event WalletTradeMessage")
                              ?.AddTag("event-count", list.Count)?.AddTag("event-name", "WalletTradeMessage");

                await _manager.RegisterLocalTradesAsync(list);

                lock (_sync) _needToHedge = true;
            }
        }