public List <Exchange> GetTopExchangesForPair(string fsym, string tsym) { Console.Write($"Getting top exchanges for {fsym} -> {tsym}..."); var url = $"{BaseUrl}/top/exchanges?fsym={fsym}&tsym={tsym}&limit=20"; var exchanges = new List <Exchange>(); dynamic exchangeData = GetData <dynamic>(url); foreach (dynamic exchange in exchangeData["Data"]) { var exchangeDto = new Exchange { Name = exchange.exchange.Value }; //Console.WriteLine($"\t{exchangeDto.Name}"); foreach (dynamic coin in new[] { fsym, tsym }.Where(m => m != SymbolConstants.Usd)) { var coinDto = new Coin { Symbol = coin }; exchangeDto.Coins.Add(coinDto); } exchanges.Add(exchangeDto); } Console.WriteLine("Done."); //return exchanges.Where(m => !_exchangeExclusions.Contains(m.Name)).ToList(); var configuredApis = _configService.GetApiConfigurations(); if (configuredApis == null || !configuredApis.Any()) { throw new Exception("There must be at least two configured APIs in the api.json file."); } return(exchanges.Where(m => configuredApis.Where(n => n.Configured).Select(n => n.Exchange).ToList().Contains(m.Name)).ToList()); }