Ejemplo n.º 1
0
        public void GetMany_Test()
        {
            var entityList = _repo.Get().Result;

            Assert.NotNull(entityList);
            Assert.NotEmpty(entityList);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get all paths for arbitrageing
        /// </summary>
        /// <param name="symbol">Symbol of currency</param>
        /// <param name="quantity">Starting quantity</param>
        /// <returns>Collection of ArbitrageLoop objects</returns>
        private List <ArbitrageLoop> GetPaths(string symbol, decimal quantity)
        {
            var path1 = new string[] { $"{symbol}BTC", $"BTCUSDT", $"{symbol}USDT" };
            var path2 = new string[] { $"{symbol}USDT", $"BTCUSDT", $"{symbol}BTC" };
            var path3 = new string[] { $"{symbol}ETH", $"ETHUSDT", $"{symbol}USDT" };
            var path4 = new string[] { $"{symbol}USDT", $"ETHUSDT", $"{symbol}ETH" };
            var path5 = new string[] { $"{symbol}BTC", $"BTCUSDT", $"ETHUSDT", $"{symbol}ETH" };
            var path6 = new string[] { $"{symbol}ETH", $"ETHUSDT", $"BTCUSDT", $"{symbol}BTC" };
            var paths = new List <ArbitrageLoop>();

            paths.Add(new ArbitrageLoop(path1, quantity));
            paths.Add(new ArbitrageLoop(path2, quantity));
            paths.Add(new ArbitrageLoop(path3, quantity));
            paths.Add(new ArbitrageLoop(path4, quantity));
            paths.Add(new ArbitrageLoop(path5, quantity));
            paths.Add(new ArbitrageLoop(path6, quantity));
            var arbitragePaths = _arbitragePathRepo.Get().Result.ToList();

            for (var i = 0; i < arbitragePaths.Count; i++)
            {
                paths.Add(new ArbitrageLoop(arbitragePaths[i].Path.Split(','), quantity));
            }

            return(paths);
        }
        public async Task <IEnumerable <ArbitragePath> > Get()
        {
            var entities = await _apRepo.Get();

            return(EntitiesToContracts(entities));
        }