public BTCMarketsExchange(IDataStore _dataStore, ICurrencyPairRepository _currencyPairRepository) { wallets = new List<CurrencyWallet>(); pairsToUpdate = new List<BTCMarketsCurrencyWalletPair>(); syntheticPairsToUpdate = new List<BTCMarketsSyntheticCurrencyWalletPair>(); dataStore = _dataStore; var btcWallet = new FixedFeeCurrencyWallet(0.001M,0.001M, CurrencyType.Bitcoin , this); var ltcWallet = new FixedFeeCurrencyWallet(0.01M, 0.01M, CurrencyType.Litecoin, this); var audWallet = new PercentageFeeCurrencyWallet(0.01M, 0.015M, CurrencyType.AUD, this); wallets.Add(btcWallet); wallets.Add(ltcWallet); wallets.Add(audWallet); var btcusd = new BTCMarketsCurrencyWalletPair(btcWallet, audWallet, _dataStore, "https://api.btcmarkets.net/market/BTC/AUD/tick"); var ltcusd = new BTCMarketsCurrencyWalletPair(ltcWallet, audWallet, _dataStore, "https://api.btcmarkets.net/market/LTC/AUD/tick"); var btcltc = new BTCMarketsSyntheticCurrencyWalletPair(btcWallet, ltcWallet, _dataStore, "https://api.btcmarkets.net/market/BTC/AUD/tick", "https://api.btcmarkets.net/market/LTC/AUD/tick"); pairsToUpdate.Add(btcusd); pairsToUpdate.Add(ltcusd); syntheticPairsToUpdate.Add(btcltc); _currencyPairRepository.Store(btcusd); _currencyPairRepository.Store(ltcusd); _currencyPairRepository.Store(btcltc); }
//protected override System.Web.Http.Dependencies.IDependencyResolver BuildWebApiDependencyResolver() //{ // //get the 'default' resolver, populated from the 'main' config metadata // var resolver = base.BuildWebApiDependencyResolver(); // //check if its castable to a SpringWebApiDependencyResolver // var springResolver = resolver as SpringWebApiDependencyResolver; // //return the fully-configured resolver // return springResolver; //} /// <summary> /// Method for initializaing the single threaded application parts /// </summary> private void InitiliazeApplication() { InputDisruptorPublisher.Shutdown(); OutputDisruptor.ShutDown(); IEventStore inputEventStore = new RavenNEventStore(Constants.INPUT_EVENT_STORE); IEventStore outputEventStore = new RavenNEventStore(Constants.OUTPUT_EVENT_STORE); Journaler inputJournaler = new Journaler(inputEventStore); Journaler outputJournaler = new Journaler(outputEventStore); ExchangeEssentialsList exchangeEssentialsList=outputEventStore.LoadLastSnapshot(); ICurrencyPairRepository currencyPairRepository = (ICurrencyPairRepository) ContextRegistry.GetContext()["CurrencyPairRepository"]; IList<CurrencyPair> tradeableCurrencyPairs = currencyPairRepository.GetTradeableCurrencyPairs(); Exchange exchange; if (exchangeEssentialsList != null) { //means snapshot found so initialize the exchange exchange = new Exchange(tradeableCurrencyPairs, exchangeEssentialsList); InputDisruptorPublisher.InitializeDisruptor(new IEventHandler<InputPayload>[] {exchange, inputJournaler}); OutputDisruptor.InitializeDisruptor(new IEventHandler<byte[]>[] {outputJournaler}); exchange.InitializeExchangeAfterSnaphot(); LimitOrderBookReplayService service = new LimitOrderBookReplayService(); service.ReplayOrderBooks(exchange, outputJournaler); exchange.EnableSnaphots(Constants.SnaphsortInterval); } else { //no snapshot found exchange = new Exchange(tradeableCurrencyPairs); InputDisruptorPublisher.InitializeDisruptor(new IEventHandler<InputPayload>[] { exchange, inputJournaler }); OutputDisruptor.InitializeDisruptor(new IEventHandler<byte[]>[] { outputJournaler }); // check if there are events to replay LimitOrderBookReplayService service = new LimitOrderBookReplayService(); service.ReplayOrderBooks(exchange, outputJournaler); exchange.EnableSnaphots(Constants.SnaphsortInterval); } }
public BTCMarketsExchange(IDataStore _dataStore, ICurrencyPairRepository _currencyPairRepository) { wallets = new List <CurrencyWallet>(); pairsToUpdate = new List <BTCMarketsCurrencyWalletPair>(); syntheticPairsToUpdate = new List <BTCMarketsSyntheticCurrencyWalletPair>(); dataStore = _dataStore; var btcWallet = new FixedFeeCurrencyWallet(0.001M, 0.001M, CurrencyType.Bitcoin, this); var ltcWallet = new FixedFeeCurrencyWallet(0.01M, 0.01M, CurrencyType.Litecoin, this); var audWallet = new PercentageFeeCurrencyWallet(0.01M, 0.015M, CurrencyType.AUD, this); wallets.Add(btcWallet); wallets.Add(ltcWallet); wallets.Add(audWallet); var btcusd = new BTCMarketsCurrencyWalletPair(btcWallet, audWallet, _dataStore, "https://api.btcmarkets.net/market/BTC/AUD/tick"); var ltcusd = new BTCMarketsCurrencyWalletPair(ltcWallet, audWallet, _dataStore, "https://api.btcmarkets.net/market/LTC/AUD/tick"); var btcltc = new BTCMarketsSyntheticCurrencyWalletPair(btcWallet, ltcWallet, _dataStore, "https://api.btcmarkets.net/market/BTC/AUD/tick", "https://api.btcmarkets.net/market/LTC/AUD/tick"); pairsToUpdate.Add(btcusd); pairsToUpdate.Add(ltcusd); syntheticPairsToUpdate.Add(btcltc); _currencyPairRepository.Store(btcusd); _currencyPairRepository.Store(ltcusd); _currencyPairRepository.Store(btcltc); }
public BTCeExchange(IDataStore _dataStore, ICurrencyPairRepository _currencyPairRepository) { wallets = new List <CurrencyWallet>(); pairsToUpdate = new List <BTCeCurrencyWalletPair>(); dataStore = _dataStore; var btcWallet = new FixedFeeCurrencyWallet(0.001M, 0.001M, CurrencyType.Bitcoin, this); var ltcWallet = new FixedFeeCurrencyWallet(0.01M, 0.01M, CurrencyType.Litecoin, this); var usdWallet = new PercentageFeeCurrencyWallet(0.01M, 0.015M, CurrencyType.USD, this); wallets.Add(btcWallet); wallets.Add(ltcWallet); wallets.Add(usdWallet); var btcusd = new BTCeCurrencyWalletPair(btcWallet, usdWallet, _dataStore, "https://btc-e.com/api/2/btc_usd/ticker"); var ltcusd = new BTCeCurrencyWalletPair(ltcWallet, usdWallet, _dataStore, "https://btc-e.com/api/2/ltc_usd/ticker"); var btcltc = new BTCeInverseQuoteCurrencyWalletPair(btcWallet, ltcWallet, _dataStore, "https://btc-e.com/api/2/ltc_btc/ticker"); pairsToUpdate.Add(btcusd); pairsToUpdate.Add(ltcusd); pairsToUpdate.Add(btcltc); _currencyPairRepository.Store(btcusd); _currencyPairRepository.Store(ltcusd); _currencyPairRepository.Store(btcltc); }
public ControlHub(ICurrencyPairRepository currencyPairRepository, ICurrencyPairUpdatePublisher currencyPairUpdatePublisher, IPriceFeed priceFeed) { _currencyPairRepository = currencyPairRepository; _currencyPairUpdatePublisher = currencyPairUpdatePublisher; _priceFeed = priceFeed; }
public ControlHub(ICurrencyPairRepository currencyPairRepository, ICurrencyPairUpdatePublisher currencyPairUpdatePublisher, IPriceFeed priceFeed) { _currencyPairRepository = currencyPairRepository; _currencyPairUpdatePublisher = currencyPairUpdatePublisher; _priceFeed = priceFeed; }
public PricingHub( IPriceLastValueCache priceLastValueCache, ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder) { _priceLastValueCache = priceLastValueCache; _currencyPairRepository = currencyPairRepository; _contextHolder = contextHolder; }
public PricingHub( IPriceLastValueCache priceLastValueCache, ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder) { _priceLastValueCache = priceLastValueCache; _currencyPairRepository = currencyPairRepository; _contextHolder = contextHolder; }
public PriceFeedSimulator( ICurrencyPairRepository currencyPairRepository, IPricePublisher pricePublisher, IPriceLastValueCache priceLastValueCache) { _currencyPairRepository = currencyPairRepository; _pricePublisher = pricePublisher; _priceLastValueCache = priceLastValueCache; _random = new Random(_currencyPairRepository.GetHashCode()); }
public PriceFeedSimulator( ICurrencyPairRepository currencyPairRepository, IPricePublisher pricePublisher, IPriceLastValueCache priceLastValueCache) { _currencyPairRepository = currencyPairRepository; _pricePublisher = pricePublisher; _priceLastValueCache = priceLastValueCache; _random = new Random(_currencyPairRepository.GetHashCode()); }
public MainViewModel( IPricePublisher pricePublisher, IPriceFeed priceFeed, ICurrencyPairRepository currencyPairRepository, Func <CurrencyPairInfo, ICurrencyPairViewModel> ccyViewModelFactory) { _pricePublisher = pricePublisher; _priceFeed = priceFeed; _currencyPairRepository = currencyPairRepository; _ccyViewModelFactory = ccyViewModelFactory; StartStopCommand = new DelegateCommand(StartStopServer); CurrencyPairs = new ObservableCollection <ICurrencyPairViewModel>(); ObserveThroughputs(); }
public MainViewModel( IPricePublisher pricePublisher, IPriceFeed priceFeed, ICurrencyPairRepository currencyPairRepository, Func<CurrencyPairInfo, ICurrencyPairViewModel> ccyViewModelFactory) { _pricePublisher = pricePublisher; _priceFeed = priceFeed; _currencyPairRepository = currencyPairRepository; _ccyViewModelFactory = ccyViewModelFactory; StartStopCommand = new DelegateCommand(StartStopServer); CurrencyPairs = new ObservableCollection<ICurrencyPairViewModel>(); ObserveThroughputs(); }
public TradeApplicationService(ITradeRepository tradeRepository, ICurrencyPairRepository currencyPairRepository, IOrderRepository orderRepository) { _tradeRepository = tradeRepository; _currencyPairRepository = currencyPairRepository; _orderRepository = orderRepository; }
public ReferenceDataHub(ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder) { _currencyPairRepository = currencyPairRepository; _contextHolder = contextHolder; }
public ReferenceDataHub(ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder) { _currencyPairRepository = currencyPairRepository; _contextHolder = contextHolder; }
public Arbitrarge2TradeStrategy(INotificationEngine _notificationEngine, ICurrencyPairRepository _currencyPairRepository, IDataStore _dataStore) { currencyPairRepository = _currencyPairRepository; notificationEngine = _notificationEngine; dataStore = _dataStore; }
public RateExchanger(ICurrencyPairRepository exchangeRateRepository) { this.exchangeRateRepository = exchangeRateRepository; }
public Arbitrarge2TradeStrategy( INotificationEngine _notificationEngine, ICurrencyPairRepository _currencyPairRepository, IDataStore _dataStore) { currencyPairRepository = _currencyPairRepository; notificationEngine = _notificationEngine; dataStore = _dataStore; }