public void Add(MarketPrice price) { if (price?.Pair == null) { return; } if (price.Network == null) { MissedPairs.Add(price.Pair); return; } if (price.Price > 0) { PricesList.Add(price); } }
public MarketPrices AsNormalised() { var normalised = PricesList.ToList(); var forNormalisation = normalised.Where(x => !x.Pair.IsNormalised).ToList(); normalised.RemoveAll(x => forNormalisation.Contains(x)); foreach (var i in forNormalisation) { normalised.Add(i.Reversed); } return(new MarketPrices(normalised) { IdBacking = IdBacking, UtcCreated = UtcCreated, MissedPairs = new AssetPairs(MissedPairs.Select(x => x.Normalised)) }); }