Exemple #1
0
        public async Task <IReadOnlyCollection <AssetPairSettings> > GetAssetPairsAsync()
        {
            IReadOnlyCollection <AssetPairSettings> assetPairsSettings = _assetPairsCache.GetAll();

            if (assetPairsSettings == null)
            {
                assetPairsSettings = await _assetPairSettingsRepository.GetAllAsync();

                _assetPairsCache.Initialize(assetPairsSettings);

                InitializeAssetPairs();
            }

            return(assetPairsSettings);
        }
Exemple #2
0
        public Task <IReadOnlyCollection <Balance> > GetAsync(string exchange)
        {
            Balance[] balances = _cache.GetAll()
                                 .Where(o => o.Exchange == exchange)
                                 .ToArray();

            return(Task.FromResult <IReadOnlyCollection <Balance> >(balances));
        }
        public async Task <IReadOnlyCollection <Domain.PnLStopLossSettings> > GetAllAsync()
        {
            IReadOnlyCollection <Domain.PnLStopLossSettings> pnLStopLossSettings = _cache.GetAll();

            if (pnLStopLossSettings == null)
            {
                pnLStopLossSettings = await Initialize();
            }

            return(pnLStopLossSettings);
        }
Exemple #4
0
        public async Task <IReadOnlyCollection <PnLStopLossEngine> > GetAllAsync()
        {
            IReadOnlyCollection <PnLStopLossEngine> pnLStopLossEngines = _cache.GetAll();

            if (pnLStopLossEngines == null)
            {
                pnLStopLossEngines = await Initialize();
            }

            return(pnLStopLossEngines);
        }
        public async Task <IReadOnlyCollection <Credit> > GetAllAsync()
        {
            IReadOnlyCollection <Credit> credits = _cache.GetAll();

            if (credits == null)
            {
                credits = await _creditRepository.GetAllAsync();

                _cache.Initialize(credits);
            }

            return(credits);
        }
        public async Task <IReadOnlyCollection <Position> > GetAllAsync()
        {
            IReadOnlyCollection <Position> positions = _cache.GetAll();

            if (positions == null)
            {
                positions = await _positionRepository.GetAllAsync();

                _cache.Initialize(positions);
            }

            return(positions);
        }
Exemple #7
0
        public async Task <IReadOnlyCollection <AssetPairLink> > GetAllAsync()
        {
            IReadOnlyCollection <AssetPairLink> assetPairLinks = _cache.GetAll();

            if (assetPairLinks == null)
            {
                assetPairLinks = await _assetPairLinkRepository.GetAllAsync();

                _cache.Initialize(assetPairLinks);
            }

            return(assetPairLinks);
        }
Exemple #8
0
        public async Task <IReadOnlyCollection <RemainingVolume> > GetAllAsync()
        {
            IReadOnlyCollection <RemainingVolume> remainingVolumes = _cache.GetAll();

            if (remainingVolumes == null)
            {
                remainingVolumes = await _remainingVolumeRepository.GetAllAsync();

                _cache.Initialize(remainingVolumes);
            }

            return(remainingVolumes);
        }
        public async Task <IReadOnlyCollection <AssetHedgeSettings> > GetAllAsync()
        {
            IReadOnlyCollection <AssetHedgeSettings> assetHedgeSettings = _cache.GetAll();

            if (assetHedgeSettings == null)
            {
                assetHedgeSettings = await _assetHedgeSettingsRepository.GetAllAsync();

                _cache.Initialize(assetHedgeSettings);
            }

            return(assetHedgeSettings);
        }
Exemple #10
0
        public async Task <IReadOnlyCollection <SummaryReport> > GetAllAsync()
        {
            IReadOnlyCollection <SummaryReport> summaryReports = _cache.GetAll();

            if (summaryReports == null)
            {
                summaryReports = await _summaryReportRepository.GetAllAsync();

                _cache.Initialize(summaryReports);
            }

            return(summaryReports);
        }
Exemple #11
0
        public async Task <IReadOnlyCollection <IndexSettings> > GetAllAsync()
        {
            IReadOnlyCollection <IndexSettings> indexSettings = _cache.GetAll();

            if (indexSettings == null)
            {
                indexSettings = await _indexSettingsRepository.GetAllAsync();

                _cache.Initialize(indexSettings);
            }

            return(indexSettings);
        }
Exemple #12
0
        public async Task <IReadOnlyCollection <Token> > GetAllAsync()
        {
            IReadOnlyCollection <Token> tokens = _cache.GetAll();

            if (tokens == null)
            {
                tokens = await _tokenRepository.GetAllAsync();

                _cache.Initialize(tokens);
            }

            return(tokens);
        }
        public async Task <IReadOnlyCollection <Instrument> > GetAllAsync()
        {
            IReadOnlyCollection <Instrument> instruments = _cache.GetAll();

            if (instruments == null)
            {
                instruments = await _instrumentRepository.GetAllAsync();

                _cache.Initialize(instruments);
            }

            return(instruments);
        }
Exemple #14
0
        public async Task <IReadOnlyCollection <Domain.AssetSettings> > GetAllAsync()
        {
            IReadOnlyCollection <Domain.AssetSettings> assets = _cache.GetAll();

            if (assets == null)
            {
                assets = (await _assetSettingsRepository.GetAllAsync())
                         .Append(UsdAssetSettings)
                         .ToArray();

                _cache.Initialize(assets);
            }

            return(assets);
        }
Exemple #15
0
        public async Task <IReadOnlyCollection <Instrument> > GetAllAsync()
        {
            IReadOnlyCollection <Instrument> instruments = _cache.GetAll();

            if (instruments == null)
            {
                instruments = await _instrumentRepository.GetAllAsync();

                foreach (Instrument instrument in instruments)
                {
                    instrument.CrossInstruments = await _crossInstrumentRepository.GetAsync(instrument.AssetPairId);
                }

                _cache.Initialize(instruments);
            }

            return(instruments);
        }
Exemple #16
0
        public async Task <IReadOnlyList <ExchangeSettings> > GetAllAsync()
        {
            IReadOnlyList <ExchangeSettings> settings = _cache.GetAll();

            if (settings == null)
            {
                settings = await _exchangeSettingsRepository.GetAllAsync();

                settings = settings.Union(_exchanges
                                          .Where(o => settings.All(p => p.Name != o))
                                          .Select(o => new ExchangeSettings(o)))
                           .Where(o => _exchanges.Contains(o.Name))
                           .ToList();

                _cache.Initialize(settings);
            }

            return(settings);
        }
Exemple #17
0
 public Dictionary <string, List <RestaurantDto> > GetRestaurantCaches()
 {
     return(_restaurantCache.GetAll <List <RestaurantDto> >("2020"));
 }
 public IReadOnlyCollection <OrderBook> GetAll()
 {
     return(_cache.GetAll());
 }
 public IReadOnlyCollection <AssetInvestment> GetAll()
 {
     return(_cache.GetAll());
 }
 public IReadOnlyCollection <HedgeLimitOrder> GetAll()
 {
     return(_cache.GetAll());
 }
        public Task <IReadOnlyCollection <Balance> > GetAllAsync()
        {
            IReadOnlyCollection <Balance> balances = _cache.GetAll() ?? new Balance[0];

            return(Task.FromResult(balances));
        }
 public IReadOnlyList <Quote> GetAll()
 {
     return(_cache.GetAll());
 }
 public IReadOnlyCollection <Balance> GetByExchange(string exchange)
 {
     return(_cache.GetAll()
            .Where(o => o.Exchange == exchange)
            .ToArray());
 }
Exemple #24
0
 public IReadOnlyCollection <Quote> GetAll()
 {
     return(_cache.GetAll());
 }
Exemple #25
0
 public Task <IReadOnlyCollection <OrderBook> > GetAllAsync()
 {
     return(Task.FromResult(_cache.GetAll()));
 }
Exemple #26
0
 public Task <IReadOnlyCollection <Quote> > GetAsync()
 {
     return(Task.FromResult(_cache.GetAll()));
 }
Exemple #27
0
        public Task <IReadOnlyCollection <AssetLink> > GetAllAsync()
        {
            IReadOnlyCollection <AssetLink> assetLinks = _cache.GetAll();

            return(Task.FromResult(assetLinks));
        }