Example #1
0
 public AccountUpdateService(
     IFplService fplService,
     OrdersCache ordersCache,
     ILog log,
     ICfdCalculatorService cfdCalculatorService,
     IQuoteCacheService quoteCacheService,
     MarginTradingSettings marginTradingSettings,
     IClientProfileSettingsCache clientProfileSettingsCache,
     IAssetPairsCache assetPairsCache,
     IPositionsProvider positionsProvider,
     IOrdersProvider ordersProvider,
     IAccountsProvider accountsProvider,
     ITradingInstrumentsCacheService tradingInstrumentsCache)
 {
     _fplService                 = fplService;
     _log                        = log;
     _cfdCalculatorService       = cfdCalculatorService;
     _quoteCacheService          = quoteCacheService;
     _marginTradingSettings      = marginTradingSettings;
     _clientProfileSettingsCache = clientProfileSettingsCache;
     _assetPairsCache            = assetPairsCache;
     _positionsProvider          = positionsProvider;
     _ordersProvider             = ordersProvider;
     _accountsProvider           = accountsProvider;
     _tradingInstrumentsCache    = tradingInstrumentsCache;
 }
Example #2
0
 public MtController(
     IMarginTradingAccountHistoryRepository accountsHistoryRepository,
     IMarginTradingOrdersHistoryRepository ordersHistoryRepository,
     IMicrographCacheService micrographCacheService,
     IAccountAssetsCacheService accountAssetsCacheService,
     IAssetPairsCache assetPairsCache,
     IMarketMakerMatchingEngine matchingEngine,
     ITradingEngine tradingEngine,
     IAccountsCacheService accountsCacheService,
     IMarginTradingOperationsLogService operationsLogService,
     IConsole consoleWriter,
     OrdersCache ordersCache,
     MarginSettings marginSettings,
     AccountManager accountManager,
     IAssetPairDayOffService assetDayOffService,
     IQuoteCacheService quoteCacheService,
     IIdentityGenerator identityGenerator)
 {
     _accountsHistoryRepository = accountsHistoryRepository;
     _ordersHistoryRepository   = ordersHistoryRepository;
     _micrographCacheService    = micrographCacheService;
     _accountAssetsCacheService = accountAssetsCacheService;
     _assetPairsCache           = assetPairsCache;
     _matchingEngine            = matchingEngine;
     _tradingEngine             = tradingEngine;
     _accountsCacheService      = accountsCacheService;
     _operationsLogService      = operationsLogService;
     _consoleWriter             = consoleWriter;
     _ordersCache        = ordersCache;
     _marginSettings     = marginSettings;
     _accountManager     = accountManager;
     _assetDayOffService = assetDayOffService;
     _quoteCacheService  = quoteCacheService;
     _identityGenerator  = identityGenerator;
 }
 public SpecialLiquidationCommandsHandler(
     ITradingEngine tradingEngine,
     IDateService dateService,
     IChaosKitty chaosKitty,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     ILog log,
     MarginTradingSettings marginTradingSettings,
     IAssetPairsCache assetPairsCache,
     IAssetPairDayOffService assetPairDayOffService,
     IExchangeConnectorClient exchangeConnectorClient,
     IIdentityGenerator identityGenerator,
     IAccountsCacheService accountsCacheService,
     OrdersCache ordersCache,
     IRfqPauseService rfqPauseService)
 {
     _tradingEngine = tradingEngine;
     _dateService   = dateService;
     _chaosKitty    = chaosKitty;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _log = log;
     _marginTradingSettings   = marginTradingSettings;
     _assetPairsCache         = assetPairsCache;
     _assetPairDayOffService  = assetPairDayOffService;
     _exchangeConnectorClient = exchangeConnectorClient;
     _identityGenerator       = identityGenerator;
     _accountsCacheService    = accountsCacheService;
     _ordersCache             = ordersCache;
     _rfqPauseService         = rfqPauseService;
 }
Example #4
0
 public void SetUp()
 {
     RegisterDependencies();
     _bestPriceConsumer    = Container.Resolve <IEventChannel <BestPriceChangeEventArgs> >();
     _accountsCacheService = Container.Resolve <IAccountsCacheService>();
     _ordersCache          = Container.Resolve <OrdersCache>();
 }
Example #5
0
 public LiquidationCommandsHandler(
     IAccountsCacheService accountsCache,
     IDateService dateService,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IChaosKitty chaosKitty,
     ITradingEngine tradingEngine,
     OrdersCache ordersCache,
     ILog log,
     IAccountUpdateService accountUpdateService,
     IEventChannel <LiquidationEndEventArgs> liquidationEndEventChannel,
     LiquidationHelper liquidationHelper,
     ILiquidationFailureExecutor failureExecutor)
 {
     _accountsCache = accountsCache;
     _dateService   = dateService;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _chaosKitty                 = chaosKitty;
     _tradingEngine              = tradingEngine;
     _ordersCache                = ordersCache;
     _log                        = log;
     _accountUpdateService       = accountUpdateService;
     _liquidationEndEventChannel = liquidationEndEventChannel;
     _liquidationHelper          = liquidationHelper;
     _failureExecutor            = failureExecutor;
 }
Example #6
0
 public SpecialLiquidationSaga(
     IDateService dateService,
     IChaosKitty chaosKitty,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IRfqService specialLiquidationService,
     MarginTradingSettings marginTradingSettings,
     CqrsContextNamesSettings cqrsContextNamesSettings,
     LiquidationHelper liquidationHelper,
     OrdersCache ordersCache,
     IRfqPauseService rfqPauseService,
     ILog log,
     IAssetPairsCache assetPairsCache)
 {
     _dateService = dateService;
     _chaosKitty  = chaosKitty;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _specialLiquidationService        = specialLiquidationService;
     _marginTradingSettings            = marginTradingSettings;
     _cqrsContextNamesSettings         = cqrsContextNamesSettings;
     _liquidationHelper = liquidationHelper;
     _ordersCache       = ordersCache;
     _rfqPauseService   = rfqPauseService;
     _log             = log;
     _assetPairsCache = assetPairsCache;
 }
Example #7
0
 public PositionsConsumer(OrdersCache ordersCache,
                          IRabbitMqNotifyService rabbitMqNotifyService,
                          IConvertService convertService,
                          IDateService dateService,
                          IAccountsCacheService accountsCacheService,
                          IAccountUpdateService accountUpdateService,
                          IIdentityGenerator identityGenerator,
                          ICqrsSender cqrsSender,
                          IEventChannel <OrderCancelledEventArgs> orderCancelledEventChannel,
                          IEventChannel <OrderChangedEventArgs> orderChangedEventChannel,
                          IEventChannel <OrderActivatedEventArgs> orderActivatedEventChannel,
                          IMatchingEngineRouter meRouter,
                          ILog log)
 {
     _ordersCache                = ordersCache;
     _rabbitMqNotifyService      = rabbitMqNotifyService;
     _convertService             = convertService;
     _dateService                = dateService;
     _accountsCacheService       = accountsCacheService;
     _accountUpdateService       = accountUpdateService;
     _identityGenerator          = identityGenerator;
     _cqrsSender                 = cqrsSender;
     _orderCancelledEventChannel = orderCancelledEventChannel;
     _orderChangedEventChannel   = orderChangedEventChannel;
     _orderActivatedEventChannel = orderActivatedEventChannel;
     _meRouter = meRouter;
     _log      = log;
 }
Example #8
0
 public void Setup()
 {
     RegisterDependencies();
     _validateOrderService = Container.Resolve <IValidateOrderService>();
     _bestPriceConsumer    = Container.Resolve <IEventChannel <BestPriceChangeEventArgs> >();
     _ordersCache          = Container.Resolve <OrdersCache>();
 }
Example #9
0
 public LiquidationCommandsHandler(
     ITradingInstrumentsCacheService tradingInstrumentsCacheService,
     IAccountsCacheService accountsCache,
     IDateService dateService,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IChaosKitty chaosKitty,
     IMatchingEngineRouter matchingEngineRouter,
     ITradingEngine tradingEngine,
     OrdersCache ordersCache,
     ILog log,
     IAccountUpdateService accountUpdateService,
     IEventChannel <LiquidationEndEventArgs> liquidationEndEventChannel)
 {
     _tradingInstrumentsCacheService = tradingInstrumentsCacheService;
     _accountsCache = accountsCache;
     _dateService   = dateService;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _chaosKitty           = chaosKitty;
     _matchingEngineRouter = matchingEngineRouter;
     _tradingEngine        = tradingEngine;
     _ordersCache          = ordersCache;
     _log = log;
     _accountUpdateService       = accountUpdateService;
     _liquidationEndEventChannel = liquidationEndEventChannel;
 }
Example #10
0
 public PricesController(
     IQuoteCacheService quoteCacheService,
     IFxRateCacheService fxRateCacheService,
     OrdersCache ordersCache)
 {
     _quoteCacheService  = quoteCacheService;
     _fxRateCacheService = fxRateCacheService;
     _ordersCache        = ordersCache;
 }
Example #11
0
 public void Setup()
 {
     RegisterDependencies();
     _validateOrderService = Container.Resolve <IValidateOrderService>();
     _bestPriceConsumer    = Container.Resolve <IEventChannel <BestPriceChangeEventArgs> >();
     _ordersCache          = Container.Resolve <OrdersCache>();
     _assetPairsCache      = Container.Resolve <IAssetPairsCache>();
     _me = new FakeMatchingEngine(1);
 }
Example #12
0
 public ReportService(
     IAccountsCacheService accountsCacheService,
     OrdersCache ordersCache,
     IOpenPositionsRepository openPositionsRepository,
     IAccountStatRepository accountStatRepository)
 {
     _accountsCacheService    = accountsCacheService;
     _ordersCache             = ordersCache;
     _openPositionsRepository = openPositionsRepository;
     _accountStatRepository   = accountStatRepository;
 }
Example #13
0
        public void OneTimeSetUp()
        {
            RegisterDependencies();
            _accountsCacheService = Container.Resolve<IAccountsCacheService>();
            _accountUpdateService = Container.Resolve<IAccountUpdateService>();
            _ordersCache = Container.Resolve<OrdersCache>();
            var bestPriceConsumer = Container.Resolve<IEventChannel<BestPriceChangeEventArgs>>();

            bestPriceConsumer.SendEvent(this, new BestPriceChangeEventArgs(new InstrumentBidAskPair { Instrument = "EURUSD", Bid = 1.02M, Ask = 1.04M }));
            bestPriceConsumer.SendEvent(this, new BestPriceChangeEventArgs(new InstrumentBidAskPair { Instrument = "BTCUSD", Bid = 905.1M, Ask = 905.35M }));
        }
Example #14
0
        public PendingMarginInstrumentMigration(
            IAssetPairsCache assetPairsCache,
            OrdersCache orderCache,
            IContextFactory contextFactory)
        {
            _assetPairsCache = assetPairsCache;

            _orderCache = orderCache;

            _contextFactory = contextFactory;
        }
Example #15
0
 public OrderStateConsumer(IRabbitMqNotifyService rabbitMqNotifyService,
                           OrdersCache ordersCache,
                           IDateService dateService,
                           IEventChannel <OrderCancelledEventArgs> orderCancelledEventChannel,
                           IEventChannel <OrderChangedEventArgs> orderChangedEventChannel)
 {
     _rabbitMqNotifyService      = rabbitMqNotifyService;
     _ordersCache                = ordersCache;
     _dateService                = dateService;
     _orderCancelledEventChannel = orderCancelledEventChannel;
     _orderChangedEventChannel   = orderChangedEventChannel;
 }
Example #16
0
 public LiquidationHelper(IMatchingEngineRouter matchingEngineRouter,
                          IDateService dateService,
                          ICqrsSender cqrsSender,
                          OrdersCache ordersCache,
                          IAssetPairDayOffService assetPairDayOffService)
 {
     _matchingEngineRouter   = matchingEngineRouter;
     _dateService            = dateService;
     _cqrsSender             = cqrsSender;
     _ordersCache            = ordersCache;
     _assetPairDayOffService = assetPairDayOffService;
 }
Example #17
0
 public AccountProfileController(
     IMarginTradingAccountHistoryRepository accountsHistoryRepository,
     IMarginTradingOrdersHistoryRepository ordersHistoryRepository,
     IAccountsCacheService accountsCacheService,
     OrdersCache ordersCache,
     MarginSettings settings)
 {
     _accountsHistoryRepository = accountsHistoryRepository;
     _ordersHistoryRepository   = ordersHistoryRepository;
     _accountsCacheService      = accountsCacheService;
     _ordersCache = ordersCache;
     _settings    = settings;
 }
Example #18
0
 public QuoteCacheService(ILog log,
                          IMarginTradingBlobRepository blobRepository,
                          IExternalOrderbookService externalOrderbookService,
                          MarginTradingSettings marginTradingSettings,
                          OrdersCache ordersCache)
     : base(nameof(QuoteCacheService),
            marginTradingSettings.BlobPersistence.QuotesDumpPeriodMilliseconds,
            log)
 {
     _log                      = log;
     _blobRepository           = blobRepository;
     _externalOrderbookService = externalOrderbookService;
     _ordersCache              = ordersCache;
 }
Example #19
0
 public OrderCacheManager(OrdersCache orderCache,
                          IMarginTradingBlobRepository blobRepository,
                          IOrdersHistoryRepository ordersHistoryRepository,
                          IPositionsHistoryRepository positionsHistoryRepository,
                          MarginTradingSettings marginTradingSettings,
                          ILog log)
     : base(nameof(OrderCacheManager), marginTradingSettings.BlobPersistence.OrdersDumpPeriodMilliseconds, log)
 {
     _orderCache                 = orderCache;
     _blobRepository             = blobRepository;
     _ordersHistoryRepository    = ordersHistoryRepository;
     _positionsHistoryRepository = positionsHistoryRepository;
     _log = log;
 }
Example #20
0
        private AccountsProjection AssertEnv(string accountId = null, string failMessage = null)
        {
            _accountBalanceChangedEventChannelMock = new Mock <IEventChannel <AccountBalanceChangedEventArgs> >();
            _accountUpdateServiceMock = new Mock <IAccountUpdateService>();
            _accountUpdateServiceMock.Setup(s => s.UnfreezeWithdrawalMargin(It.Is <string>(x => x == accountId), "test"))
            .Returns(Task.CompletedTask);
            _operationExecutionInfoRepositoryMock = new Mock <IOperationExecutionInfoRepository>();
            _operationExecutionInfoRepositoryMock.Setup(s => s.GetOrAddAsync(It.Is <string>(x => x == "AccountsProjection"),
                                                                             It.IsAny <string>(), It.IsAny <Func <IOperationExecutionInfo <OperationData> > >()))
            .ReturnsAsync(() => new OperationExecutionInfo <OperationData>(
                              operationName: "AccountsProjection",
                              id: Guid.NewGuid().ToString(),
                              lastModified: DateService.Now(),
                              data: new OperationData {
                State = OperationState.Initiated
            }
                              ));

            _logMock = new Mock <ILog>();
            if (failMessage != null)
            {
                _logCounter = 0;
                _logMock.Setup(s => s.WriteInfoAsync(It.IsAny <string>(), It.IsAny <string>(),
                                                     It.Is <string>(x => x == failMessage), It.IsAny <DateTime?>()))
                .Callback(() => _logCounter++).Returns(Task.CompletedTask);
                _logMock.Setup(s => s.WriteWarningAsync(It.IsAny <string>(), It.IsAny <string>(),
                                                        It.Is <string>(x => x == failMessage), It.IsAny <DateTime?>()))
                .Callback(() => _logCounter++).Returns(Task.CompletedTask);
            }

            _accountsCacheService = new AccountsCacheService(DateService, _logMock.Object);
            _accountsCacheService.TryAddNew(Convert(Accounts[0]));
            MtServiceLocator.AccountsCacheService = _accountsCacheService;

            _ordersCache  = new OrdersCache();
            _fakePosition = new Mock <Position>();
            _fakePosition.SetupProperty(s => s.Id, "test");
            _fakePosition.SetupProperty(s => s.AccountId, Accounts[0].Id);
            _fakePosition.SetupProperty(s => s.AssetPairId, "test");
            _fakePosition.SetupProperty(s => s.FxAssetPairId, "test");
            _fakePosition.SetupProperty(s => s.ChargePnlOperations, new HashSet <string>());
            _fakePosition.Setup(s => s.ChargePnL(It.Is <string>(x => x == "test"), It.IsAny <decimal>()));
            _ordersCache.Positions.Add(_fakePosition.Object);

            return(new AccountsProjection(_accountsCacheService,
                                          _accountBalanceChangedEventChannelMock.Object, ConvertService, _accountUpdateServiceMock.Object,
                                          DateService, _operationExecutionInfoRepositoryMock.Object, Mock.Of <IChaosKitty>(),
                                          _ordersCache, _logMock.Object));
        }
Example #21
0
        public void OneTimeSetUp()
        {
            RegisterDependencies();

            _overnightSwapService                = Container.Resolve <IOvernightSwapService>();
            _overnightSwapCache                  = Container.Resolve <IOvernightSwapCache>();
            _quoteCacheService                   = Container.Resolve <IQuoteCacheService>();
            _ordersCache                         = Container.Resolve <OrdersCache>();
            _accountAssetsRepository             = Container.Resolve <IAccountAssetPairsRepository>();
            _fakeMarginTradingAccountsRepository = Container.Resolve <IMarginTradingAccountsRepository>();
            _overnightSwapStateRepository        = Container.Resolve <IOvernightSwapStateRepository>();
            _overnightSwapHistoryRepository      = Container.Resolve <IOvernightSwapHistoryRepository>();
            _rabbitMqNotifyService               = Container.Resolve <IRabbitMqNotifyService>();
            _accountAssetsManager                = Container.Resolve <AccountAssetsManager>();
            _bestPriceConsumer                   = Container.Resolve <IEventChannel <BestPriceChangeEventArgs> >();
        }
Example #22
0
 public FxRateCacheService(ILog log,
                           IMarginTradingBlobRepository blobRepository,
                           IEventChannel <FxBestPriceChangeEventArgs> fxBestPriceChangeEventChannel,
                           MarginTradingSettings marginTradingSettings,
                           IAssetPairDayOffService assetPairDayOffService,
                           OrdersCache ordersCache)
     : base(nameof(FxRateCacheService), marginTradingSettings.BlobPersistence.FxRatesDumpPeriodMilliseconds, log)
 {
     _log            = log;
     _blobRepository = blobRepository;
     _fxBestPriceChangeEventChannel = fxBestPriceChangeEventChannel;
     _marginTradingSettings         = marginTradingSettings;
     _assetPairDayOffService        = assetPairDayOffService;
     _ordersCache = ordersCache;
     _quotes      = new Dictionary <string, InstrumentBidAskPair>();
 }
Example #23
0
 public LiquidationFailureExecutor(
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IAccountsCacheService accountsCache,
     IDateService dateService,
     OrdersCache ordersCache,
     IEventChannel <LiquidationEndEventArgs> liquidationEndEventChannel,
     IAccountUpdateService accountUpdateService,
     ILog log)
 {
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _accountsCache = accountsCache;
     _dateService   = dateService;
     _ordersCache   = ordersCache;
     _liquidationEndEventChannel = liquidationEndEventChannel;
     _accountUpdateService       = accountUpdateService;
     _log = log;
 }
Example #24
0
 public LiquidationSaga(
     IDateService dateService,
     IChaosKitty chaosKitty,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     OrdersCache ordersCache,
     CqrsContextNamesSettings cqrsContextNamesSettings,
     ILog log,
     IAccountsCacheService accountsCacheService,
     IAssetPairDayOffService assetPairDayOffService)
 {
     _dateService = dateService;
     _chaosKitty  = chaosKitty;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _ordersCache = ordersCache;
     _cqrsContextNamesSettings = cqrsContextNamesSettings;
     _log = log;
     _accountsCacheService   = accountsCacheService;
     _assetPairDayOffService = assetPairDayOffService;
 }
Example #25
0
 public OrdersController(
     ITradingEngine tradingEngine,
     IOperationsLogService operationsLogService,
     ILog log,
     OrdersCache ordersCache,
     IDateService dateService,
     IValidateOrderService validateOrderService,
     IIdentityGenerator identityGenerator,
     ICqrsSender cqrsSender)
 {
     _tradingEngine        = tradingEngine;
     _operationsLogService = operationsLogService;
     _log                  = log;
     _ordersCache          = ordersCache;
     _dateService          = dateService;
     _validateOrderService = validateOrderService;
     _identityGenerator    = identityGenerator;
     _cqrsSender           = cqrsSender;
 }
Example #26
0
 public PositionsController(
     ITradingEngine tradingEngine,
     IOperationsLogService operationsLogService,
     ILog log,
     OrdersCache ordersCache,
     IAssetPairDayOffService assetDayOffService,
     IIdentityGenerator identityGenerator,
     ICqrsSender cqrsSender,
     IDateService dateService)
 {
     _tradingEngine        = tradingEngine;
     _operationsLogService = operationsLogService;
     _log                = log;
     _ordersCache        = ordersCache;
     _assetDayOffService = assetDayOffService;
     _identityGenerator  = identityGenerator;
     _cqrsSender         = cqrsSender;
     _dateService        = dateService;
 }
Example #27
0
 public AccountsProjection(
     IAccountsCacheService accountsCacheService,
     IEventChannel <AccountBalanceChangedEventArgs> accountBalanceChangedEventChannel,
     IConvertService convertService,
     IAccountUpdateService accountUpdateService,
     IDateService dateService,
     IOperationExecutionInfoRepository operationExecutionInfoRepository,
     IChaosKitty chaosKitty,
     OrdersCache ordersCache,
     ILog log)
 {
     _accountsCacheService = accountsCacheService;
     _accountBalanceChangedEventChannel = accountBalanceChangedEventChannel;
     _convertService                   = convertService;
     _accountUpdateService             = accountUpdateService;
     _dateService                      = dateService;
     _operationExecutionInfoRepository = operationExecutionInfoRepository;
     _chaosKitty  = chaosKitty;
     _ordersCache = ordersCache;
     _log         = log;
 }
Example #28
0
 public PositionsController(
     ITradingEngine tradingEngine,
     IOperationsLogService operationsLogService,
     ILog log,
     OrdersCache ordersCache,
     IAssetPairDayOffService assetDayOffService,
     IIdentityGenerator identityGenerator,
     ICqrsSender cqrsSender,
     IDateService dateService,
     IAccountHistoryRepository accountHistoryRepository,
     IMarginTradingBlobRepository blobRepository)
 {
     _tradingEngine        = tradingEngine;
     _operationsLogService = operationsLogService;
     _log                      = log;
     _ordersCache              = ordersCache;
     _assetDayOffService       = assetDayOffService;
     _identityGenerator        = identityGenerator;
     _cqrsSender               = cqrsSender;
     _dateService              = dateService;
     _accountHistoryRepository = accountHistoryRepository;
     _blobRepository           = blobRepository;
 }
Example #29
0
 public OrdersController(IAssetPairsCache assetPairsCache,
                         ITradingEngine tradingEngine,
                         IAccountsCacheService accountsCacheService,
                         IOperationsLogService operationsLogService,
                         ILog log,
                         OrdersCache ordersCache,
                         IAssetPairDayOffService assetDayOffService,
                         IDateService dateService,
                         IValidateOrderService validateOrderService,
                         IIdentityGenerator identityGenerator,
                         ICqrsSender cqrsSender)
 {
     _assetPairsCache      = assetPairsCache;
     _tradingEngine        = tradingEngine;
     _accountsCacheService = accountsCacheService;
     _operationsLogService = operationsLogService;
     _log                  = log;
     _ordersCache          = ordersCache;
     _assetDayOffService   = assetDayOffService;
     _dateService          = dateService;
     _validateOrderService = validateOrderService;
     _identityGenerator    = identityGenerator;
     _cqrsSender           = cqrsSender;
 }
Example #30
0
 public PositionsProvider(OrdersCache ordersCache, IDraftSnapshotKeeper draftSnapshotKeeper, ILog log)
 {
     _ordersCache         = ordersCache;
     _draftSnapshotKeeper = draftSnapshotKeeper;
     _log = log;
 }