Exemple #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();
        }
Exemple #2
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);
        }
Exemple #3
0
 /// <summary>
 /// Will search for the price in both directions (normal / reversed).
 /// </summary>
 public static MarketPrice GetPrice(this PriceGraph graph, Network network, AssetPair pair)
 {
     return(graph?.PricesByNetwork?.Get(network)?.GetPrice(pair));
 }
Exemple #4
0
 /// <summary>
 /// Will search for the price in both directions (normal / reversed).
 /// </summary>
 public static MarketPrice GetPrice(this PriceGraph graph, AssetPair pair)
 {
     return(graph?.Prices?.GetPrice(pair));
 }