Esempio n. 1
0
 public BlogController(ILogger<BlogController> logger, IPostManager postManager, IPortfolioManager portfolioManager, ICacheProvider cacheProvider)
 {
     this.logger = logger;
     this.cacheProvider = cacheProvider;
     this.postManager = postManager;
     this.portfolioManager = portfolioManager;
 }
Esempio n. 2
0
 public SZKingdomTestController(
     IMarketDataProvider marketDataProvider,
     IOrderManager orderManager,
     IPortfolioManager portfolioManager,
     IAccountManager accountManager,
     IMarketDataService marketDataService)
 {
     _marketDataProvider = marketDataProvider;
     _orderManager       = orderManager;
     _portfolioManager   = portfolioManager;
     _accountManager     = accountManager;
     _marketDataService  = marketDataService;
 }
Esempio n. 3
0
 public PortfolioOrchestrator(
     IPortfolioManager portfolioManager,
     IMarketWorkTimeService marketWorkTimeService,
     IMarketDataProviderQueryable marketDataProviderQueryable,
     IMarketDataService marketDataService,
     IStrategyService strategyService,
     IAccountManager accountManager)
 {
     _portfolioManager            = portfolioManager;
     _marketWorkTimeService       = marketWorkTimeService;
     _marketDataProviderQueryable = marketDataProviderQueryable;
     _marketDataService           = marketDataService;
     _strategyService             = strategyService;
     _accountManager = accountManager;
 }
        public InternalTradeReaderJob(
            ILogger <InternalTradeReaderJob> logger,
            ISubscriber <IReadOnlyList <WalletTradeMessage> > subscriber,
            IPortfolioManager manager,
            IHedgeService hedgeService,
            ILpWalletManager walletManager,
            IHedgeSettingsManager hedgeSettings)
        {
            _manager       = manager;
            _hedgeService  = hedgeService;
            _walletManager = walletManager;
            _hedgeSettings = hedgeSettings;
            subscriber.Subscribe(HandleTrades);

            _hedgeTimer = new MyTaskTimer(nameof(InternalTradeReaderJob), TimeSpan.FromMilliseconds(5000), logger, DoHedge).DisableTelemetry();
        }
        public InvetsmentBuyerStateMachine(IPortfolioManager portfolioManager)
        {
            _log = LogProvider.For <InvetsmentBuyerStateMachine>();

            State(() => WaitingForResponce);

            Event(() => InvestmentNew, x => x.CorrelateById(os => os.Investment.Id, ctx => ctx.Message.Investment.Id).SelectId(context => Guid.NewGuid()));

            Event(() => InvetsmentStrategyApproved, x => x.CorrelateById(os => os.Investment.Id, ctx => ctx.Message.Investment.Id));
            Event(() => InvetsmentStrategyRevoked, x => x.CorrelateById(os => os.Investment.Id, ctx => ctx.Message.Investment.Id));

            Event(() => OrderManagementApproved, x => x.CorrelateById(os => os.Investment.Id, ctx => ctx.Message.Investment.Id));
            Event(() => OrderManagementRevoked, x => x.CorrelateById(os => os.Investment.Id, ctx => ctx.Message.Investment.Id));

            CompositeEvent(() => InvestmentApproved, x => x.BuyApprovementState, InvetsmentStrategyApproved, OrderManagementApproved);

            Initially(
                When(InvestmentNew)
                // Set received Investment to machine state
                .Then(ctx => ctx.Instance.Investment = ctx.Data.Investment)
                // Log
                .ThenAsync(ctx => Task.Run(() => _log.Debug($"Investment {ctx.Instance.Investment.ToString()} added to buyer")))
                .TransitionTo(WaitingForResponce));

            During(WaitingForResponce,
                   Ignore(InvetsmentStrategyRevoked),

                   When(InvestmentApproved)
                   // Add investment into portfolio
                   .Then(ctx => portfolioManager.Add(ctx.Instance.Investment))
                   // Log
                   .ThenAsync(ctx => Task.Run(() => _log.Debug($"Investment {ctx.Instance.Investment.ToString()} bought into portfolio")))
                   // Publish new portfolio
                   .Then(ctx => ctx.Publish <InvetsmentBuyerState, IPortfolio>(new { Investments = portfolioManager.GetInvestments() }))
                   .Finalize(),

                   When(OrderManagementRevoked)
                   // Log
                   .ThenAsync(ctx => Task.Run(() => _log.Debug($"Investment {ctx.Instance.Investment.ToString()} revoked")))
                   .Finalize());

            SetCompletedWhenFinalized();
        }
 public PortfolioController()
 {
     _aManager = new PortfolioManager();
 }
Esempio n. 7
0
 public PortfolioService(IPortfolioManager portfolioManager, ICacheService cacheService)
 {
     _portfolioManager = portfolioManager;
     _cacheService     = cacheService;
 }
 public WalletPortfolioGrpc(IPortfolioManager manager)
 {
     _manager = manager;
 }
Esempio n. 9
0
 public PortfolioService(IMapper mapper, IPortfolioManager portfolioManager)
 {
     _mapper           = mapper;
     _portfolioManager = portfolioManager;
 }
 /// <summary>
 /// Portfolio controller
 /// </summary>
 /// <param name="portfolioManager"></param>
 public PortfolioController(IPortfolioManager portfolioManager)
 {
     _log = LogProvider.For <PortfolioController>();
     _portfolioManager = portfolioManager;
 }
 public PortfolioFundManager(IPortfolioManager portfolioManager, IShareManager shareManager, IBenchmarkIndexManager benchmarkIndexManager)
 {
     PortfolioManager      = portfolioManager;
     ShareManager          = shareManager;
     BenchmarkIndexManager = benchmarkIndexManager;
 }
Esempio n. 12
0
 public InvestmentTargetCMSManager(IUnitOfWork unitOfWork, IPortfolioManager portfolioManager)
 {
     _unitOfWork       = unitOfWork;
     _portfolioManager = portfolioManager;
 }