예제 #1
0
        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);
            }
        }
예제 #2
0
        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))
            });
        }