Esempio n. 1
0
 public SrvRateCalculator(CachedDataDictionary <string, IAsset> assetsDict,
                          CachedDataDictionary <string, IAssetPair> assetPairsDict,
                          IAssetPairBestPriceRepository bestPriceRepository,
                          IActiveLimitOrdersRepository activeLimitOrdersRepository)
 {
     _assetsDict                  = assetsDict;
     _assetPairsDict              = assetPairsDict;
     _bestPriceRepository         = bestPriceRepository;
     _activeLimitOrdersRepository = activeLimitOrdersRepository;
 }
Esempio n. 2
0
 public SrvOrderBookBuilder(IAssetPairsRepository assetPairsRepository, IActiveLimitOrdersRepository activeLimitOrdersRepository)
 {
     _assetPairsRepository        = assetPairsRepository;
     _activeLimitOrdersRepository = activeLimitOrdersRepository;
 }
 public static async Task <IEnumerable <ILimitOrder> > GetAsync(this IActiveLimitOrdersRepository repo, string assetPair, OrderAction action)
 {
     return((await repo.GetAsync(assetPair)).Where(x => action == OrderAction.Buy ? x.Volume > 0 : x.Volume < 0));
 }