private void SetAveragePrice(CurrencyName instrument, string pairName, Action wait = null) { var exist1 = _restInstruments.ContainsKey(instrument); //var exist2 = _wsInstruments.ContainsKey(instrument); if (!exist1 /*&& !exist2*/) { return; } if (wait != null) { wait(); } var vwap = _bitfinex.GetTicker(pairName).Mid; if (_restInstruments.ContainsKey(instrument)) { _restInstruments[instrument].SetAveragePrice(vwap); } //if (_wsInstruments.ContainsKey(instrument)) // _wsInstruments[instrument].SetAveragePrice(vwap); }