Пример #1
0
        public void GetTicker_Test()
        {
            // Arrange
            var pair = "ETHBTC";

            // Act
            var ticker = _svc.GetTicker(pair).Result;

            // Assert
            Assert.NotNull(ticker);
            Assert.Equal(@"ETH/BTC", ticker.Pair);
        }
Пример #2
0
        /// <summary>
        /// Place a market order
        /// </summary>
        /// <param name="pair">Trading pair</param>
        /// <param name="quantity">Order quantity</param>
        /// <param name="side">Order side</param>
        /// <returns>New order id</returns>
        public static async Task <string> MarketOrder(this IBilaxyDotNet service, string pair, decimal price, decimal quantity, Side side)
        {
            var asset = await GetTradingPair(service, pair);

            var ticker = await service.GetTicker(asset.AssetId);

            return(await service.PlaceOrder(asset.AssetId, quantity, ticker.Last, side));
        }
Пример #3
0
        /// <summary>
        /// Get ticker for a trading pair
        /// </summary>
        /// <param name="pair">Trading pair</param>
        /// <returns>Ticker object</returns>
        public static async Task <Ticker> GetTicker(this IBilaxyDotNet service, string pair)
        {
            var asset = await GetTradingPair(service, pair);

            return(await service.GetTicker(asset.AssetId));
        }