Пример #1
0
        public VolumeGraph(VolumeContext context, NetworkGraph networkGraph, PriceGraph priceGraph)
        {
            Context      = context;
            NetworkGraph = networkGraph;
            PriceGraph   = priceGraph;
            Meta         = networkGraph.Meta;

            _dN.BuildData(PriceGraph.PairsByNetwork);

            var id = "VolumeGraph".GetObjectIdHashCode();

            if (context.FlushVolume)
            {
                VolumeDbProvider.Clear(id);
            }

            VolumeDbProvider = new VolumeDbProvider(id);

            _volume = GetAllVolumeData();

            ApplyBtc();

            FilterVolume(_dN.PairsByNetwork);

            VolumeExceptionCheck();
        }
Пример #2
0
        public PriceGraph(PricesContext context, NetworkGraph networkGraph)
        {
            PricesContext  = context;
            NetworkContext = networkGraph.Context;
            NetworkGraph   = networkGraph;

            _dN.BuildData(networkGraph.PairsByNetworkN);

            Refresh();
        }
Пример #3
0
        public NetworkGraph(NetworkContext context, PriceGraph priceGraph)
        {
            Context    = context;
            PriceGraph = priceGraph;
            Meta       = new GraphMeta(context);

            var fromPrices = priceGraph.PairsByNetwork.ToDictionary(x => x.Key, y => y.Value);

            _dR.BuildData(fromPrices);
            _dN.BuildData(_dR, true);
        }
Пример #4
0
        public PriceGraph(PricesContext context, NetworkGraph networkGraph)
        {
            PricesContext  = context;
            NetworkContext = networkGraph.Context;
            NetworkGraph   = networkGraph;

            _dN.BuildData(networkGraph.PairsByNetworkN);

            var source = _dN.DeNormalise(NetworkGraph.PairsByNetworkRaw);

            _pricesByNetwork = PopulatePriceGraph(source).ToDictionary(x => x.Key, y => y.Value.AsReadOnlyList());

            RemoveEmptyPricing(_pricesByNetwork);

            _dN.BuildData(_pricesByNetwork.ToDictionary(x => x.Key, y => y.Value.Select(x => x.Pair).AsReadOnlyList()));

            _prices       = _pricesByNetwork.Values.SelectMany(x => x).ToList();
            _pricesByPair = _prices.GroupBy(x => x.Pair).ToDictionary(x => x.Key, y => y.AsReadOnlyList());
        }
Пример #5
0
        /*
         * public NetworkGraph(NetworkContext context, PriceGraph priceGraph)
         * {
         *  Context = context;
         *  PriceGraph = priceGraph;
         *  Meta = new GraphMeta(context);
         *
         *  var fromPrices = priceGraph.PairsByNetwork.ToDictionary(x => x.Key, y => y.Value);
         *
         *  _dR.BuildData(fromPrices);
         *  _dN.BuildData(_dR, true);
         * }*/

        public NetworkGraph(NetworkContext context)
        {
            Context = context;
            Meta    = new GraphMeta(context);

            var orig = AsyncContext.Run(() => AssetPairProvider.I.GetNetworksDiskAsync());

            //var pbn = orig.ToDictionary(x => x.Key, y => y.Value.Select(x => x.Normalised).AsReadOnlyList());
            var pbnR = orig.ToDictionary(x => x.Key, y => y.Value as IReadOnlyList <AssetPair>);

            ApplyFilters(Context, pbnR);

            _dN.BuildData(pbnR.ToDictionary(x => x.Key, y => y.Value.Select(x => x.Normalised).AsReadOnlyList()));
            _dR.BuildData(pbnR);
        }